码迷,mamicode.com
首页 > 其他好文 > 详细

auto_config_lvs+keepalived_realserver_vip_on_lo:0

时间:2018-07-24 15:51:58      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:null   bin   sbin   out   art   live   client   add   config   

#!/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

auto_config_lvs+keepalived_realserver_vip_on_lo:0

标签:null   bin   sbin   out   art   live   client   add   config   

原文地址:http://blog.51cto.com/efoni/2149493

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!