LVS realserver Configuration VIP

Source: Internet
Author: User

# $# indicates the total number of arguments supplied to the shell script or function;
# 1 indicates only one parameter.

#/bin/bash
#file: tun_rs.sh

If [$#-ne 1];
Then
echo "Usage: $ virtualip"
echo "such as: $172.19.58.200″
Exit 0
Fi

Vip=$1

# RS does not need to be forwarded
echo "0" >/proc/sys/net/ipv4/ip_forward

# Modify Eth0 MTU to 1440 for TCP server
/sbin/ifconfig eth0 MTU 1440

# Configure Tunl0
/sbin/ifconfig tunl0 up
/sbin/ifconfig tunl0 ${VIP} broadcast ${VIP} netmask 0xFFFFFFFF up
/sbin/route add-host ${vip} dev tunl0

# troubleshoot ARP issues
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

# Solve the Rp_filter problem
echo 0 >/proc/sys/net/ipv4/conf/tunl0/rp_filter
echo 0 >/proc/sys/net/ipv4/conf/all/rp_filter
# End of Tun_rs.sh

LVS realserver Configuration VIP

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.