I've been looking around for a while and can't seem to find a good answer for this so I thought I'd ask before spending another couple of days banging my head on my desk.
I have a Ubuntu box with two physical interfaces and one virtual interface.
eno1 - 172.16.0.100
eno2 - 172.16.0.101
eno1:0 - x.x.x.x
What I'd like to get
- For responses to incoming packets I'd like the packets to go out on the interface its request came in on.
For outgoing packets I'd like them to go out by default on...
a. eno1 - for packets destined for private networks (multiple non-contiguous 172.16.x.0 ranges) b. eno1:0 - for packets destined for all other networks
Current Setup
ip rule list
0: from all lookup local
32760: from all to x.x.x.x lookup eno1:0
32761: from x.x.x.x lookup eno1:0
32762: from all to 172.16.0.101 lookup eno2
32763: from 172.16.0.101 lookup eno2
32764: from all to 172.16.0.100 lookup eno1
32765: from 172.16.0.100 lookup eno1
32766: from all lookup main
32767: from all lookup default
ip route list table eno1:0
default via x.x.x.1 dev eno1
ip route list table eno1
default via 172.16.0.1 dev eno1
172.16.0.0/24 dev eno1 scope link src 172.16.0.100
ip route list table eno2
default via 172.16.0.1 dev eno2
172.16.0.0/24 dev eno2 scope link src 172.16.0.101
ip route list
default via 172.16.0.1 dev eno1 onlink
x.x.x.0/23 dev eno1 proto kernel scope link src x.x.x.x
172.16.0.0/24 dev eno2 proto kernel scope link src 172.16.0.101
172.16.0.0/24 dev eno1 proto kernel scope link src 172.16.0.100
sysctl values for both eno1 and eno2
arp_filter=1
arp_ignore=1
arp_announce=2
Problems
- I can sporadically reach eno1 and eno2 from ranges outside their subnets but I can't reach eno1:0 at all.
- From the box I can't reach the internet (public IPs) at all.