分类: LINUX
2011-12-26 09:44:35
為簡化測試環境, 本篇 Load Balancer 與 Real Server 皆為 Fedora Core 3Virtual Server via NAT (VS/NAT)
eth1 (對外): 10.2.0.1Real Server:
eth0 (對內): 192.168.1.254
#vi /etc/sysctl.conf
net.ipv4.ip_forward = 1#sysctl -p
#iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE
#ipvsadm -C
#ipvsadm -A -t 10.2.0.1:80 -s rr
#ipvsadm -a -t 10.2.0.1:80 -r 192.168.1.1:80 -m
#ipvsadm -a -t 10.2.0.1:80 -r 192.168.1.2:80 -m
eth0: 10.2.0.1Real Server:
eth0:0: 10.2.0.2
#vi /etc/sysctl.conf
net.ipv4.ip_forward = 1#sysctl -p
#ifconfig eth0:0 10.2.0.2 netmask 255.255.255.255 up
#ipvsadm -C
#ipvsadm -A -t 10.2.0.2:80 -s rr
#ipvsadm -a -t 10.2.0.2:80 -r 10.2.0.11:80 -i
#ipvsadm -a -t 10.2.0.2:80 -r 10.2.0.12:80 -i
#vi /etc/sysctl.confps. 以上是 Real Server 與 Director 在同一個 LAN 的 IP Tunneling, 跨 WAN 的 IP Tunneling 還搞不清楚... Orz
net.ipv4.ip_forward = 1#sysctl -p
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
#ifconfig tunl0 10.2.0.2 netmask 255.255.255.255 up
#route add -host 10.2.0.2 dev tunl0
eth0: 10.2.0.1Real Server:
eth0:0: 10.2.0.2
#vi /etc/sysctl.conf
net.ipv4.ip_forward = 1#sysctl -p
#ifconfig eth0:0 10.2.0.2 netmask 255.255.255.255 up
#ipvsadm -C
#ipvsadm -A -t 10.2.0.2:80 -s rr
#ipvsadm -a -t 10.2.0.2:80 -r 10.2.0.11:80 -g
#ipvsadm -a -t 10.2.0.2:80 -r 10.2.0.12:80 -g
net.ipv4.ip_forward = 1#sysctl -p
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2