RedHat 8.09.0 LVS Installation Manual (3)

xiaoxiao2021-03-06  41

Part II: LVS setting

system structure

First, simple settings:

1, the setting of IP Tunnel:

Load balance: 10.144.43.175 (NB8048)

Real Server: 10.144.43.142 (Linux142), 10.144.43.187 (Linux187)

Virtual IP: 10.144.43.185 (VIP)

Settings on the NB8048:

1, build a Subinterface first

# ifconfig eth0: 0 10.144.43.185 Netmask 255.255.255.255 Broadcast ||

10.144.43.185 Up

2. Establish ip tunnel's Rule

2.1, open IP forwarding first

# echo 1> / proc / sys / net / ipv4 / ip_forward

2.2, establish the ip tunnel Rule, first establish service

# ipvsadm -a -t 10.144.43.185:23 -s WLC

2.3, add two Real Server IP

# ipvsadm -a -t 10.144.43.185:23 -r 10.144.43.187 -i

# ipvsadm -a -t 10.144.43.185:23 -r 10.144.43.142 -i

The setting of Linux142 and Linux187:

1, establish a tunnel0

# ifconfig Tunl0 10.144.43.185 Netmask 255.255.255.255 Broadcast 10.144.43.185

2, add Host to roupening table

# Route add -host 10.144.43.185 dev tunl0

3. Open the Hidden property of the interface:

# echo 1> / proc / sys / net / ipv4 / ip_forward

# Echo 1> / Proc / Sys / Net / IPv4 / Conf / All / Hidden

# echo 1> / proc / sys / net / ipv4 / conf / tunl0 / hidden

2, Direct Routing settings

Load balance: 10.144.43.175

Virtual IP: 10.144.43.185

RealServer1: 10.144.43.175 (NB8048)

RealServer2: 10.144.43.142 (Linux142)

RealServer3: 10.144.43.187 (Linux187)

The network architecture is as shown above, where DR and RealServer1, RealServer2 are in the same network segment, and its IP address configuration is as follows, which is basically set, including the setting of ARP Problem:

DR (Direct Routing Server):

# ifconfig eth0 10.144.43.175 Netmask 255.255.255.0 Broadcast 10.144.43.255

# Route Add -Net 10.144.43.0 Dev Eth0

# ifconfig eth0: 0 10.144.43.185 Netmask 255.255.255.255 Broadcast 10.144.43.185

# echo 1> / proc / sys / net / ipv4 / ip_forward

# ipvsadm -a -t 10.144.43.185:23 -s RR (with Round Robin mode)

# ipvsadm -a -t 10.144.43.185:23 -r 10.144.43.175 -g

# ipvsadm -a -t 10.144.43.185: 23 -r 10.144.43.142 -g

# ipvsadm -a -t 10.144.43.185: 23 -r 10.144.43.187 -g

RealServer1 and RealServer2 setting:

# ified 10.144.43.142 Netmask 255.255.255.0 Broadcast 10.144.43.255

# Route Add -Net 10.144.43.0 Dev Eth0

# ifconfig lo: 0 10.144.43.185 Netmask 255.255.255.255 Broadcast 10.144.43.185

# Route add -host 10.144.43.185 dev LO: 0

# echo 1> / proc / sys / net / ipv4 / ip_forward

# Echo 1> / Proc / Sys / Net / IPv4 / Conf / All / Hidden

# echo 1> / proc / sys / net / ipv4 / conf / lo / hidden

test:

From 10.16.1.16 machines, 10.144.43.185 is telnet test, and three online three times are connected to different Server, so the test is normal.

转载请注明原文地址:https://www.9cbs.com/read-62840.html

New Post(0)