Tuesday 3 June 2003 at 11:56am, Martin wrote:
Linux WILL allow you to configure multiple default routes, but this generally makes sense only if you have multiple interfaces, or you are running a routing protocol. On your end host, which appears from your
I don't think this is true either. It makes sense to have multiple default gateways even with one interface as you may want to do load balancing via 2 or more next hops or for redundancy purpose and has nothing to do with routing protocol as static default route is mostly being used for end nodes not running any routing protocols. I disagree. An end host with a single interface, as in this situation, has no business trying to make load-balancing decisions that would be best made by the router owning the multiple interfaces with the information about the state of those interfaces as well as the knowledge about traffic on them from other end hosts. Moreover, router redundancy is handled by routers, not hosts, as it is very undesirable that hosts actually have to make decisions about what router to attempt to reach. VRRP, for example, makes it simple to hosts not to need to worry about what router to contact.
The other thing is that doing routing the way the default gateway is on the different IP subnet then host even being on the same physical 'cable' impose significant performance degradation as for each packet there has to be done recursive route lookup plus arp-ing, so even Anders showed it's possible to make it work it's not the best practice.
I don't understand what recursion you're talking about. There is a single route table in the end host that is searched using longest prefix match until (in this case) the default route entry is found and the packet sent to the next hop gateway. ARP-ing should not be a factor whether the gateway host is on the same subnet or not. ARP is done once for each IP address on the wire, and the MAC address received cached in the ARP table until it expires. I've not tested the performance of this type of configuration, but I would be surprised if it were different at all, let alone significantly different. I do agree that this type of configuration is not the best practice. Regards, Jim