Windows connects to a Docker container inside a Linux virtual machine

Source: Internet
Author: User

One, Windows, Linux virtual machines, Docker diagrams

If the Pingdocker container is ping different at this time because there is no route to the 172.17.0.0/24 network on the host, the host has the opportunity to send the data destined for the 172.17.0.0/24 network to the default route so that the container cannot be reached.

Ii. Operation 2.1 Shutting down the firewall in Linux
Systemctl Stop Firewalld.service
2.2 Installing and enabling the SSH service in the Docker container
/usr/sbin/sshd-d &

2.3 Windows host and virtual machine CentOS Network Interoperability

can be connected via Xshell

2.4 Virtual machine CentOS and Docker container Network interoperability

The Docker exec-it <container_id>/bin/bash command can be accessed inside the container in CentOS

2.5 routes added to the Docker container segment in Windows
C:\windows\system32>route add 172.17.0.0 mask 255.255.255.0 192.168.123.110

The route represents a packet to the 172.17.0.0/24 network via 192.168.123.110来 forwarding.

2.6 Testing

Windows connects to a Docker container inside a Linux virtual machine

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.