Docker Community Forums

Share and learn in the Docker community.

Docker on Archlinux without IPv4 address


(Michaelherren) #1

Hello

I am new to docker and therefore please excuse when I ask stupid questions. But I googled, read some documents and also checked the forum. So far I have not yet found the answer to my problem.

I installed docker on Archlinux and managed to download some docker images. I also managed to start them and so far it looks very good. But I cannot connect to services which are running within the docker image. Even though I used the parameter -p to mention the port.

So I googled and read documents and learnt that Docker creates an interface called docker0 which acts as a bridge between the host system and the images. I also learnt that every docker image once started is creating another network interface. All this is functioning perfectly. With the command brdge show (or something like this) I can also see that docker0 is linked to the virtual interface created by the docker image.

But when I execute ifconfig I can see that the interfaces docker0 and the virtual ones do not have an IPv4 address but only a IPv6. Only within the docker image I have a IPv4 address.

Is there a way to enforce Docker to also assign an IPv4 address to docker0 and the virtual interfaces (again I am using Archlinux)? If not I will have to go through the IPv6 forwarding configuration and try like this. Maybe this is the kick I needed to finally get used to IPv6. But for the time being I would prefer to use IPv4.

Thank you very much for your understanding and support.

Regards
Michael


(Ranjandas) #2

Hi,

Which version of Arch and Docker are you using? The docker0 bridge is created and IP is assigned at the first time when docker deamon starts.

Now in your case if you want to assign an IP to docker0 you can do that as shown below.

sudo ip addr add 172.17.42.1/16 dev docker0

If you want Docker to fix this, you can try deleting the docker0 interface and restart docker deamon so that it will get recreated.

sudo brctl delbr docker0

Restart Docker Deamon.

Regards


(Licebmi) #3

I have the same issue.
Docker version 1.8.1, build d12ea79

I’ve deleted the bridge, deleted nat rules but I have to manually assign an ip address to docker0 even after restarting docker.