Our network has two modems, each one hidden behind a router. The primary router is on 10.1.1.1, the backup router is on 10.1.1.2, and are both configured to the 10.1.1.0/24 subnet. Both routers have their gateway configured to 192.168.0.1. However, the 192.168.0.1 that you see if your gateway is 10.1.1.1 is a different machine from the 192.168.0.1 that you see if your gateway is 10.1.1.2.
My Nagios server is set up accordingly:
auto eth0 iface eth0 inet static address 10.1.1.10 netmask 255.255.255.0 gateway 10.1.1.1
So to be clear: there are four gateways here. Router1 (10.1.1.1) Router2 (10.1.1.2) Modem1 (192.168.0.1) Modem2 (192.168.0.1)
Here's an illustration of what I can do manually to check the status of the two modems:
ping -c4 192.168.0.1 # Is Modem1 up? ip route add via 10.1.1.2 ip route change default via 10.1.1.2 ping -c4 192.168.0.1 # Is Modem2 up? wget 192.168.0.1 # yields expected control webpage for Modem2 ip route change default via 10.1.1.1 ip route del default via 10.1.1.2 wget 192.168.0.1 # Connection refused; Modem1 has no web interface ssh email@example.com # I can log in to Modem1 and check status
I would like at a minimum to be able to ping Modem2.
*Edited to correct my abominable misuse of CIDR notation, and provide clear detail. (I don't think this belongs on superuser.)