LVS--DR模型

RS配置

ifconfig lo:0 172.16.125.100 broadcast 172.16.125.100 netmask 255.255.255.255 up

route add -host 172.16.125.100 dev lo:0

echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore 

echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore 

echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce 

echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce


VIP配置

ifconfig eth0 172.16.125.100 up

route add -host 172.16.125.100 dev eth0

ipvsadm -A -t 172.16.125.100:80 -s rr

ipvsadm -a -t 172.16.125.100:80 -r 172.16.125.6 -g

ipvsadm -a -t 172.16.125.100:80 -r 172.16.125.7 -g

ipvsadm -L -n