TUN LVS上(10.133.11.45上):
ifconfig tunl0 10.133.11.46 netmask 255.255.255.255 up
route add -host 10.133.11.46 dev tunl0
ifconfig eth0 10.133.11.45 broadcast 10.133.11.255 netmask 255.255.255.0 up
ipvsadm -C
ipvsadm -A -t 10.133.11.46:80 -s rr
ipvsadm -a -t 10.133.11.46:80 -r 10.133.11.47:80 -i
---------------
realserver(10.133.11.47上):
ifconfig tunl0 10.133.11.46 netmask 255.255.255.255 up
route add -host 10.133.11.46 dev tunl0
ifconfig eth0 10.133.11.47 broadcast 10.133.11.255 netmask 255.255.255.0 up
echo 1 > /proc/sys/net/ipv4/conf/tunl0/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/tunl0/arp_announce
echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce
--------------------------------------------------------------------
DR:LVS上(10.133.11.45上)
ifconfig eth0 10.133.11.45 broadcast 10.133.11.255 netmask 255.255.255.0 up
ifconfig eth0:0 10.133.11.46 netmask 255.255.255.255 up
route add -host 10.133.11.46 dev eth0:0
#!/bin/bash
#ipvs.sh
ipvsadm -C
ipvsadm -A -t 10.133.11.46:80 -s rr
ipvsadm -a -t 10.133.11.46:80 -r 10.133.11.47:80 -g
---realserver (10.133.11.47上)
ifconfig eth0 10.133.11.47 broadcast 10.133.11.255 netmask 255.255.255.0 up
ifconfig lo:0 10.133.11.46 netmask 255.255.255.255 up
route add -host 10.133.11.46 dev lo:0
#!/bin/bash
#arp.sh
echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce