[TriLUG] Conflicting Default Gateways

Kevin Miller kevinm at gmail.com
Mon Aug 16 11:42:51 EDT 2004


> normally.  However, if I configure eth1 to be aware of its default gateway
> (.100.1), something becomes amiss, and things such as host and dig get
> broken.  I'm using system-config-network to make these settings; I don't
> know if that matters.

Your problem is that you have two default routes, and every packet
will be sent to one of the two defaults. So if you have a TCP
connection, your first M packets might be sent eth0 but then the next
N go eth1. If you aren't multihomed and announcing IP space, this will
break. You'll either be caught be NATting (and thus the middle N
packets have a different source address) or ingress route filters at
the upstream ISPs (not allowing someone else's IPs as source addresses
into their network, as they should).

You want to look at the 'ip' command, specifically 'ip rule' and the
ability to have multiple routing tables. You'll want to create a rule
that selects traffic from the eth1 IP address and routes it via a
second routing table. In this second routing table is your default
route to eth1. Traffic that doesn't match the rule sees only 1 default
route in the main routing table.

This page might explain this in greater detail:
http://www.linuxguruz.com/iptables/howto/2.4routing-4.html

-Kevin



More information about the TriLUG mailing list