分类:
2008-11-13 12:08:17
1、 LB:eth0:10.1.1.1 eth0:1:10.1.1.2(虚地址,必须配置)
2、 RS:eth0:10.1.1.3/4
3、 rs#vi /etc/sysconfig/network-scripts/ifcfg-lo:1
DEVICE=lo:1
IPADDR=1.1.1.2
NETMASK=255.255.255.255
NETWORK=1.1.1.2
ONBOOT=yes
ARP=no
4、rs#vi /etc/rc.local
route add -host 1.1.1.2 dev lo:1
5、 ipvsadm –A –t 10.1.1.2:80 -s wrr –p
6、 ipvsadm -a –t 10.1.1.2:80 -r 10.1.1.3:80 –g
7、 ipvsadm -a –t 10.1.1.2:80 -r 10.1.1.4:80 –g
8、rs#vi /etc/sysctl.conf
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
9、lb#vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
lb#sysctl -p