21

What is the easiest way to ensure all traffic goes through the VPN in Windows 10? Is there any built in ways? I'm basically looking for a internet kill switch in the case VPN fails.

I red that sometimes the OS gets confused and for some random reason just doesn't use the VPN when sending traffic, is this actually a valid concern?

  • Setup the VPN to do that then connect to it – Ramhound Jan 4 '16 at 3:32
  • @Ramhound the VPN manager I use has a kill switch, but it's buggy, especially if multiple network interfaces are present. – Celeritas Jan 4 '16 at 3:35
  • When I indicate, "setup the VPN", I mean configure the VPN not to leak your personal information. A properly encrypted VPN will automatically connect you to the virtual private network, and all traffic will go through that network, nothing special has to be done once that is done. – Ramhound Jan 4 '16 at 4:42
  • I would assume because of the apparent lack of research on the topic – Ramhound Jan 8 '16 at 11:46
12

Note:

Be sure you have only one network adapter enabled, example: if you are using ethernet, be sure wireless is disabled. If using wireless be sure no ethernet cable is connected, or disable the adapter in networking and sharing center > change adapter settings.

Open command prompt and do a command:

netstat /r

note the Interface ip address on the 0.0.0.0 line in the "Active Routes" section , lets just say it is 192.168.0.1

Connect to your VPN

Do another netstat /r

Note you will see a new ip route for the vpn (second 0.0.0.0. line), note that Interface new route ip

Now kill the original non vpn route with this command

route delete 0.0.0.0 192.168.0.1

then do another netstat /r

you will only see your vpn route now, and if your VPN line drops, you lose that route, so there are no more 0.0.0.0 routes and your external connection will be immediately cut off. If you want to access the internet you'll need to add the original route back with this command:

route add 0.0.0.0 mask 0.0.0.0 192.168.0.1 IF 8

The "IF 8" means "interface 8". The number 8 may be different on your computer, look at the output of netstat -r to get the correct number of your interface in the Interface List

All that being said I would disable ipv6, I have done this with no issues after doing so.

disable ipv6 command:

netsh interface teredo set state disabled

Enable ipv6 command:

netsh interface teredo set state default
  • "Be sure you have only one network adapter enabled," what about the virtual adapters, such as those used by VMware? – Celeritas Jan 4 '16 at 8:59
  • See answer above by dxiv – Moab Jan 4 '16 at 19:05
  • After doing the route delete command I got the error The route deletion failed: Element not found. – Celeritas Jan 12 '16 at 8:01
  • You did something wrong. – Moab Jan 12 '16 at 15:50
  • @Moab Use gateway IP instead of destination IP – Ankit_Shah55 Jan 26 '17 at 7:34
10

These are 2 questions rolled into one.

I'm basically looking for a internet kill switch in the case VPN fails

@Moab's answer settles this question nicely.

What is the easiest way to ensure all traffic goes through the VPN in Windows 10?
Is there any built in ways?

This is a different question. Note that all traffic goes through the VPN has an implied "as long as the VPN connection is up". The built-in way to route Internet traffic over VPN will transparently fallback to the local Internet connection if the VPN gets disconnected for whatever reason.

That said, the following steps should answer the 2nd question:

  • right click the Start button, select Network Connections
  • click the VPN connection you want to use, right-click, select Properties
  • click the Networking tab, select IPv4 from the list, click Properties
  • click Advanced, make sure "Use default gateway on remote network" is checked
  • repeat previous step for IPv6 if applicable
  • I couldn't see ""Use default gateway on remote network", after clicking advanced, but under the label "default gateways", the list was blank. – Celeritas Jan 12 '16 at 8:04
  • There is no label "default gateways" that I can find in the steps listed above. Either you ended up in the wrong place, or maybe you are using some 3rd party VPN other than the Windows built-in one, in which case that should have been the very first thing to point in your question. – dxiv Jan 12 '16 at 8:16
  • I didn't know Windows 10 had a built in one – Celeritas Jan 12 '16 at 8:41
  • @Celeritas Windows has had a built-in VPN client for(virtually)ever. If you are not using it, but instead some other 3rd party alternative then both my answer and Moab's have been a waste of time. Please provide the full context when you ask a question next time. – dxiv Jan 12 '16 at 8:48
  • 1
    if Windows comes with a VPN then why does virtually everyone who uses VPN use a 3rd party alternative? – Celeritas Jan 12 '16 at 9:33

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.