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

  • Dokku zero downtime deploy CHECKS fails
  • Docker - Can't push on my registry when using S3 configuration
  • Kubernetes deploying container in master
  • How to maintain sticky session(session persistence) with docker swarm?
  • How can I run Ghost in Docker with the google/node-runtime image?
  • Redirect application logs to docker logs
  • 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
    

  • Docker - Using Composer inside PHP container
  • Use Docker.io without the build-in NAT function but with DHCP
  • Do I need to create a new lxc(docker)-container for each task I want to sandbox?
  • Docker on Mac: Unable to run MySQL
  • Running Tomcat with PostgreSql using Dockerfile
  • Jenkins Docker Pipeline Exit Code -1
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.