Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / Windows 11 / Fix: No Internet Access When Connected to VPN

May 5, 2025

Fix: No Internet Access When Connected to VPN

When users connect to a corporate VPN server (AlwaysOnVPN, Windows Server RRAS, or OpenVPN server) from a home network, they may report that Internet access is unavailable while the VPN tunnel is active. In this article, we’ll look at why users might not be able to access the Internet in Windows when they’re connected to a VPN and how to fix it.

Contents:
  • Enable VPN Split Tunneling Mode on Windows
  • Adding Static Routes to VPN Networks on a Windows Client

When creating a new VPN connection in Windows (all versions), the Use default gateway on remote network option is enabled by default. This means that all network traffic from your computer is sent through the VPN tunnel. If the VPN server is configured to allow remote clients to access only internal (corporate) resources while blocking Internet access, users will not be able to access external websites or other Internet services from their machines while connected to the VPN. After disconnecting from the VPN, all user traffic is routed through the user’s local network (ISP), and Internet access is restored.

Enable VPN Split Tunneling Mode on Windows

The mode in which only part of the traffic (such as access to corporate resources) is routed through the VPN tunnel, while the rest (such as Internet access) is routed through the user’s local network connection, is known as Split Tunneling.

There are three ways to enable split tunneling mode in Windows:

  • In the TCP/IP settings of the VPN connection
  • Via rasphone.pbk file
  • Using the Set-VpnConnection PowerShell cmdlet with the SplitTunneling option

Changing the TCP/IP settings for your VPN connection through the GUI is the easiest way to enable Split Tunneling mode.

  1. Open the list of network connections in the Control Panel (Control Panel\Network and Internet\Network Connectionsor run the ncpa.cpl command to navigate here) and go to the properties of your VPN connection
  2. Go to the Networking tab, select Internet Protocol Version 4 (TCP/IPv4), and click Properties
  3. Click Advanced
  4. Disable the Use default gateway on remote network option on the IP Settings tab.
    windows 10 - Use default gateway on remote network for VPN connection

Reconnect to the VPN gateway and verify that your computer is now able to work with corporate resources and access the Internet at the same time.

In certain builds of Windows 10 and 11, this option may not work properly (problems include the field not being editable, the setting not being saved, or the TCP/IPv4 Properties window not opening), so alternative methods of enabling split tunneling must be considered.

The rasphone.pbk file containing the VPN connection settings is located in one of the following directories:

  •  C:\ProgramData\Microsoft\Network\Connections\pbk\ – when the VPN connection is created for all users on the computer
  • C:\Users\username\AppData\Roaming\Microsoft\Network\Connections\Pbk – if the VPN connection is created for the current user only

Open the rasphone.pbk with any text editor. The settings of all configured VPN connections are stored in this file. Locate the IpPrioritizeRemote parameter. By default, its value is 1. Change it to 0, save rasphone.pbk, and restart your VPN connection.

rasphone.pbk connection file -set IpPrioritizeRemote parameter

You can also configure the splitting of VPN traffic by using PowerShell. List the available VPN connections:

Get-VpnConnection

Make sure that the SplitTunneling option is disabled for your connection (SplitTunneling: False).

Get-VpnConnection - set SplitTunneling

To enable SplitTunneling, copy the name of your VPN connection and run the command:

Set-VpnConnection –name vpn.woshub.com -SplitTunneling $true

Reconnect to the VPN server and verify that both Internet access and connectivity to corporate resources behind the VPN gateway are working properly. Enabling the SplitTunneling option is similar to disabling the Use default gateway on remote network option in the TCP/IPv4 settings for a VPN connection (after you run this PowerShell command, the option checkbox is cleared).

Adding Static Routes to VPN Networks on a Windows Client

The split tunneling option described above will only work in simple scenarios where the IP addresses in the corporate network match the virtual network address assigned to the VPN clients. Otherwise, after the VPN connection is established, you will need to manually add static routes for all the required corporate IP networks located behind the VPN tunnel.

The built-in Windows VPN client has an option to automatically add static routes after the connection is established. To add a static route for your VPN connection, use this PowerShell command:

Add-VpnConnectionRoute -ConnectionName vpn.woshub.com -DestinationPrefix 10.0.0.0/16 -PassThru

If you are using a third-party VPN client, use the route add command to add static routes. For example,

route add 192.168.31.0 mask 255.255.255.0 192.168.200.1

Where, 192.168.31.0 is a remote network (behind VPN), 192.168.200.1 is a VPN gateway IP. To make the route persistent, add the -p option (not always applicable).

To view the current routing table, run the command:

route print

Check which network interface is used to route traffic to a specific host:

tracertoute myCorpPCName

Check which interface is used to access Internet resources:

Get-NetRoute -DestinationPrefix 0.0.0.0/0

Learn more about network adapter priorities in Windows.

To automatically connect VPN and add the required routes, you can create the following BAT file on your desktop:

rasdial.exe vpn.woshub.com
route add destination_network MASK subnet_mask vpn_gateway_ip

Another reason, if routing is fine, is the use of DNS servers to resolve names assigned by the VPN server. If these DNS servers are in an isolated segment and cannot resolve external (Internet) names, you will also be unable to resolve the names of external resources.  For more details, see the article “Unable to resolve DNS when connected to VPN“.

The solutions described in this article may not work with third-party VPN clients (such as Cisco AnyConnect, Checkpoint, etc.), which may have their routing logic.

0 comment
8
Facebook Twitter Google + Pinterest
PowerShellWindows 10Windows 11
previous post
How to Enable and Configure User Disk Quotas in Windows?
next post
USB Device Passthrough (Redirect) to Hyper-V Virtual Machine

Related Reading

Fix: The Computer Restarted Unexpectedly or Encountered an...

May 16, 2024

PowerShell: Get Folder Size on Windows

April 2, 2024

How to Download Offline Installer (APPX/MSIX) for Microsoft...

March 12, 2024

Windows Doesn’t Automatically Assign Drive Letters

March 15, 2024

How to Clean Up System Volume Information Folder...

March 17, 2024

Software RAID1 (Mirror) for Boot Drive on Windows

February 24, 2025

Managing Administrative Shares (Admin$, IPC$, C$) on Windows

March 15, 2024

Enable Group Policy Editor (gpedit.msc) on Windows 10/11...

June 20, 2024

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Install and Manage Windows Updates with PowerShell (PSWindowsUpdate)
  • How to Download Offline Installer (APPX/MSIX) for Microsoft Store App
  • Configuring Port Forwarding in Windows
  • Start Menu or Taskbar Search Not Working in Windows 10/11
  • Get-ADUser: Find Active Directory User Info with PowerShell
  • Adding Drivers into VMWare ESXi Installation Image
  • Tracking and Analyzing Remote Desktop Connection Logs in Windows
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top