0

It has been a few years since I have manually set any routes on windows, so I'm super rusty. Is it possible to run some route commands to change the routes after I connect to my work VPN so that my general internet still works, but the VPN traffic is still routed to its source? Below are my before/after VPN connection routes.

Routes before VPN connection:

  ===========================================================================
    Interface List
     10...68 5a cf ef aa d5 ......Qualcomm Atheros QCA61x4A Wireless Network Adapter
      9...6a 5a cf ef aa d5 ......Microsoft Wi-Fi Direct Virtual Adapter
      3...7a 5a cf ef aa d5 ......Microsoft Wi-Fi Direct Virtual Adapter #2
     12...b0 8d 80 47 59 51 ......CDC MBIM
      5...68 5a cf ef aa d4 ......Bluetooth Device (Personal Area Network) #2
      1...........................Software Loopback Interface 1
    ===========================================================================

    IPv4 Route Table
    ===========================================================================
    Active Routes:
    Network Destination        Netmask          Gateway       Interface  Metric
              0.0.0.0          0.0.0.0      100.85.14.1     100.85.14.66    311
           100.85.0.0      255.255.0.0         On-link      100.85.14.66    311
         100.85.14.66  255.255.255.255         On-link      100.85.14.66    311
       100.85.255.255  255.255.255.255         On-link      100.85.14.66    311
            127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
            127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
      127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
            224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
            224.0.0.0        240.0.0.0         On-link      100.85.14.66    311
      255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
      255.255.255.255  255.255.255.255         On-link      100.85.14.66    311
    ===========================================================================
    Persistent Routes:
      None

Routes after VPN:

===========================================================================
Interface List
 42...00 05 9a 3c 7a 00 ......Cisco AnyConnect Secure Mobility Client Virtual Miniport Adapter for Windows x64
 10...68 5a cf ef aa d5 ......Qualcomm Atheros QCA61x4A Wireless Network Adapter
  9...6a 5a cf ef aa d5 ......Microsoft Wi-Fi Direct Virtual Adapter
  3...7a 5a cf ef aa d5 ......Microsoft Wi-Fi Direct Virtual Adapter #2
 12...b0 8d 80 47 59 51 ......CDC MBIM
  5...68 5a cf ef aa d4 ......Bluetooth Device (Personal Area Network) #2
  1...........................Software Loopback Interface 1
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      100.85.14.1     100.85.14.66    311
          0.0.0.0          0.0.0.0     172.30.225.1   172.30.225.118      2
     68.113.73.68  255.255.255.255      100.85.14.1     100.85.14.66     56
       100.85.0.0      255.255.0.0         On-link      100.85.14.66    311
       100.85.0.0      255.255.0.0     172.30.225.1   172.30.225.118      2
     100.85.14.66  255.255.255.255         On-link      100.85.14.66    311
   100.85.255.255  255.255.255.255         On-link      100.85.14.66    311
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
     172.30.225.0    255.255.255.0         On-link    172.30.225.118    257
   172.30.225.118  255.255.255.255         On-link    172.30.225.118    257
   172.30.225.255  255.255.255.255         On-link    172.30.225.118    257
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
        224.0.0.0        240.0.0.0         On-link      100.85.14.66    311
        224.0.0.0        240.0.0.0         On-link    172.30.225.118    257
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
  255.255.255.255  255.255.255.255         On-link      100.85.14.66    311
  255.255.255.255  255.255.255.255         On-link    172.30.225.118    257
===========================================================================
Persistent Routes:
  None
1

What you are configuring is called Split Tunneling.

First, modify the properties of the VPN connection to not be used as the default gateway for all traffic:

  • Navigate to Control Panel > Network and Sharing Center > Change Adapter Settings
  • Right click on the VPN connection, then choose Properties
  • Select the Networking tab
  • Select Internet Protocol Version 4 (TCP/IPv4) and click Properties
  • Click Advanced
  • Deselect the box for "Use default gateway on remote network"
  • Click OK to apply the changes to the interface

Next, add routes for the desired VPN subnets. This should be done with the VPN tunnel connected:

  • Open a command prompt
  • Run ipconfig /all
  • In the list of interfaces, find the Description for the VPN connection created earlier. This will be needed later.
  • Run the below command replacing the relevant information between the <> markings:

    netsh interface ipv4 add route <destination subnet> "<interface name>"
    

    For example, if "Home" is the name of your adapter :

    netsh interface ipv4 192.168.128.0/24 "Home"
    

    Use the same command, replacing "add" with "delete" to remove the route.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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