Transparent Network not working for Windows Server Core Container

Hi All, I’m having a really hard time to make a Transparent Network Driver to work with Windows Server core container. The issue is that the network just dosn’t work. Steps to reproduce the issue:

Environment:

  • 3 Virtual Machines running on Hyper-V host
    1 - is a VyOS router which provides NAT between an INternal Network and Outside link and DHCP for the internal network.
    2 - A Domain Controller and DNS server running WIndows Server 2016 Datacenter edition
    3 - Windows Server 2016 Datacenter edition:
    • Joined to Lab Domain with Hyper-V Role and docker installed, all working fine.
    • This VM has 2 virtual addapters connected to the private network, one has fixed IP and the other works with DHCP, all working fine

Now we will work in Virtual Machine 3, the one with Hyper-V and Docker:

If I run the command:

PS C:\Windows\system32> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
microsoft/windowsservercore latest db8182d67b6c 5 days ago 10.4GB

PS C:\Windows\system32> docker run -i db8182d67b6c Powershell.exe
Windows PowerShell
Copyright © 2016 Microsoft Corporation. All rights reserved.

PS C:> ipconfig
ipconfig

Windows IP Configuration

Ethernet adapter vEthernet (Container NIC dc2e1b75):

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::a05c:d86f:9001:5761%32
IPv4 Address. . . . . . . . . . . : 192.168.252.78
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . : 192.168.240.1
PS C:>

So all is working fine so far

Now I want to create a Transparent network so I can access the phisical network from my container so I run the following commands

1 - I eliminate the existing container I created before:

PS C:\Windows\system32> docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1dc2e2487811 db8182d67b6c “Powershell.exe” About a minute ago Exited (0) 15 seconds ago sharp_meitner
PS C:\Windows\system32> docker rm 1dc2e2487811
1dc2e2487811
PS C:\Windows\system32>

2 - I verify the available networks:

PS C:\Windows\system32> docker network ls
NETWORK ID NAME DRIVER SCOPE
52bd65ae21db DCConnection transparent local
41ad912d17e8 nat nat local
8f30fa96c865 none null local
PS C:\Windows\system32>

3 - I Created the “DCConnection” Transparent network using the Hyper-V manager, Virtual Switch interface, that I assume is the same as using the Docker Network Create command. This Network is external, not shared connected to the 2nd adapter, connected to the private network.

4 - Now I run the Windows Server Core image so I create a container using the transparent network:

PS C:\Windows\system32> docker network ls
NETWORK ID NAME DRIVER SCOPE
52bd65ae21db DCConnection transparent local
41ad912d17e8 nat nat local
8f30fa96c865 none null local
PS C:\Windows\system32> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
microsoft/windowsservercore latest db8182d67b6c 5 days ago 10.4GB
PS C:\Windows\system32> docker run -i --network 52bd65ae21db db8182d67b6c Powershell.exe
Windows PowerShell
Copyright © 2016 Microsoft Corporation. All rights reserved.

PS C:> ipconfig
ipconfig

Windows IP Configuration

Ethernet adapter vEthernet (Container NIC 3a10c8a3):

Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::403e:cae9:7685:2c9e%32
Autoconfiguration IPv4 Address. . : 169.254.44.158
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
PS C:>

The problem is that DHCP cannot be contacted and I don’t know where the problem is. I tried assigning a fixed IP and it does not have ping to the gateway so I’m lost here.
I would appreciate any help.
Regards,
Sebastian.

Hi all, I was able to solve the issue, the answer came from another post I made:

I hope this came handy for some one.
Regards,
Sebastian.

Previous link is no longer valid, so I’m just writing the answer, you need to enable mac address spoofing to get this to work:

Get-VMNetworkAdapter -VMName | set-VMNetworkAdapter -MacAddressSpoofing On

Regards,
Sebastian.

1 Like