Bart Locanthi <bart@xxxxxxxx> writes:
>> [1] On a somewhat larger scale. We have two LVS/NAT routers, on
>> separate physical switches from our provider, both with two internal
>> interfaces[2], and all real servers have two interfaces.
> are you running HA on this (two external interfaces each?) or simply
> relying on the extra paths?
That was two *internal* interfaces. The two routers obviously have
different IP addresses externally. We're running heartbeat for the
virtual IP addresses so that they will move between the routers as
required, as well as for the internal default router addresses so that
internal machines can always get out as well.
The internal servers are running a little script which monitors the
reachability of the default router, and if it fails switches over to the
other interface. I'll attach it on the end, as it's pretty simple.
Brian.
----- snip -----
#!/bin/bash
PATH=/sbin:$PATH
if route -n | egrep -q '^0\.0\.0\.0'; then
date
echo 'Default route exists, aborting.'
echo
exit 1
fi
date
subnet=1
echo "Setting default route to 10.2.${subnet}.254."
route add default gw 10.2.${subnet}.254
failures=0
echo
while true; do
sleep 5
if ping -c 1 -w 2 10.2.${subnet}.254 >/dev/null 2>&1; then
failures=0
else
failures=`expr $failures + 1`
fi
if [ $failures -lt 3 ]; then continue; fi
date
echo "Default route failure detected."
route del default gw 10.2.${subnet}.254
subnet=`expr $subnet + 1`
if [ $subnet -gt 2 ]; then subnet=1; fi
echo "Setting default route to 10.2.${subnet}.254."
route add default gw 10.2.${subnet}.254
failures=0
echo
done
# EOF
|