Two networks with name "nat"
Expected behavior
Docker would only have one default "nat" network
Actual behavior
Two "nat" networks exists, and neither can be used
Information
At some point when using Docker from Edge channel, the update process has managed to screw up networks Docker creates, and now I have two networks named "nat":
$ docker network ls NETWORK ID NAME DRIVER SCOPE 33fbf59fe519 DockerExternal transparent local e3c6cb5f70f9 Wifi transparent local 37a848736fb5 c1aed3e7578e8bf861dd7d34c190499ba378cff3cae50f81485e74e289073323 nat local a27389cafa30 nat nat local edecf92bee80 nat nat local 36ffac58f33a none null local
When I run for example docker-compose which has nat network defined in it, i'm getting error
ERROR: 2 matches found based on name: network nat is ambiguous
And if I try to remove one of those networks, I can't do that because of
Error response from daemon: nat is a pre-defined network and cannot be removed
- Windows Version: Windows 10 Enterprise 1703
- Docker for Windows Version: 18.03.0-ce-rc4-win57 (16511)
- Diagnostics id: 7143158E-5CC1-4EAC-B0B4-591C12A47682/2018-03-22_12-56-52
Steps to reproduce the behavior
- This is a bit difficult to reproduce, something probably went wrong during DfW upgrade. And it ended up with two networks. Other needs to be removed, but don't know how.
I'm experiencing this too after the latest Docker update
Same problem here!
I uninstalled Docker and reinstalled the previous version. That fixed the issue for me.
I managed to address this issue by disabling the experimental features from the settings dialog and resetting the docker to factory settings.
@phorozan Disabling experimental features and reseting to factory settings didn't help me.
Same. Downgrading worked for me. https://docs.docker.com/docker-for-windows/release-notes/#docker-community-edition-17120-ce-win47-2018-01-12
3c8a2dcba596 nat nat local 2057699b8f36 nat nat local
docker network rm 3c8a2dcba596 Error response from daemon: nat is a pre-defined network and cannot be removed
same here
Same here. Error: 2 matches found based on name: network dockercompose... _default is ambiguous.
I got the same after switching to LCOW. It's still there after resetting to factory defaults...
Edit: I've been digging into other issues and came across this Microsoft article which outlines this exact issue and how to resolve it. I haven't tried it myself but I assume this will solve it for most people: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/setup-nat-network#troubleshooting
Here's what I finally ended up doing to get around this (instead of just reverting back to an older build):
- Run
docker network lsand observe two NAT networks - Run
Get-NetNatin Powershell and observe two NAT networks: Nat1 and Nat2 - Run
Remove-NetNat -Name Nat2to get rid of the second NAT network - Reset docker to factory settings
- Run
docker network lsand observe two networks with "DRIVER" set to nat, but this time, the name of the first one is a GUID, and runningdocker network rm <guid>succeeds, thus removing the second NAT network.
Mileage may vary, but this is what worked for me :)
@david-jarman Thanks for linking to the appropriate solution. Those steps didn't exactly work but there is another section in the page which modifies the registry and fixes it.
Same problem with Docker version 18.03.0-ce-win59, build 0520e24302 on Windows 10.
After uninstalling Docker, removing all Docker and .docker folders and then re-installing Docker, same issues:
docker network lsshows 2 networks namednat- I have a container (node-windows) raising this error:
failed to build: network nat is ambiguous (2 matches found on name)at build step. Others containers work well.
Get-NetNat return an empty result on my computer.
I don't know how, when and why Docker created thoses two network named nat and I have no idea how to restore the situation.
I've just found a solution in this topic
Simply run this following ps script to clean keys named "nat" and restart your computer.
$KeyPath = "HKLM:\SYSTEM\CurrentControlSet\Services\vmsmp\parameters\SwitchList"
$keys = get-childitem $KeyPath
foreach($key in $keys) {
if($key.GetValue("FriendlyName") -eq 'nat') {
$newKeyPath = $KeyPath+"\"+$key.PSChildName
Remove-Item -Path $newKeyPath -Recurse
}
}
remove-netnat -Confirm:$false
Works on Windows 10 Pro with Docker version 18.03.0-ce-win59, build 0520e24302.
Thanks
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
Same issue occured in Docker version 18.09.1, build 4c52b90, using Windows 10 pro
I finally worked for me by doing:
- Deactivate Experimental features as suggested by @phorozan
- Do Factory reset
- The second nat changed its name

- so I was able to remove to with

It is possible that it was luck because it was also the third time I did a factory reset .... maybe one should do factory reset until the second nat changes name
On my PC windows 10 Pro I did the following and it worked:
Stop service docker
Stop service HNS
Delete "C:\ProgramData\Microsoft\Windows\HNS\HNS.data"
Delete "C:\ProgramData\docker\network\files\local-kv.db"
Start service HNS
Start docker
Then restart your computer and start docker service again.
Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked