07-24-2012 11:07 AM - edited 03-04-2019 05:03 PM
Attached is a picture of my network.
RedHat Linux Host 1 has a Eth0 with 172.21.0.17/19. Eth1 has 172.21.32.17/19.
Since Linux (and all operating systems) can have only a single default gateway, we need to figure out how to have some routes for the Eth1 interface.
My local switches are in Layer 2 and in VLAN1. They are connected up to a router with an inside interface on the same subnet with Eth0 (gateway) and Eth1.
Because I have a default gateway on Eth0, I have no problem pinging the 10.0.3.1 NTP server that you see beyond my router. When I unplug the cable on Eth0 I lose my ability to ping the NTP server since there is no route via Eth1.
So, I know this is a more of a Linux question but I thought maybe someone here has come across this before.
Thanks in advance for any help you can provide. My fingers are practically bloody from all the Googling I have been doing on this topic.
Oh, and the first suggestion I usually get is to just bond the NICs...unfortunately, our application does not support the bonding.
07-24-2012 11:51 AM
what do you want exactly ? fallover on eth1 for this 10 network ? then why not just put 2 routes to this network, one with a longest match through eth0 and the other with a shorter match through eth 1 ? the default will then be used for other remote subnets other than the 10 network.
Regards.
Alain
Don't forget to rate helpful posts.
07-24-2012 11:55 AM
What I need to do is, when my Eth0 switch goes down (and my NIC with it), I need my host to send packetsto the 10.0.3.1 via 172.21.32.3 router since my default gateway router is unreachable.
James
07-24-2012 12:33 PM
Hi,
Wouldn't it be what you are searching for ?
http://kindlund.wordpress.com/2007/11/19/configuring-multiple-default-routes-in-linux/
Regards.
Alain
Don't forget to rate helpful posts.
07-25-2012 05:56 AM
Unfortunately, that is not it.
The issue here is with the Linux kernel in that it doesn't appear to remove the default route out Eth0 when a cable is unplugged or the switch goes down.
The ping packets to the 10.x.x.x network still try to go out Eth0. When I run an ifdown eth0 then the packets will see the route on Eth1 since the default route finally gets taken away.
But that is a manual intervention I cannot implement.
07-25-2012 06:20 AM
Hi,
maybe you could do a script which flushes the primary default route when a ping to next-hop is failing( a little bit like implementing static routing with EOT on Cisco devices)
Regards.
Alain.
Don't forget to rate helpful posts.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide