Source/Policy based routing on multihomed host
I have a couple of debian machines with multiple interfaces (two dual-port
10/100 e100 cards - bond0 & bond1). When the systems are started, each
interface receive packets, and the machines can access the internet etc.
with no problems.
The issue is that whilst the interfaces receive packets on both bond0 and
bond1, and transmitted packets always go via bond0, bond1 has 0 Tx packets,
I believe, after a Google search, that this is due to asymetric routing, and
is addressed via use of the iproute2 package. I apt-get'd iproute2, and set
the new route and rules thus:
ip route add default via 192.168.0.1 dev bond0 tab 1 (192.168.0.1 is the
ip route add default via 192.168.0.1 dev bond1 tab 2
ip rule add from 192.168.0.3/32 tab 1 priority 500 (bond0 addr)
ip rule add from 192.168.0.4/32 tab 2 priority 600 (bond1 addr)
ip route flush cache
This results in packets being Rx and Tx via the appropriate devices - the
local network works a treat, all machines can talk to all other machines on
the local lan ONLY....the servers cannot contact the internet.
DNS is handled via a local machine, and name lookups work fine - when a
"ping" (for example) is attempted I get "No route to host"...
Anyone have any ideas?