Skip to contentSkip to conversation

Windows 10 Creators Update broke --block-outside-dns

Openvpn-devel ValdikSS 3 participants 6 messages Apr 15, 2017 – Apr 26, 2017 1 message not in the archive

lore
Share & tools
lore

ValdikSS

author
#0 lore raw

I hope this message would finally receive everyone. Sorry for spamming mail list.

Windows 10 Creators Update changed the way DNS works. It used to resolve DNS address using all available adapters and IP addresses in parallel, now it still resolves addresses using all available adapters but in sequence, beginning with random adapter. This interfere with how --block-outside-dns currently work. Sometimes OS chooses VPN TAP adapter and things work as intended, sometimes the other adapter and user have to wait until DNS request times out and DNS resolution goes via VPN. This behaviour introduces significant lag for web browsing.

Another thing is that Windows always prefers IPv6, just as any other OS. Some home routers give IPv6 Unique local address with DNS server to the computers using DHCPv6, even if there's no IPv6 connectivity from the provider.

More importantly, DisableSmartNameResolution switch, which didn't work in previous Windows 10 versions, now works correctly.

*Workaround #1*, If VPN infrastructure is IPv6-enabled and pushes IPv6 address and DNS and route to the client:

1. Apply DisableSmartNameResolution registry patch: https://files.catbox.moe/vng9wm.reg

*Workaround #2*, if VPN infrastructure is not IPv6-enabled:

1. Apply DisableSmartNameResolution registry patch: https://files.catbox.moe/vng9wm.reg
2. If there's IPv6 DNS from the router, set static IPv6 DNS to ::2 (alternative to 127.0.0.2 in IPv4) or just disable IPv6 completely on internet interface.

*Workaround #3*, if VPN infrastructure is not IPv6-enabled and client's infrastructure is not IPv6-enabled:

1. Apply DisableSmartNameResolution registry patch: https://files.catbox.moe/vng9wm.reg
2. Push IPv6 Unique local address and DNS server to the client, but do not push any routes. Client would use DNS over IPv6 but would not route anything else.

*Note*: it would route IPv6 traffic over internet interface (not via VPN) if client's ISP is IPv6-enabled.

*Question*: Fixing registry with --block-outside-dns is simple, but what should we do with IPv6 in OpenVPN? Should we introduce an option to disable IPv6 DNS on other interfaces if there's no IPv6 DNS pushed from the VPN?

author
#2 lore raw
In reply to a message not in the archive
Quoted 4 lines · Selva Nair

On Sat, Apr 15, 2017 at 6:41 PM, ValdikSS <[email protected]... <mailto:[email protected]...>> wrote:

How does this registry entry tell Windows that TAP adapter should be preferred for DNS? Or is this to be done in addition to setting up a preferred ordering of network adapters?

It doesn't. I just remembered that option and set it. It worked for me when DNS is in the same subnet with user, but it fails if DNS is in the internet. Setting lower metric to the TAP interface correctly works in both cases, without reg patch.

Quoted 2 lines

Can WFP be used to rewrite the source address? In that case we could just redirect all DNS requests through the TAP interface instead of dropping packets.

Unfortunately not, not without kernel driver.

Quoted 3 lines

As for local ipv6 DNS servers, I do not think we should do anything about it unless the tunnel can handle v6 traffic.

Selva

I made a perliminary patch to set interface metric to 7:
https://github.com/ValdikSS/openvpn-with-patches/commit/0651c0469038dd0ba39329f4b83ecd7e1d04323e

This is static change for the interface. Currently this patch does not revert previous metric value if there were any or set it back to automatic. Should it be implemented in your opinion? It still won't revert this value back in case of OpenVPN crash or power outage. Yet I don't think that lower metric on TAP interface would have any influence for networking at all.

Please tell your opinion guys. Selva said it should revert the previous value upon termination.

author
#3 lore raw

Please check updated version
https://github.com/ValdikSS/openvpn-with-patches/commit/80345eac823326299c5428a8db45dc06a8d10f7b

set_interface_metric() needs to be called from interactive service but the service doesn't include win32.h/c so I had to copy/paste code into it. How could this be improved?

Quoted 25 lines · ValdikSS
Quoted 4 lines · Selva Nair

On Sat, Apr 15, 2017 at 6:41 PM, ValdikSS <[email protected]... <mailto:[email protected]...>> wrote:

How does this registry entry tell Windows that TAP adapter should be preferred for DNS? Or is this to be done in addition to setting up a preferred ordering of network adapters?

