部署LVS-DR模式的时候,我们需要对后端realserver设置的vip禁止ARP广播回应,后端realserver服务器可能是linux或者windows

(一)、对于realserver 是linux的系统 ,给后端服务器配置vip的方法

   真实服务器(real server)配置

       ip配置

     1)ip:10.0.0.11/16

       gw:10.0.0.139

 

       vip:172.16.10.100

       # ifconfig lo:0 172.16.10.100/32 broadcast 172.16.10.100  设置广播地址为自己。

 

       禁用接收广播回应配置

       #vim /etc/sysctl.conf

        net.ipv4.conf.lo.arp_ignore = 1

        net.ipv4.conf.lo.arp_announce = 2

        net.ipv4.conf.all.arp_ignore = 1

       net.ipv4.conf.all.arp_announce = 2  

       # sysctl -p

       或者

       # yum install arptables_jf    

       # arptables -A IN -d 172.16.10.100 -j DROP   

 

       添加路由

       # route add -host 172.16.10.100 dev lo:0 



(二)、对于real server 是windows服务器的服务器 VIP的添加方法:

1、关闭、禁止系统自带防火墙

2、新增回环网卡

方法是:开始——运行——hdwwiz 

或者win(ctrl与alt中间的键)+R键——hdwwiz   回车之后

spacer.gifwKioL1OvqlmxzotmAAIszno7Ukg566.jpg

然后

wKiom1OvqrGhEGDIAAFDLmM4Tck228.jpg

spacer.gif

下一步


spacer.gifwKioL1OvqqWyNY6VAADvBN4elLY365.jpg

下一步


spacer.gifwKiom1OvqvShgjpqAADdf6CiYqM375.jpg

下一步

 spacer.gifwKioL1Ovqubzm-QtAAF98TrOyYg907.jpg

下一步(等待几秒钟)选择途中选项

wKiom1OvqzewVJHUAAIPfl070d4539.jpg

spacer.gif

再下一步直到完成

打开网络适配器可以看到多出了个lo接口spacer.gif

wKiom1Ovq1XBN7QUAAG5YXPDBN0414.jpg

3、配置环回ip为vip的ip,掩码255.255.255.255

4、4.修改网卡信息

在命令行下修改,开始--运行--cmd
netsh interface ipv4 set interface "本地连接" weakhostreceive=enabled
netsh interface ipv4 set interface "本地连接" weakhostsend=enabled
netsh interface ipv4 set interface "本地连接2" weakhostreceive=enabled
netsh interface ipv4 set interface "本地连接2" weakhostsend=enabled