Lvs-tun Demo

Source: Internet
Author: User

Lvs-tun Demo:

Test environment:

os:rhel6.4

Director:

vip:192.168.10.120

dip:192.168.10.11

rs1:rip:192.168.10.12

rs2:rip:192.168.10.13

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 192.168.10.120 netmask 255.255.255.255 broadcast 192.168.10.120 up

#route add-host 192.168.10.120 Dev eth0:0

#ifconfig

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

#ipvsadm-C

#ipvsadm-A-T 192.168.10.120:80-s RR

#ipvsadm-T 192.168.10.120:80-r 192.168.10.12-i

#ipvsadm-T 192.168.10.120:80-r 192.168.10.13-i

#ipvsadm-L-N

#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 192.168.10.120 netmask 255.255.255.255 broadcast 192.168.10.120 up

#route add-host 192.168.10.120 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 "192.168.10.12" >/var/www/html/index.html

#service httpd Start




This article is from "Luo Chen's blog" blog, please be sure to keep this source http://luochen2015.blog.51cto.com/9772274/1702812

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