The simplest configuration of virtualserverNAT in linux

Source: Internet
Author: User
Previously, I wanted to directly install lvs + keepalived in the 2 + 2 mode, along with the VIP. The result was a decisive tragedy. I made a mess with iptables and keepalived configurations. Today, let's calm down and get a new 1 + 1 model. Environment description: 1 director: eth0: 10.1.1.11/24eth1: 10 .... previously, I wanted to directly install lvs + keepalived in the 2 + 2 mode, along with the VIP. The result was a decisive tragedy. I made a mess with iptables and keepalived configurations. Today, let's calm down and get a new 1 + 1 model. Environment description: one ctor: eth0: 10.1.1.11/24 eth1: 10.20.40.2/24 1 real server: eth0: 10.20.40.10/24 gateway is set to 10.20.40.2. note, there is no virtual IP here to modify the kernel parameters of ctor, java code echo "1">/proc/sys/net/ipv4/ip_forward echo "0">/proc/sys/net/ipv4/ipv4/conf/ all/send_redirects # according to my experiment, in fact, it is possible to echo "0">/proc/sys/net/ipv4/conf/default/send_redirects to add a virtual service using rr scheduler Java code/sbin/ipvsadm. -A-t 10.1.1.11: 80-s rr 10.1.1.101 the address is not actually provided to the customer to add a real host for the virtual service. use NAT-m masquerading weight-w 1 Java code/sbin/ipvsadm-a-t 10.1.1.11: 80-r 10.20.40.10: 80-m-w 1 Create A/var/www/index.html file on the real service host and director at the same time, and write special information. Access 10.1.1.11: 80 from the client to see if the home page 10.20.40.10 appears, instead of the home page 10.1.1.11. Author: luozhaoyu

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.