when the Docker daemon starts, which uses the single instance of WinNAT supported
on Windows Server 2016. You can see this with docker network ls and Get-NetNat:
PS C:> docker network ls
NETWORK ID NAME DRIVER SCOPE
8ad4b336d4d4 nat nat local
d784acd605cd none null local
PS C:> Get‐NetNat
Name : H7bef00fb-b7bc-4fa3-930b-69f0f8d0d23f
ExternalIPInterfaceAddressPrefix :
InternalIPInterfaceAddressPrefix : 192.168.1.1/24
IcmpQueryTimeout : 30
TcpEstablishedConnectionTimeout : 1800
TcpTransientConnectionTimeout : 120
TcpFilteringBehavior : AddressDependentFiltering
UdpFilteringBehavior : AddressDependentFiltering
UdpIdleSessionTimeout : 120
UdpInboundRefresh : False
Store : Local
Active : True
By default, the IP space used by the automatically created NAT network is
172.16.0.1/12, but in my example it is 192.168.1.1/24. How did this happen? There
are two ways to use your own custom IP space for the NAT network if the default IP
range does not meet your needs.
The first way is to change the IP configuration of the default NAT network. To do this,
perform the following:
1 . Stop the Docker daemon:
stop-service docker
2 . Remove the default network:
Get-ContainerNetwork | Remove-ContainerNetwork
3 . Ensure that the default switch and WinNAT instance are gone by running Get-
VMSwitch and Get-NetNat.
4 . Edit the daemon.json file in folder C:\ProgramData\docker\config, or if it does not
exist, create the file. For more information on Docker configuration, see
https://msdn.microsoft.com/en-
us/virtualization/windowscontainers/docker/configure_docker_daemon.
5 . In the file, add the following JSON, but change it to match the IP range you wish to
use:
{
"fixed-cidr": "192.168.1.0/24"
}