cat /home/master/init_pandora.sh
#! /bin/sh
user=`whoami`
if [ $user = 'master' ]
then
sudo /sbin/ifconfig lo:0 172.16.254.13 broadcast 172.16.254.13 netmask 0xffffffff up
sudo /sbin/route add -host 172.16.254.13 dev lo:0
sudo /sbin/ifconfig lo:1 172.16.254.91 broadcast 172.16.254.91 netmask 0xffffffff up
sudo /sbin/route add -host 172.16.254.91 dev lo:1
sudo /sbin/route add default gw 172.16.0.1
else
ifconfig lo:0 172.16.254.13 broadcast 172.16.254.13 netmask 0xffffffff up
route add -host 172.16.254.13 dev lo:0
ifconfig lo:1 172.16.254.91 broadcast 172.16.254.91 netmask 0xffffffff up
route add -host 172.16.254.91 dev lo:1
route add default gw 172.16.0.1
fi
/sbin/ifconfig lo:0 $vip broadcast $vip netmask 255.255.255.255 up /sbin/ifconfig lo:9 172.16.254.63 broadcast 172.16.254.63 netmask 0xffffffff up 效果一样