Here is the output of command ip a
on my Digital Ocean server:
root@ubuntu-s-1vcpu-1gb-blr1-01:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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 fq_codel state UP group default qlen 1000
link/ether 52:a0:9f:54:ad:d2 brd ff:ff:ff:ff:ff:ff
inet 139.59.75.106/20 brd 139.59.79.255 scope global eth0
valid_lft forever preferred_lft forever
inet 10.47.0.5/16 brd 10.47.255.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 2400:6180:100:d0::db:5001/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::50a0:9fff:fe54:add2/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 9a:4b:a5:40:13:c5 brd ff:ff:ff:ff:ff:ff
inet 10.122.0.2/20 brd 10.122.15.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::984b:a5ff:fe40:13c5/64 scope link
valid_lft forever preferred_lft forever
As you can see there are these IPv4 addresses present on the eth0 and eth1 interfaces.
inet 10.47.0.5/16
and inet 10.122.0.2/20
.
I am trying to set up load balancers with a floating IP. According to the digital ocean team:
Floating IP works via Anchor IP present over eth0 interface.
You can use the same private IP as any traffic sent over Floating IP will be sent to this private IP only i.e 10.47.0.5.
So 10.47.0.5 is my private IP, but on my droplet page it says the private IP address of my machine is 10.122.0.2
. Also, within my internal network I am only able to ping the machine using this IP (10.122.0.2). Ping does not work on 10.47.0.5. However the floating IP is bound to my 10.47.0.5
private IP.
So what I don't understand is which one is my actual private IP - 10.47.0.5
or 10.122.0.2
?. If former what is the latter and if latter what is the former. Also, what's the difference of them being present on different interfaces?