简体   繁体   English

ssh安装Docker后无法上机

[英]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 .我的 ssh 在 ubuntu 机器A上成功安装 Docker(按照官方网站说明https://docs.docker.com/engine/installation/ )后停止工作。 Now my laptop cannot ssh to A but ok for other machines, say B , that sitting in the same.network environment as A .现在我的笔记本电脑不能 ssh 到A但对于其他机器来说没问题,比如B ,它与A处于相同的网络环境中。 A can ssh to B and B can also ssh to A . A可以 ssh 给BB也可以 ssh 给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. 如果您使用的是VPN服务,则可能会在docker0接口和您的VPN服务之间遇到IP冲突。 to resolve this: 解决此问题:

stop docker service: 停止docker服务:

sudo service docker stop

remove old docker0 interface created by docker 删除docker创建的旧docker0接口

ip link del docker0

configure docker0 bridge (in my case i only had to define "bip" option) 配置docker0网桥 (在我的情况下,我只需要定义“ bip”选项)

start the docker service: 启动docker服务:

sudo service docker start

Most probably there is ip conflict between docker0 interface and your VPN service. docker0 接口和您的 VPN 服务之间很可能存在 ip 冲突。 As already answered, way is to stop docker service, remove docker0 interface and configure daemon.json file.正如已经回答的那样,方法是停止 docker 服务,删除 docker0 接口并配置 daemon.json 文件。 I added following lines to my daemon.json我在守护进程中添加了以下几行。json

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

My VPN was providing me an IP like 192.168.我的 VPN 为我提供了 IP,例如 192.168。 . . so I chose a base IP that does not fall in that range.所以我选择了一个不属于该范围的基数 IP。 Note that the daemon.json file does not exist, so you have to create it in, etc/docker/.注意daemon.json这个文件是不存在的,所以要在etc/docker/中创建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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