real server configure:
ifconfig eth0 192.168.10.230 netmask 255.255.255.0 up
route add default gw 192.168.10.184
route del -net 192.168.10.0/24
route del default gw 192.168.10.1
2. DIRECT ROUTE mode
loadbalancer configure:
ifconfig eth0 192.168.10.184 netmask 255.255.255.0 up
ifconfig eth0:0 192.168.10.177 broadcast 192.168.10.177 netmask 255.255.255.255 up
route add -host 192.168.10.177 dev eth0:0
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
ipvsadm -A -t 192.168.10.177:7777 -s rr
ipvsadm -a -t 192.168.10.177:7777 -r 192.168.10.230:7777 -g
real server configure:
ifconfig eth0 192.168.10.230 netmask 255.255.255.0 up
ifconfig lo:0 192.168.10.177 broadcast 192.168.10.177 netmask 255.255.255.255 up
route add -host 192.168.10.177 dev lo:0
echo 0 >/proc/sys/net/ipv4/ip_forward
echo 1 >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo 2 >/proc/sys/net/ipv4/conf/lo/arp_announce
echo 1 >/proc/sys/net/ipv4/conf/all/arp_ignore
echo 2 >/proc/sys/net/ipv4/conf/all/arp_announce
3. TUNNEL mode
loadbalancer configure:
ifconfig eth0 192.168.10.184 netmask 255.255.255.0 up
ifconfig eth0:0 192.168.10.177 netmask 255.255.255.255 broadcast 192.168.10.177 up
echo 1 >/proc/sys/net/ipv4/ip_forward
ipvsadm -A -t 192.168.10.177:7777 -s rr
ipvsadm -a -t 192.168.10.177:7777 -r 192.168.10.230:7777 -i
real server configure:
ifconfig eth0 192.168.10.230 netmask 255.255.255.0 up
route add -net 192.168.10.0 netmask 255.255.255.0 dev eth0
ifconfig tunl0 192.168.10.177 netmask 255.255.255.255 broadcast 192.168.10.177 up
route add -host 192.168.10.177 dev tunl0
echo 1 >/proc/sys/net/ipv4/ip_forward
echo 1 >/proc/sys/net/ipv4/conf/all/send_redirects
echo 1 >/proc/sys/net/ipv4/conf/lo/send_redirects
echo 1 >/proc/sys/net/ipv4/conf/default/send_redirects
echo 1 >/proc/sys/net/ipv4/conf/eth0/send_redirects