In this article about Windows Containers, I’ll show you how I to create a Transparent Network that will make Windows Containers available on my direct physical Network.
Windows Containers comes with 5 Network types on Transparent Network Is the most popular network configuration because It allows us to use Containers like Virtual Machines.
Before making any changes, I’ll review the current networks configured on the host using the command below:
Docker network ls
To create a Transparent Network on a DHCP-enabled network, I’ll use the command below, For non-DHCP enabled to continue to the Non-DHCP section later on.
Note: Make sure you use lower case name only
docker network create -d transparent tlan
To place a VM in the new LAN I’ll run the cmdlet below assuming I have DHCP enabled on the LAN.
docker run -it --network=tlan microsoft/nanoserver
If DHCP Is not enabled on the network, Use the command below to create the Transparent Network:
docker network create -d transparent --subnet=10.99.38.0/24 --gateway=10.99.38.1 tlan2
Once the Network Is created, I’ll create a Container with a static IP address Inside the container.
docker run -it --network=tlan2 --ip 10.99.38.99 microsoft/nanoserver
Comments
3 responses to “How To Create A Transparent Network For Windows Containers”
Every time i try an and use an static ip, the container always seems to ignore it an uses dhcp.
This is what I get when I try to create a transparent network on Windows Server 2016
PS C:UsersAdministrator> docker network create -d transparent –subnet=192.168.1.0/24 –gateway=192.168.1.1 tlan1
Error response from daemon: plugin “transparent” not found
Any ideas?
Thanks,
Michael
Michael. I believe this is due to the docker daemon running in linux mode. When it is, the standard network configurations do not work.