[CentOS] CentOS 4.x - Multiple gateways
feizhou at graffiti.net
Fri May 26 06:35:17 UTC 2006
Tom Brown wrote:
> On a multihomed box how can i set different gateways for each NIC?
> Setting them in the ifcfg-ethx does not seem to make any difference to
> the routing?
> CentOS mailing list
> CentOS at centos.org
Try creating routing tables per NIC, populating those tables and
creating ip rules to lookup the respective table. This means you need to
identify which NIC the packets belong to. You can try adding rules to
the mangle PREROUTING chain of netfilter to mark the packets based on
their source ip. Then the ip rules can instruct the kernel to lookup the
proper routing table depending on the firewall mark.
man ip, man iptables, http://linux-ip.net/html/routing-tables.html and
More information about the CentOS