It doesn't. I just remembered that option and set it. It worked for me when DNS is in the same subnet with user, but it fails if DNS is in the internet. Setting lower metric to the TAP interface correctly works in both cases, without reg patch.

Quoted 2 lines

Can WFP be used to rewrite the source address? In that case we could just redirect all DNS requests through the TAP interface instead of dropping packets.

Unfortunately not, not without kernel driver.

Quoted 3 lines

As for local ipv6 DNS servers, I do not think we should do anything about it unless the tunnel can handle v6 traffic.

Selva

I made a perliminary patch to set interface metric to 7:
https://github.com/ValdikSS/openvpn-with-patches/commit/0651c0469038dd0ba39329f4b83ecd7e1d04323e

This is static change for the interface. Currently this patch does not revert previous metric value if there were any or set it back to automatic. Should it be implemented in your opinion? It still won't revert this value back in case of OpenVPN crash or power outage. Yet I don't think that lower metric on TAP interface would have any influence for networking at all.

Please tell your opinion guys. Selva said it should revert the previous value upon termination.

#4 lore raw
Quoted 6 lines · ValdikSS

Please check updated version
https://github.com/ValdikSS/openvpn-with-patches/commit/80345eac823326299c5428a8db45dc06a8d10f7b

set_interface_metric() needs to be called from interactive service but the service doesn't include win32.h/c so I had to copy/paste code into it. How could this be improved?

I've quickly looked at it. I am by far no Windows developer, so I don't understand all the deeper contexts of the details. But I've left a few comments on github with some questions I think could help clarify your patch.

Adding a few comment lines of "why" and documentation pointers on some of these details you set as "default" would help understand the code better. What your or we know as a fact today, doesn't mean we will remember that and correlate it with today's context in a few years.

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Technologies, Inc
Quoted 55 lines · ValdikSS
Quoted 37 lines · Selva Nair
Quoted 7 lines

On Sat, Apr 15, 2017 at 6:41 PM, ValdikSS <[email protected]... <mailto:[email protected]...>> wrote:

How does this registry entry tell Windows that TAP adapter should be preferred for DNS? Or is this to be done in addition to setting up a preferred ordering of network adapters?

It doesn't. I just remembered that option and set it. It worked for me when DNS is in the same subnet with user, but it fails if DNS is in the internet.
Setting lower metric to the TAP interface correctly works in both cases, without reg patch.

Quoted 4 lines

Can WFP be used to rewrite the source address? In that case we could just redirect all DNS requests through the TAP interface instead of dropping packets.

Unfortunately not, not without kernel driver.

Quoted 4 lines

As for local ipv6 DNS servers, I do not think we should do anything about it unless the tunnel can handle v6 traffic.

Selva

I made a perliminary patch to set interface metric to 7:
https://github.com/ValdikSS/openvpn-with-patches/commit/0651c0469038dd0ba39329f4b83ecd7e1d04323e

This is static change for the interface. Currently this patch does not revert previous metric value if there were any or set it back to automatic. Should it be implemented in your opinion? It still won't revert this value back in case of OpenVPN crash or power outage. Yet I don't think that lower metric on TAP interface would have any influence for networking at all.

Quoted 3 lines

Please tell your opinion guys. Selva said it should revert the previous value upon termination.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#6 lore raw
In reply to ValdikSS
Quoted 8 lines · ValdikSS

Please check updated version
https://github.com/ValdikSS/openvpn-with-patches/commit/
80345eac823326299c5428a8db45dc06a8d10f7b

set_interface_metric() needs to be called from interactive service but the service doesn't include win32.h/c so I had to copy/paste code into it. How could this be improved?

Code shared between to openvpn core and the service could go into block_dns.c and block_dns.h. Do not make the service code dependent on win32.h as that will pull-in a lot of unwanted dependencies with it.

Selva

author
#5 lore raw
In reply to David Sommerseth

Thanks, please see v2 here
https://github.com/ValdikSS/openvpn-with-patches/commit/bb5893bdbd74b8168e1ad9561a55bd9449b1d5b5

Quoted 23 lines · David Sommerseth

On 25/04/17 22:40, ValdikSS wrote:
I've quickly looked at it. I am by far no Windows developer, so I don't understand all the deeper contexts of the details. But I've left a few comments on github with some questions I think could help clarify your patch.

Adding a few comment lines of "why" and documentation pointers on some of these details you set as "default" would help understand the code better. What your or we know as a fact today, doesn't mean we will remember that and correlate it with today's context in a few years.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel