How is the local network interface mapping determined for Floating IPs?
I am using a Floating IP (
45.55.x.x) as a secondary IP for a droplet (which has a default IP,
157.230.x.x). When I look at the network interfaces on the droplet using
ip -a, I see the following:
momo@droplet:~$ ip a | head -n 20 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether [...] brd ff:ff:ff:ff:ff:ff inet 157.230.x.x/20 brd 157.230.x.x scope global eth0 valid_lft forever preferred_lft forever inet 10.10.0.5/16 brd 10.10.255.255 scope global eth0 valid_lft forever preferred_lft forever inet6 [...]/64 scope link valid_lft forever preferred_lft forever
After some testing using nginx, I can see that requests going through the floating IP are mapped to the second inet in the eth0 interface,
10.10.0.5. My question is, how is that local IP address determined and mapped from the external IP (
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.