3

After installing docker in Ubuntu 18.04 I couldn't connect to a very specific network! We have a username and password for our university network login, the problem is the I can't log in any more. the vpn connection that I use is to the server: access1.sharif.ir
I know there is a similar problem like: Installing docker-ce in Ubuntu 18.04 breaks internet connectivity of host
but I don't have the deamon.json in my docker folder and I don't know what to do. Please help!

3 Answers 3

2

You can try to execute the following command:

dhclient -v -4

It helped me when the connection was lost on my machine because of Docker.

2
  • what does it do? Feb 13, 2020 at 8:22
  • It will setup your IP address using the DHCP server of your university network. Feb 24, 2020 at 16:05
2

Note: This solution is tested on multiple computers at the Sharif University of Technology on ubuntu and arch laptops.

I had the exact same problem with the exact same network on manjaro (arch linux). This is because docker uses 172.27.1.1 by default which is the exact network used in Sharif University network.

I simply changed the docker default routing which is explained in the docker forum here. To explain more, open (or create) the /etc/docker/daemon.json file by:

sudo nano /etc/docker/daemon.json

then add this json to fix the problem (note that you should use something that your institution or company doesn't use):

{
    "bip" : "10.10.2.1/24",
    "ipv6": false
}

After that, reboot the system and you are done. You can also check to see your docker interface using ifconfig or ifconfig docker0 command.

1

I have the same problem under Debain 10. Running dhclient does not fix it, since it only obraines new IP lease from DHCP server. The problem is that running any docker container added new default route via docker interface on the host site:

(base) mkawka@smok:~$ ip route
default dev vethe8e28b3 scope link 
default via 192.168.5.1 dev wlp2s0 
default dev enp3s0 scope link metric 1002 linkdown 
10.99.0.0/16 dev docker0 proto kernel scope link src 10.99.0.1 
169.254.0.0/16 dev enp3s0 proto kernel scope link src 169.254.10.179 linkdown 
169.254.0.0/16 dev vethe8e28b3 proto kernel scope link src 169.254.53.97 
192.168.5.0/24 dev wlp2s0 proto kernel scope link src 192.168.5.4 

Edit: OK, the solution for Debian is to prevent Connman from playing with docker network interfaces. To do so, edit the file /etc/connman/main.conf and make sure, that the following line is uncommented:

NetworkInterfaceBlacklist = vmnet,vboxnet,virbr,ifb,ve-,vb-,docker,veth

I guess for other distributions NetworkManager may have a similar option.

2
  • how can it be fixed? Feb 7, 2021 at 20:42
  • a walkaround solution is to use --net=host when starting docker container. It does not destroy your internet connection, but the container will be connected to the same network as host (potential vulnerability) Feb 8, 2021 at 12:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .