1、拓扑图
在Windows宿主机中ssh连接虚拟机CentOS中的Docker容器

2、前提条件
关闭虚拟机中的防火墙
在docker容器中安装并启用ssh服务
Windows宿主机与虚拟机CentOS网络互通(可通过Xshell连接)
虚拟机CentOS和Docker容器网络互通(在CentOS中可以通过docker exec -it <container_id> /bin/bash命令进入容器内部)

3、在Windows中添加到docker容器网段的路由
route add 172.17.0.0 mask 255.255.255.0 192.168.209.155
该路由表示通往172.17.0.0/24网络的数据包通过192.168.209.155来转发。
参考:
http://blog.csdn.net/xushouwei/article/details/51705699
https://www.cnblogs.com/linux-wangkun/p/5840441.html

相关文章:

  • 2021-05-04
  • 2021-12-05
  • 2021-10-07
  • 2022-02-07
  • 2021-06-18
  • 2022-12-23
  • 2021-12-10
猜你喜欢
  • 2021-11-01
  • 2021-05-26
  • 2021-08-16
  • 2021-08-14
  • 2022-02-27
  • 2021-10-02
  • 2021-08-08
相关资源
相似解决方案