By momothereal
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 (45.55.x.x)?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
I found the answer here: https://www.digitalocean.com/docs/networking/floating-ips/how-to/find-anchor-ips/
The local IP is an “anchor address”, which is mapped from the Floating IP.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.