CentOS 使用LVS的VS/TUN功能搭建邮件集群

2012年2月8日 | 标签: , ,

负载调度器
一定要有二个IP下例VIP为183.25.31.230
安装ipvsadm 执行yum install ipvsadm;modproble ipip
ifconfig eth0:0 183.25.31.230 netmask 255.255.255.255 broadcast 183.25.31.230 up
route add -host 183.25.31.230 dev eth0:0
ipvsadm -C
ipvsadm -A -t 183.25.31.230:25 -s wlc
ipvsadm -a -t 183.25.31.230:25 -r 121.18.15.8 -i -w 1

echo “0″ >/proc/sys/net/ipv4/ip_forward
echo “1″ >/proc/sys/net/ipv4/conf/all/send_redirects
echo “1″ >/proc/sys/net/ipv4/conf/default/send_redirects
echo “1″ >/proc/sys/net/ipv4/conf/eth0/send_redirects

ip tunnel add tun0 mode ipip remote 121.18.15.8 local 183.25.31.227 dev eth0
ifconfig tun0 10.0.0.1 netmask 255.255.255.252 pointopoint 10.0.0.2
ifconfig tun0 mtu 1500 up

真实服务器操作
#配置tunl0 (记得检查iptables)
modprobe ipip
ip tunnel add tun0 mode ipip remote 183.25.31.227 local 121.18.15.8 dev eth0
ifconfig tun0 10.0.0.2 netmask 255.255.255.252 pointopoint 10.0.0.1
ifconfig tun0 mtu 1500 up

ifconfig tunl0 183.25.31.230 netmask 255.255.255.255 broadcast 183.25.31.230 up
#增加路由
route add -host 183.25.31.230 dev tunl0(可以不加)
#关闭转发功能
echo “0″ >/proc/sys/net/ipv4/ip_forward

目前还没有任何评论.