@openvpn_inc It probably depends on your use case as to whether you want the default gateway to be on the VPN or not. We use openVPN as the client for remote access to our network. We want all traffic to pass through the company gateway except for designated external links pushed by routes from the server (MS Teams/Office for example we configure to bypass the VPN so we do not slow the connections to them)
@marceaxu The issue usually happens when Windows assigns a metric to the new connection that is higher than one of your existing ones - so Windows keeps using the existing one as it's default.
If you open a CMD prompt and run the command
NETSH INTERFACE IPV4 SHOW INTERFACES
Idx Met MTU State Name
--- ---------- ---------- ------------ ---------------------------
1 75 4294967295 connected Loopback Pseudo-Interface 1
25 55 1500 disconnected WiFi
27 5 1500 disconnected Local Area Connection
9 65 1500 disconnected Bluetooth Network Connection
7 25 1500 disconnected Local Area Connection 2
12 25 1500 connected Ethernet 2
2 4 1500 disconnected OpenVPN Data Channel Offload
8 25 1500 disconnected Local Area Connection* 1
24 25 1500 disconnected Local Area Connection* 3
28 15 1500 connected vEthernet (Default Switch)
If you use IPv6 also then also run
NETSH INTERFACE IPV6 SHOW INTERFACES
you can see the Metric (Met column) assigned to each of the adapters in your system. The one with the lowest metric will be the one whose default gateway is used.
You need to make sure "OpenVPN Data Channel Offload" adapter has the lowest number. Mine was assigned 25 by Windows on installation, so the VPN-assigned Default Gateway never took effect. This metric also affects the DNS in the same way. If you use split-DNS you will find that an external resolver is handling your queries instead of the internal (on-VPN) one. You can see that I set my adapter to Metric 4 to make it the lowest Metric number in the system.
Note the lowest current Metric on your system, and pick a number lower than that.
On Windows 11, click Search and type "Manage network adapter" and Enter to bring up the "Advanced Network Settings" page. Scroll down and click on "More network adapter options" to bring up the old Windows 10 style adapter page.
Double-click on the "OpenVPN Data Channel Offload" adapter to bring up it's property page.
Double-click on "Internet Protocol Version 4 (TCP/IPv4)" to bring up the properties page
Click the Advanced... button
In the "IP Settings" on the bottom of the page you can see that "Automatic metric" is selected
Un-check the box, and enter your chosen Metric
If you also use IPv6, repeat the change for "Internet Protocol Version 6 (TCP/IPv6)"
Save and exit
Your VPN-assigned Gateway/DNS should now work as expected.