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

Lvs DR模式配置

时间:2015-11-18 22:48:38      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:

#!/bin/bash
#lvs setting
#DIP# eth0:192.168.233.145
#VIP# eth0:0 192.168.233.250/32

#RIP1:192.168.233.146
#RIP2:192.168.233.147
#VIP# 192.168.233.250/32



case $1 in

rip)
#VIP:
iptables -F
setenforce 0
echo 1 >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo 1 >/proc/sys/net/ipv4/conf/all/arp_ignore
echo 2 >/proc/sys/net/ipv4/conf/lo/arp_announce
echo 2 >/proc/sys/net/ipv4/conf/all/arp_announce
ifconfig lo:0 192.168.233.250 netmask 255.255.255.255 broadcast 192.168.233.250 up
route add -host 192.168.233.250 dev lo:0

;;
dip)

#DIP:
iptables -F
setenforce 0

echo 1 >/proc/sys/net/ipv4/ip_forward
ifconfig eth0:0 192.168.233.250 netmask 255.255.255.255 broadcast 192.168.233.250 up
ipvsadm -C
ipvsadm -A -t 192.168.233.250:80 -s wlc
ipvsadm -a -t 192.168.233.250:80 -r 192.168.233.146 -g
ipvsadm -a -t 192.168.233.250:80 -r 192.168.233.147 -g
ipvsadm -Ln
;;

esac
#End#

 

Lvs DR模式配置

标签:

原文地址:http://www.cnblogs.com/caoguo/p/4975997.html

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