本文共 2218 字,大约阅读时间需要 7 分钟。
6.1.2 lvs客户端
[root@huludao-2 ~]# more /usr/local/bin/lvs_real #!/bin/bash #description : start realserver VIP=61.135.20.16 /etc/rc.d/init.d/functions case "$1" in start) echo " start LVS of REALServer" /sbin/ifconfig lo:0 $VIP broadcast $VIP netmask 255.255.255.255 up 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 ;; stop) /sbin/ifconfig lo:0 down echo "close LVS Directorserver" echo "0" >/proc/sys/net/ipv4/conf/lo/arp_ignore echo "0" >/proc/sys/net/ipv4/conf/lo/arp_announce echo "0" >/proc/sys/net/ipv4/conf/all/arp_ignore echo "0" >/proc/sys/net/ipv4/conf/all/arp_announce ;; *) echo "Usage: $0 {start|stop}" exit 1 esac |
fav1# more /usr/local/bin/lvs_real_bsd #!/usr/local/bin/bash #description : start realserver VIP=61.135.20.16 case "$1" in start) echo " start LVS of REALServer" /sbin/ifconfig lo0 $VIP netmask 255.255.255.255 alias -arp up ;; stop) /sbin/ifconfig lo0 alias down echo "close LVS Directorserver" /sbin/ifconfig lo0 127.0.0.1 arp up ;; *) echo "Usage: $0 {start|stop}" exit 1 esac |