Gateway status checking methods on linux/bsd [closed]
I'd like to know if there's any reliable tools I could use (integrate with my network config) to monitor the status of the gateway and switch the default gw when it detects that the main gateway is dead?
How reliable is ping based checking, anything else to achieve the same result? What method do you use, if any?
This is basically for "high-availability" internet sharing - office gateway is connected to two ISPs at the time and auto switches the active when the other one is down.
EDIT:
I'm looking for a reliable, possibly non ping based solution, software.
Solution 1:
The good way would be to do this on network side, with two routeur using HSRP to share the same IP. With this if one router or one link fail, the second router would take the IP of the first one (this is a basic explanation). With this you are sure that the default gateway of your computers will work. Now if you really want a solution on server side, I guess that I would ping something on Internet (like IPS dns server as Dave Cheney says but also well know website like google and yahoo may be) and also check with tcpdump/ethereal if I receive packet from Internet. Because for any reason ICMP can not reply but the link can be in a good state so that you will probably see incomming data (from internet) on the server ethernet card.
Edit: as you added "I'm looking for a reliable, possibly non ping based solution, software.". I could suggest to monitor both router with SNMP if this is possible. It would help if you tell us what kind of routers are used, if you can access them and so on.
Solution 2:
As far as I understand, HSRP is not an option since this would have to be configured between the two ISPs. Since they won't do this, I think you have to do the "automatic failover" with a script which detects a faulty route. e.g. freebsddiary success story
Why does ping not fulfill you requirements? In my opinion it's the lowest possible IP based tool to test connectivity.