LVS--NAT模型

vim /etc/sysctl.conf    开启转发功能

net.ipv4.ip_forward = 1

sysctl -p               看是否开启

net.ipv4.ip_forward = 1


ipvsadm -A -t 172.16.125.5:80 -s rr

ipvsadm -a -t 172.16.125.5:80 -r 192.168.100.2 -m

ipvsadm -a -t 172.16.125.5:80 -r 192.168.100.3 -m

ipvsadm -L -n


ipvsadm -A -t 172.16.125.5:80 -s wrr

ipvsadm -a -t 172.16.125.5:80 -r 192.168.100.2 -m -w 3

ipvsadm -a -t 172.16.125.5:80 -r 192.168.100.3 -m -w 1

ipvsadm -L -n