0

I have a PPTP VPN connection named "myvpn"

PPP adapter myvpn:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : 4274:35b2:be80::b4d3:97b0%65
   IPv4 Address. . . . . . . . . . . : 172.10.10.20
   Subnet Mask . . . . . . . . . . . : 255.255.255.255
   Default Gateway . . . . . . . . . :

(Associated DNS servers to the VPN are 192.168.123.11 and 192.168.123.12)

Problem:

With the VPN, I can only access my work website app.zzz.com which corresponding IP is 192.168.123.102.

And without VPN, no DNS server resolves that URL.

Question:

Is it possible to make Windows only resolve app.zzz.com through myvpn connection?

and only route the corresponding IP through the VPN?

6
  • By default, send all traffic to the remote gateway is enabled. If you disable this, it will try both your home network and the remote server. It will work as long as the remote network is not in the same ip range. community.spiceworks.com/topic/…
    – LPChip
    Commented Feb 25, 2022 at 11:22
  • @LPChip No, uncheck that option make every DNS request to not use VPN.
    – Hamid Z
    Commented Feb 25, 2022 at 11:30
  • Yes, but if it can't find app.zzz.com on your local network, it will then try the VPN still.
    – LPChip
    Commented Feb 25, 2022 at 13:11
  • 1
    @LPChip No, it doesn't. I get the error "ERR_NAME_NOT_RESOLVED" on edge.
    – Hamid Z
    Commented Feb 25, 2022 at 15:30
  • On the VPN connection, in IPv4, go to advanced settings, and on the DNS tab, specify the ip address of the DNS server that can resolve app.zzz.com and it should work. Do not setup DNS from the Ipv4 settings itself, somehow that doesn't work, even though that page gets filled if you do it the right way.
    – LPChip
    Commented Feb 25, 2022 at 15:46

1 Answer 1

1

I solved the problem. first uncheck "use default gateway on remote network" to let all requests bypass VPN connection.

Then with below command, let all 192.168.123.x requests (including DNS requests) to pass through VPN.

Add-VpnConnectionRoute -ConnectionName "myvpn" -DestinationPrefix "192.168.123.0/24"

Edit: If you export the rasdial.pbk file and use it on another system, It's OK and everything work. Because route rules are saved on the pbk file connection.

Edit2: I think this method is for win 8+ but I found another might work for older windows. https://medium.com/@ATheCoder/how-to-use-split-tunneling-for-your-vpn-on-windows-10-85e76635914d

2
  • That was gonna be my next suggestion. Weird that just setting the DNS did not work.
    – LPChip
    Commented Feb 25, 2022 at 23:05
  • @LPChip Yeah, look like there is a problem with prioritizing gateways.
    – Hamid Z
    Commented Feb 26, 2022 at 8:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .