Frage

Under ubuntu 13.04 with docker 0.7.2 when I create a container via Dockerfile or interactively : the network interface generated veth** does not have an ipv4 address but an ipv6 one.

How can I get a ipv4 address ? Is there some things I missed. Does this depends from my network configuration ?

Same behaviour on a 12.04 box.

War es hilfreich?

Lösung

The network interface veth… in the host shouldn't have an IPv4 address. Those virtual interfaces work in pairs:

  • One interface will be in the container, it will be named eth0, and will have an IPv4 address. For all purposes, it looks like a normal interface.
  • The other half of the pair is the veth… interface. It will be in the host, and won't have an IPv4 address.

Those two interfaces are connected together: any packet sent on an interface will appear as being received by the other. You can imagine that they are connected by a cross-over cable, if that helps :-)

The fact that the veth… interface has an IPv6 address is just because when IPv6 is enabled, all interfaces receive at least a link-local address. But this address is essentially useless in that case.

Andere Tipps

Restart the docker service once. This will show the ipv4 address in docker0 link

sudo systemctl restart docker.service

Please keep in mind that the running containers will be closed down. You can check the ip by using ifconfig command

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top