Total Pageviews

Wednesday, 6 April 2016

LVS Tunnel的安装

今天整理文件时找到的,先存下来。

#client
modprobe ipip
ip addr add 192.168.52.185/32 dev tunl0
ip link set tunl0 up
/sbin/ifconfig tunl0 192.168.52.185 broadcast 192.168.52.185 netmask 255.255.255.255 up
echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce
echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
echo 2 > /proc/sys/net/ipv4/conf/tunl0/arp_announce
echo 1 > /proc/sys/net/ipv4/conf/tunl0/arp_ignore

#server(debian)
modprobe ip_vs
apt-get install ipvsadm
ifconfig eth1:1 192.168.52.185 netmask 255.255.255.255 broadcast 192.168.52.255 up
echo "1" > /proc/sys/net/ipv4/ip_forward
ipvsadm -C
ipvsadm -A -t 192.168.52.185:80  -s wlc
ipvsadm -a -t 192.168.52.185:80 -r 192.168.52.119:80 -w 2 -i
ipvsadm -a -t 192.168.52.185:80 -r 192.168.51.14:80 -w 2 -i