none
Container cannot access host network. RRS feed

  • Question

  • The host has two network devices:

    C:\Users\Administrator>ipconfig Windows IP Configuration Ethernet adapter Ethernet: Connection-specific DNS Suffix . : IPv6 Address. . . . . . . . . . . : xxx ipv6 xxx Link-local IPv6 Address . . . . . : xxx ipv6 xxx IPv4 Address. . . . . . . . . . . : 192.168.178.110 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : xxx ipv6 xxx 192.168.178.1 Ethernet adapter vEthernet (Ethernet 2): Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : xxx ipv6 xxx IPv4 Address. . . . . . . . . . . : 10.8.0.3 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : Ethernet adapter vEthernet (nat): Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : xxx IPv4 Address. . . . . . . . . . . : 172.28.80.1 Subnet Mask . . . . . . . . . . . : 255.255.240.0 Default Gateway . . . . . . . . . : C:\Users\Administrator>ping 192.168.178.1

    Pinging 192.168.178.1 with 32 bytes of data:
    Reply from 192.168.178.1: bytes=32 time<1ms TTL=64
    Reply from 192.168.178.1: bytes=32 time<1ms TTL=64
    Reply from 192.168.178.1: bytes=32 time<1ms TTL=64
    Reply from 192.168.178.1: bytes=32 time<1ms TTL=64

    Ping statistics for 192.168.178.1:
        Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
        Minimum = 0ms, Maximum = 0ms, Average = 0ms

    C:\Users\Administrator>ping 10.8.0.1

    Pinging 10.8.0.1 with 32 bytes of data:
    Reply from 10.8.0.1: bytes=32 time=14ms TTL=64
    Reply from 10.8.0.1: bytes=32 time=18ms TTL=64
    Reply from 10.8.0.1: bytes=32 time=24ms TTL=64
    Reply from 10.8.0.1: bytes=32 time=15ms TTL=64

    Ping statistics for 10.8.0.1:
        Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
        Minimum = 14ms, Maximum = 24ms, Average = 17ms

    C:\Users\Administrator>

    However, a container can access only nodes connected to one of the two network devices:

    C:\Users\Administrator>docker exec 99e117c43b42 ping 192.168.178.1

    Pinging 192.168.178.1 with 32 bytes of data:
    Reply from 192.168.178.1: bytes=32 time<1ms TTL=63
    Reply from 192.168.178.1: bytes=32 time<1ms TTL=63
    Reply from 192.168.178.1: bytes=32 time=1ms TTL=63
    Reply from 192.168.178.1: bytes=32 time<1ms TTL=63

    Ping statistics for 192.168.178.1:
        Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
        Minimum = 0ms, Maximum = 1ms, Average = 0ms

    C:\Users\Administrator>docker exec 99e117c43b42 ping 10.8.0.1

    Pinging 10.8.0.1 with 32 bytes of data:
    Request timed out.
    Request timed out.
    Request timed out.
    Request timed out.

    Ping statistics for 10.8.0.1:
        Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

    C:\Users\Administrator>

    How can be access nodes of both networks?

    We are using Windows Server version 1809 build 17763.379 and docker version 19.03.2 build c92ab06ed9.

    Thank you! :-)

    Monday, November 4, 2019 2:19 PM