I have two internet connections. One is a partial T1 of data (and rest voice) the other is business cable. Both connections come into my office into (2) centos 5 boxs with 2 ethernet cards in each box. The second ethernet card is 192.168.1.59 and 192.168.1.1 respectively.
I have all my DHCP settings setup for a gateway of 192.168.1.1
In the event that the internet connection is DOWN (box is fine just the cable modem is down) how do I set things up so I can take advantage of the second internet connection?
Thanks for any tips.
Jerry
In the event that the internet connection is DOWN (box is fine just the cable modem is down) how do I set things up so I can take advantage of the second internet connection?
there are more ideal [and complex] ways of setting up the connections so you only use one firewall - maybe using the second as a failover - but assuming you want to keep your infrastructure the same:
create a second routing table one the cable modem firewall, with a default route of the other firewall.
(assuming the other firewall is 10.10.10.2 and the internal NIC is eth1)
# echo 2 >> /etc/iproute2/rt_tables # ip rule add fwmark 3 table 2 # ip route add default via 10.10.10.2 dev eth1 table 2
write a simple bash script that pings the cable modem's gateway. on failure, after a predetermined amount of time, add an "iptables" rule such as the following to use the second routing table:
(assuming 10.10.10.0/24 is your internal LAN) # iptables -t mangle -A PREROUTING -s 10.10.10.0/24 -j MARK --set-mark 3
You can extend your BASH script to remove the IPTABLES rule once it re-establishes contact with your cable modem's gateway.
it's not an elegant solution, but it's a simple one.
-ken
Thanks for any tips.
Jerry