# Add vip after arptables is initialized ip link add ipvs0 type dummy ip addr add $VIP/32 brd + dev ipvs0
stop_lvs_realserver.sh
1 2 3 4 5 6 7 8
VIP=10.0.0.8 REALIP=10.0.0.42
# stop realserver ip addr del $VIP/32 brd + dev ipvs0 ip link del ipvs0 arptables -D INPUT -j DROP -d $VIP arptables -D OUTPUT -j mangle -s $VIP --mangle-ip-s $REALIP
start_lvs_directserver.sh
1 2 3 4
ip addr add 10.0.0.8 dev eth0 ipvsadm -A -t 10.0.0.8:80 -s rr ipvsadm -a -t 10.0.0.8:80 -r 10.0.0.42:80 -g ipvsadm -a -t 10.0.0.8:80 -r 10.0.0.43:80 -g