tongyi007 发表于 2018-12-30 15:27:11

auto_config_lvs+keepalived_realserver_vip_on_lo:0

  #!/bin/bash
#LVS client realserver vip config on lo:0
VIP = 192.168.189.288
  case $1 in
start)
ifconfig lo:0 $VIP netmask 255.255.255.255 broadcast $VIP
/sbin/route add -host $VIP dev lo:0
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
sysctl -p >/dev/null 2>&1
echo "RealServer start OK"
exit 0
;;
  stop)
ifconfig lo:0 down
route del $VIP >/dev/null 2>&1
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 "RealServer stoped OK"
exit 1
;;
  *)
echo "usage: $0 {start|stop}"
;;
  esac



页: [1]
查看完整版本: auto_config_lvs+keepalived_realserver_vip_on_lo:0