LVS Server
# 外网IP:10.10.10.1 内网IP:172.25.25.3 vim /etc/sysctl.conf net.ipv4.ip_forward = 1 sysctl -p iptables -t nat -I POSTROUTING -s 172.25.25.0/24 -o eth0 -j SNAT --to-source 10.10.10.1 [root@localhost ~]# ipvsadm -A -t 10.10.10.1:80 -s rr -p 5 [root@localhost ~]# ipvsadm -a -t 10.10.10.1:80 -r 172.25.25.4:80 -m [root@localhost ~]# ipvsadm -a -t 10.10.10.1:80 -r 172.25.25.5:80 -m [root@localhost ~]# ipvsadm -S [root@localhost ~]# ipvsadm -Ln [root@localhost ~]# ipvsadm -Ln --stats
RealServer
# RIP(真实IP/内网IP):172.25.25.4 # RIP(真实IP/内网IP):172.25.25.5 [root@localhost ~]# route add default gw 172.25.25.3
原文:https://www.cnblogs.com/wang-hongwei/p/14715512.html