Lvs-tun Demo

Source: Internet
Author: User

Lvs-tun Demo:

Test environment:







PS: All hosts use a network card and are used Bridge network, a network card configuration multiple IP address (Lvs-tun This mode in the enterprise application of the very few, most of them use LVS-DR);

1. Configure the VIP on the director and use IPVSADM to define the Cluster service

#lsmod | grep Ipip # # # #查看内核是否加载了ipip模块

#ifconfig tunl0 up

#ifconfig eth0:0 netmask broadcast up

#route add-host Dev eth0:0


2. Remove all Ipvs rules and redefine the Cluster service, and set the kernel parameters


#ipvsadm-A-T RR




#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

3. Configure the Web service and VIP on the RS and set the kernel parameters

#ifconfig tunl0 netmask broadcast up

#route add-host Dev tunl0

#echo "0" >/proc/sys/net/ipv4/ip_forward

#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

#echo 0 >/proc/sys/net/ipv4/conf/tunl0/rp_filter

#echo 0 >/proc/sys/net/ipv4/conf/all/rp_filter

#yum-y Install httpd

#echo "" >/var/www/html/index.html

#service httpd Start

This article is from "Luo Chen's blog" blog, please be sure to keep this source

Lvs-tun Demo

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: 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.