Study and practice of Ip-tun (IP tunneling) technology in LVS

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.