Docker Community Forums

Share and learn in the Docker community.

Meaning of the two VIP Addresses in the container

docker

(Guenther) #1

I’m using docker 1.12.1 in swarm mode.

When I run the following command: docker network create --driver overlay --subnet 10.0.9.0/24 --opt encrypted services and then docker service create --name nginx nginx

than exec the command ip address in the running container (on the correct node) the result is

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    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
234: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1424 qdisc noqueue state UP group default
    link/ether 02:42:0a:00:09:03 brd ff:ff:ff:ff:ff:ff
    inet 10.0.9.3/24 scope global eth0
       valid_lft forever preferred_lft forever
    inet 10.0.9.2/32 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:aff:fe00:903/64 scope link
       valid_lft forever preferred_lft forever
236: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:ac:12:00:03 brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.3/16 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::42:acff:fe12:3/64 scope link
       valid_lft forever preferred_lft forever

Can please anyone explain, why eth0 has in that case two ip addresses 10.0.9.3/24 and 10.0.9.2/32?
What is the meaning of them?
I noticed that scaled containers always share the same address 10.0.9.2/32 (in my case). The other address with /24 is different.
I just don’t get the idea of this.


(Guenther) #2

So the 10.0.9.2 is the actual VIP. The other IP is just an internal IP and shouldn’t be used.