问题
I have a Stonesoft VPN-Client and Docker-for-Windows installed on my host machine. My Windows containers seem to fail to resolve any host (even www.google.com). My Linux containers however work perfectly fine. When I disable the VPN Adapter in my network adapter list, the windows containers can access the internet again. But I need them to work with VPN active.
So I researched for quite a while and tried to following:
- Check the adapter priorities in powershell: Get-NetIPInterface -AddressFamily IPv4 | Sort-Object -Property InterfaceMetric -Descending
It was said, that the primary adapter should have the lowest metric value. Which is ethernet in my case and that seems fine. https://github.com/docker/for-win/issues/2760
- Run image with --dns=8.8.8.8 flag. Did not solve the issue.
I went into the Virtual-Switch settings of the Hyper-V Manager. I set the switch called 'nat' to 'external network'. Well my containers got internet connection after that. But it automaticly disabled the VPN adapter so that's not right.
Setting the IPv4 address and DNS of the vEthernet(nat) to automatic. Also did not help.
Reinstalling Container Tools, Hyper-V and Docker. No success.
- Trying older versions of Docker-for-Windows. No success.
Here is some information about my environment:
My network adapters:
My Docker settings are default.
Hyper-V virtual switches:
vEthernet(nat) IPv4 settings:
vEthernet(DockerNAT) IPv4 settings:
vEthernet(Default Switch) IPv4 settings:
ipconfig /all on my host:
I hope this helps and someone can answer this question. It has been bothering me for quite a while now.
EDIT:
Since there was no actual question in there:
How do I solve this problem?
来源:https://stackoverflow.com/questions/56341873/windows-containers-have-no-internet-access-but-linux-containers-do-with-vpn-c