Windows containers have no internet access, but Linux containers do - with VPN-Client active on host

感情迁移 提交于 2020-06-12 15:39:23

问题


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:

  1. 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

  1. Run image with --dns=8.8.8.8 flag. Did not solve the issue.
  2. 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.

  3. Setting the IPv4 address and DNS of the vEthernet(nat) to automatic. Also did not help.

  4. Reinstalling Container Tools, Hyper-V and Docker. No success.

  5. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!