Tom Sightler wrote:
Now we can add a new "route table" that has a completely different
"default route" for eth2 as follows:

#ip route add default via 120.207.9.1 dev eth2 tab 1
#ip rule add from 120.207.9.13/32 tab 1 priority 500
#ip route flush cache

This rule basically says that if a packets source address is
120.207.9.13 (eth2) use the default gateway configured for route table 1
(120.207.9.1) rather than the "default gateway" from the "main" route
table (table 254).  Since packets from clients to the eth2 IP address
have to use that same IP for their reply packets, those packets should
returns the same way they came.

If this works, I'll eat my hat AND my humble pie. :-) I don't have any experience with multiple routing tables, but I can't believe any "from" rule is going to apply to the systems own interfaces. The outbound interface to use was _determined_ by the routing tables, it can't be a factor in the routing. But I'm intrigued enough that I'll try testing this at home this weekend if I can figure out a test setup, if only to learn more about why you'd have more than one routing table. Will also see about the behavior of multiple gateways when apps are bound to interfaces...

-Ed

_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

Reply via email to