Home  >  Article  >  Operation and Maintenance  >  Configuration steps for LVS NAT in Linux

Configuration steps for LVS NAT in Linux

黄舟
黄舟Original
2017-08-08 13:07:071467browse

This article mainly introduces relevant information on the detailed explanation of LVS NAT configuration steps in Linux. Here are the detailed implementation steps. Friends in need can refer to the following

LVS NAT configuration steps in Linux Detailed explanation

Summary:

Planning machines and IP addresses, There are three types of machines and four types of IPs in the LVS cluster address. Machine types: Client, Director, Real Server. The IP addresses corresponding to the machine types are: CIP, DIP, RIP. Director corresponds to two IPs. In addition to DIP, there is also a VIP. Usually DIP and RIP are on the same network, and CIP and VIP are on the same network.


        CIP:192.168.56.1
        VIP:192.168.56.101
        DIP : 192.168.0.10
        RIP : 192.168.0.100、192.168.0.200

                                                           

##
   1:enable ip_forwardp
           vi /etc/sysctl.conf  set net.ipv4.ip_forward = 1
           sysctl -
       2 : set DIP
            ifconfig eth0:0 192.168.0.10 up
       3 : disable firewall
           service iptables stop
       4: config ipvs
         ipvsadm -A -t 192.168.56.01:80 -s rr
         ipvsadm -a -t 192.168.56.01 -r 192.168.0.100 -m 
         ipvsadm -a -t 192.168.56.01 -r 192.168.0.200 -m


Key points:


1: DIR must be separated from VIP, otherwise it will appear on Direct and you can access the cluster on the client. No, the link has been waiting


2: The firewall must be turned off, otherwise the ping will succeed, but there will be no routing error when accessing

The above is the detailed content of Configuration steps for LVS NAT in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn