简体   繁体   中英

Failed to ssh to machine after installing Docker

My ssh stops working after I successfully installed Docker (following the official site instruction https://docs.docker.com/engine/installation/ ) on an ubuntu machine A . Now my laptop cannot ssh to A but ok for other machines, say B , that sitting in the same.network environment as A . A can ssh to B and B can also ssh to A . What could be the problem? Can anyone suggest how I can make a diagnostic?

If you are using a vpn service you might be encountering an ip conflict between docker0 interface and your vpn service. to resolve this:

stop docker service:

sudo service docker stop

remove old docker0 interface created by docker

ip link del docker0

configure docker0 bridge (in my case i only had to define "bip" option)

start the docker service:

sudo service docker start

Most probably there is ip conflict between docker0 interface and your VPN service. As already answered, way is to stop docker service, remove docker0 interface and configure daemon.json file. I added following lines to my daemon.json

 {
 "default-address-pools":
     [
         {"base":"10.10.0.0/16","size":24}
     ]
}

My VPN was providing me an IP like 192.168. . so I chose a base IP that does not fall in that range. Note that the daemon.json file does not exist, so you have to create it in, etc/docker/.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM