Get the App
SLTechnology News&Howtos  ›  Network Security  › 

LVS-NAT configuration

Shulou Source: shulou.com Published: 2022-06-01 07:10:25 10月03日 Update

There are a lot of information on the Internet, but it feels like I've been fooling around for a day. I've taken a lot of detours.

Write down a few key points so that I won't forget them later.

The server that makes the LVS must be a gateway to another Realserver, which is important, that is, commands may be used

Route add default gw [LVSHOST]

This is to ensure that after Director throws the message to RS, RS will send it back to Dirtector after processing. Otherwise, it will be a problem for RS to send the message back to Client according to other gateways.

Director must enable message forwarding mode

The command is simple as long as it is configured on Director, and RS only needs to configure the command whose default gateway is Director.

The principle is actually very simple, that is, after Director receives the message, it changes the destination IP to the IP of RS, and then forwards it. RS will naturally process the message sent to its own IP address, and then send it back to Client (source IP RS, destination IP client). At this time, the message will be sent to the gateway of RS, and Director is the gateway of RS. After receiving the message, it changes the source IP address to its own (source IP Director, destination IP client). And then sent it to the client.

Key point: Director ping RS must be ping connected, RS ping Client must be routed through Director, and can be tested with traceroute command

Tags: Messages gateways commands processing configuration purpose address that is main points important things that is principles geniuses clients clients detours sense server mode Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Docker Shulou Tech Info MySQL NVidia