'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?
Solution 1:[1]
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
Solution 2:[2]
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/.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Gil Hiram |
Solution 2 | Ras Dwivedi |