Docker for windows – networking: container with multiple network interfaces

I am trying to attach a container to two subnets, without success.

This piece of information reports that cross subnet communication is not currently supported:
https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-networking

  • IBM Containers (Dockers) service in Bluemix start before network service is ready
  • Difference between VOLUME declaration in Dockerfile and -v as docker run parameter
  • Docker Compose v3 Ports issue
  • How install java to ubuntu on docker?
  • Test Commands are not recognised in Django
  • How to use kube-proxy to forward https serivce in k8s?
  • However, I have defined two custom NAT subnetworks within the large default NAT network.

    When starting the container, everything looks okay: There are two virtual NIC inside the container with appropriate IP-addresses.
    However, I can ping only one of the interfaces from the host and containers in the respective subnets.

    Is this currently supported, and supposed to work?
    It might be an option to route between two segregated subnets, is that currently doable with Docker for Windows?

    I have tried two approaches for network creation:

    1. with docker-compose:
    
        version: '2.1'
        services:
           rabbitmq-c:
             image: ephortesys/rabbitmq:latest
             hostname: rabbitmq-c
             domainname: gecko.no
             mem_limit: 1g
             networks:
               - internal
               - external
        networks:
          internal:
            driver: nat
              driver: default
            ipam:
              config:
              - subnet: 172.24.1.0/24
                gateway: 172.24.1.1
          external:
            driver: nat
            ipam:
              driver: default
              config:
              - subnet: 172.24.2.0/24
                gateway: 172.24.2.1
    

    **

    2. with 'docker network create', and use these in docker.compose.yml:
    
    docker network create --driver=nat --subnet=172.24.1.0/24 --gateway=172.24.1.1 net1  
    docker network create --driver=nat --subnet=172.24.2.0/24 --gateway=172.24.2.1 net2
    
    networks:
       internal:
         external:
          name: "net1"
       external:
         external:
          name: "net2"
    

    Some more info:

    C:\WINDOWS\system32> Get-NetNat
    
    
    Name                             : SharedNAT
    ExternalIPInterfaceAddressPrefix :
    InternalIPInterfaceAddressPrefix : 172.24.0.0/20
    IcmpQueryTimeout                 : 30
    TcpEstablishedConnectionTimeout  : 1800
    TcpTransientConnectionTimeout    : 120
    TcpFilteringBehavior             : AddressDependentFiltering
    UdpFilteringBehavior             : AddressDependentFiltering
    UdpIdleSessionTimeout            : 120
    UdpInboundRefresh                : False
    Store                            : Local
    Active                           : True
    
    C:\WINDOWS\system32> docker info
    Containers: 1
     Running: 1
     Paused: 0
     Stopped: 0
    Images: 18
    Server Version: 17.03.1-ce
    Storage Driver: windowsfilter
     Windows:
    Logging Driver: json-file
    Plugins:
     Volume: local
     Network: l2bridge l2tunnel nat null overlay transparent
    Swarm: inactive
    Default Isolation: hyperv
    Kernel Version: 10.0 14393 (14393.1066.amd64fre.rs1_release_sec.170327-1835)
    Operating System: Windows 10 Enterprise
    OSType: windows
    Architecture: x86_64
    CPUs: 8
    Total Memory: 63.84 GiB
    Name: PC36144
    ID: QYSA:VJE6:OM5A:EJE2:MFJ6:4XLV:UCDN:UTRF:TL5K:IWOO:O2O2:Y6Z3
    Docker Root Dir: C:\ProgramData\Docker
    Debug Mode (client): false
    Debug Mode (server): true
     File Descriptors: -1
     Goroutines: 30
     System Time: 2017-05-04T10:02:36.9325341+02:00
     EventsListeners: 0
    Registry: https://index.docker.io/v1/
    Experimental: true
    Insecure Registries:
     127.0.0.0/8
    Live Restore Enabled: false
    
    
    C:\WINDOWS\system32> docker version
    Client:
     Version:      17.03.1-ce
     API version:  1.27
     Go version:   go1.7.5
     Git commit:   c6d412e
     Built:        Tue Mar 28 00:40:02 2017
     OS/Arch:      windows/amd64
    
    Server:
     Version:      17.03.1-ce
     API version:  1.27 (minimum version 1.24)
     Go version:   go1.7.5
     Git commit:   c6d412e
     Built:        Tue Mar 28 00:40:02 2017
     OS/Arch:      windows/amd64
     Experimental: true
    

  • Error in building docker image with perl installation
  • Implementing a CI/Deployment Pipeline for a Node app
  • Using docker, puppet and jenkins for continuous delivery and PROD deployment [closed]
  • Awaiting gcloud docker — push
  • install additional python package on docker
  • Docker Compose Setup in Windows 10 for nginx php-fpm fails with Error
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.