无法从我的Docker容器ping Windows主机

无法从我的Docker容器ping Windows主机,docker,docker-desktop,Docker,Docker Desktop,我正在Windows 2016服务器上使用docker Desktop运行docker容器。我使用Docker Desktop,而不是Windows 2016 server上的Docker EE,因为我想运行Linux容器。Docker的详细信息如下: Containers: 3 Running: 1 Paused: 0 Stopped: 2 Images: 2 Server Version: 18.09.2 Storage Driver: overlay2 Backing Filesystem

我正在Windows 2016服务器上使用docker Desktop运行docker容器。我使用Docker Desktop,而不是Windows 2016 server上的Docker EE,因为我想运行Linux容器。Docker的详细信息如下:

Containers: 3
Running: 1
Paused: 0
Stopped: 2
Images: 2
Server Version: 18.09.2
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 09c8266bf2fcf9519a651b04ae54c967b9ab86ec
init version: fec3683
Security Options:
seccomp
  Profile: default
Kernel Version: 4.9.125-linuxkit
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: linuxkit-00155d2dab04
ID: OQK7:Z24A:V5KV:CYEW:6QQE:KXOB:UXWY:KVRF:QEHF:SATF:CTLU:WTPM
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 32
Goroutines: 53
System Time: 2020-02-26T06:36:51.0000459Z
EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
Client: Docker Engine - Community
Version:           18.09.2
API version:       1.39
Go version:        go1.10.8
Git commit:        6247962
Built:             Sun Feb 10 04:12:31 2019
OS/Arch:           windows/amd64
Experimental:      false

Server: Docker Engine - Community
Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     false
Docker Desktop的版本是

版本2.0.0.3(31259) 频道:稳定

docker信息的输出如下:-

Containers: 3
Running: 1
Paused: 0
Stopped: 2
Images: 2
Server Version: 18.09.2
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 09c8266bf2fcf9519a651b04ae54c967b9ab86ec
init version: fec3683
Security Options:
seccomp
  Profile: default
Kernel Version: 4.9.125-linuxkit
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: linuxkit-00155d2dab04
ID: OQK7:Z24A:V5KV:CYEW:6QQE:KXOB:UXWY:KVRF:QEHF:SATF:CTLU:WTPM
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 32
Goroutines: 53
System Time: 2020-02-26T06:36:51.0000459Z
EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
Client: Docker Engine - Community
Version:           18.09.2
API version:       1.39
Go version:        go1.10.8
Git commit:        6247962
Built:             Sun Feb 10 04:12:31 2019
OS/Arch:           windows/amd64
Experimental:      false

Server: Docker Engine - Community
Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     false
docker版本的输出如下:-

Containers: 3
Running: 1
Paused: 0
Stopped: 2
Images: 2
Server Version: 18.09.2
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 09c8266bf2fcf9519a651b04ae54c967b9ab86ec
init version: fec3683
Security Options:
seccomp
  Profile: default
Kernel Version: 4.9.125-linuxkit
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: linuxkit-00155d2dab04
ID: OQK7:Z24A:V5KV:CYEW:6QQE:KXOB:UXWY:KVRF:QEHF:SATF:CTLU:WTPM
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 32
Goroutines: 53
System Time: 2020-02-26T06:36:51.0000459Z
EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
Client: Docker Engine - Community
Version:           18.09.2
API version:       1.39
Go version:        go1.10.8
Git commit:        6247962
Built:             Sun Feb 10 04:12:31 2019
OS/Arch:           windows/amd64
Experimental:      false

Server: Docker Engine - Community
Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     false
我无法从Linux容器ping我的windows主机

但这在我的Windows 10计算机上是可能的


这里面有没有我遗漏的线索?

运行
ifconfig
并检查docker0接口的IP


使用该IP进行ping

运行
ifconfig
并检查docker0接口的IP


使用该IP进行ping

你能分享你的ping错误信息吗?ping超时,但可以解决IP->可能的防火墙问题。Ping无法解析主机名->可能指向DNS
[root@a47e23e069f6/]#ping 192.168.45.171 ping 192.168.45.171(192.168.45.171)56(84)字节的数据。从192.168.65.3 icmp_seq=1目标主机不可访问从192.168.65.3 icmp_seq=2目标主机不可访问这里192.168.45.171是我的主机。我不知道这个192.168.65.3 IP是从哪里来的。你能分享你的ping错误消息吗?ping超时,但可以解决IP->可能的防火墙问题。Ping无法解析主机名->可能指向DNS
[root@a47e23e069f6/]#ping 192.168.45.171 ping 192.168.45.171(192.168.45.171)56(84)字节的数据。从192.168.65.3 icmp_seq=1目标主机不可访问从192.168.65.3 icmp_seq=2目标主机不可访问这里192.168.45.171是我的主机。我不知道这个192.168.65.3 IP是从哪里来的。