1. Configure the test environment to modify IP
Windows 200.168.10.4
LVS server ip:200.168.10.1 Because IP tunnel mode requires only one network card, it stops other network cards
The web Server1 ip:200.168.10.2 IP tunnel mode is actually used in the public IP, so the gateway is not required to remove the default gateway
Web Server2 ip:200.168.10.3 and web Server1
Because it's the same network segment, so VM simulations are made with Vmnet1
2. Test Pass
Access 200.168.10.1 in Windows | 200.168.10.2 | 200.168.10.3 Full-Pass
3.lvs Server Configuration Virtual IP
Ifconfig tunl0 200.168.10.10 netmask 255.255.255.255 up//virtual one tunnel IP 4 255 stands for it itself a network segment
Ifconfig view
Route add-host 200.168.10.10 Dev tunl0//Add a network segment to the routing table to prevent the 200.168.10.0 network segment from going
Route-n View
4. Setting up the LVS server
Ipvsadm-c
Ipvsadm-a-T 200.168.10.10:80-s RR
Ipvsadm-a-T 200.168.10.10:80-r 200.168.10.2-i
Ipvsadm-a-T 200.168.10.10:80-r 200.168.10.3-i
Ipvsadm-l-N View
5. Configure webserver
Ifconfig tunl0 200.168.10.10 netmask 255.255.255.255 up
Route add-host 200.168.10.10 Dev tunl0
echo "1" >/proc/sys/net/ipv4/conf/tunl0/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/tunl0/arp_announce
echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce
6. Testing
Enter 200.168.10.10 in Windows browser
Again!
Test success!
Turn from Zox's code life
Study and practice of Ip-tun (IP tunneling) technology in LVS