If i assign metric 1 to 1st gway and 2 to 2nd it never falls back from gateway with best metric. Even if it goes down it still sticks to it. Something is terribly wrong. I am running Slackware 10. On Sat, 09 Oct 2004 20:20:26 -0400, Kevin J. Cummings <cummings@xxxxxxxxxxxxxxxxxx> wrote: > > > Adrian C. wrote: > > Hello. I'm trying to setup a simple failover between 2 gateways on kernel 2.6.2 > > Here it goes. > > just one interface for everything: eth0 > > route add default gw 192.168.1.1 > > route add default gw 192.168.2.1 > > > > let's say i ping gmail.com and i kill the 192.168.1.1 machine. ping > > stops for about 2 minutes then the next gateway is used and the ping > > comes back to live. The only problem here is that it forgets to NAT my > > clients via the new gway. At least that's my only explanation why it > > stops NATting. Masquerading is done without a -d so destination is > > any. What can be done here? > > Also please let me know the files in which i should modify fallback > > timeout for routes. I need a route check every 10 seconds or so. > > One more thing, if 192.168.1.1 comes back to live i would like to > > become the preferred gateway no matter if 192.168.1.2 is alive and > > used by kernel. Is this solved by metrics? > > I thought that this is what Metrics were supposed to do. If you > *prefer* the .1.1 route, assign it a better Metric than the .2.1 route. > Then, when the .1.1 route goes down, the packets should be immediately > re-routed to the .2.1 interface, and when the .1.1 comes back up, the > first route should work again. THat's *my* understanding of how Metrics > are supposed to work. > > I'm not an expert, and I'm not sure about what happens after a TCP > connection is already established and then an interface fails (or > restores) whether *that* connection will continue to use the previous > routing or not. > > -- > Kevin J. Cummings > kjchome@xxxxxxx > cummings@xxxxxxxxxxxxxxxxxx > cummings@xxxxxxxxxxxxxxxxxxxxxxx > - : send the line "unsubscribe linux-admin" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html