Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to analyze the principle of floating IP

Shulou Source: shulou.com Published: 2022-06-01 00:43:24 09月22日 Update

How to analyze the principle of floating IP? in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

Today we will analyze how floating IP works.

First, check the interface configuration of router:

You can see that floating IP has been configured on the public network interface qg-b8b32a88-03 of router. View the NAT rules for router:

Iptables adds two rules for dealing with floating IP:

1. When router receives a packet from the public network, if the destination address is floating IP 10.10.10.3, modify the destination address to IP 172.16.101.3 of cirros-vm3. In this way, packets from the external network can be delivered to cirros-vm3.

two。 When cirros-vm3 sends data to the public network, the source address 172.16.101.3 will be modified to floating IP 10.10.10.3.

Let's pass the PING test. In my lab environment, 10.10.10.1 is a physical switch in the external network, so now let it PING cirros-vm3.

Be able to PING. We can use tcpdump to observe the behavior of floating IP on the interface of router.

Tcpdump output of ext_net interface qg-b8b32a88-03:

It can be seen that on the external network interface qg-b8b32a88-03, it always communicates with the external network through floating IP 10.10.10.3.

Tcpdump output of vlan101 interface qr-e17162c5-00:

When the data is forwarded to the tenant network, the address has become IP 172.16.101.3, the tenant of cirros-vm3.

A brief summary:

1. Floating IP enables the public network to directly access the instance in the tenant's network. This is achieved by applying iptalbes's NAT rules on router.

2. Floating IP is configured on the public network interface of router, not instance, which requires special attention.

So far, we have completed the learning of Neutron L3 service connecting different subnet, accessing external network, and floating IP.

The answer to the question on how to analyze the principle of floating IP is shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Tags: Analysis address principle tenant rule question configuration data more purpose network help answer output different easy easy switch content day will Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Microsoft Huawei macOS Shulou Technology