The default route for internet traffic when the VPN is connected

My router is connected as a client to a VPN server (PPTP).
The settings were made according to this instruction:

Now all the internet traffic goes through the VPN tunnel. I need the internet traffic to go directly when the VPN is connected. How can I do this?

Simply remove the route created for the VPN.

If you need a more cleaner method, you may want to explain why you want an enabled VPN you don't intend to use.

I also assume the router automatically created the route (since the guide doesn't mention it) - feel free to ask if you need more guidance.

Perhaps you need to add option defaultroute '0' in VPN client configuration?

1 Like

Where I can find this route?

Just to make sure, I guess you mean 'when the VPN is DISconnected'?

1 Like

:confused: (It might help if you explained the purpose of the VPN if you don't desire to use it for Internet connectivity.)

Please provide the output of:

ip -4 route

root@OpenWrt:~# ip -4 route
default via 192.168.5.1 dev pptp-vpn 
46.147.242.79 via 192.168.1.1 dev wan 
192.168.0.0/24 via 192.168.5.1 dev pptp-vpn 
192.168.1.0/24 dev wan scope link  src 192.168.1.2 
192.168.5.1 dev pptp-vpn scope link  src 192.168.5.2 
192.168.8.0/24 dev br-lan scope link  src 192.168.8.1 
192.168.9.0/24 via 192.168.5.1 dev pptp-vpn 
192.168.10.0/24 via 192.168.5.1 dev pptp-vpn 
192.168.11.0/24 via 192.168.5.1 dev pptp-vpn

I only need a VPN server to access other local networks (so that computers from different networks can see each other). Each computer in each office should access the internet through its own provider.

It seems PPTP deleted the other default route to WAN.

ip route delete default via 192.168.5.1 dev pptp-vpn
ip route add default via 192.168.1.1 dev wan

OR:

Don't use PPTP, consider other solutions like WireGuard.
Use the configuration option I suggested earlier, otherwise look for the corresponding checkbox in Luci - "Use default gateway" in Interface, Advanced settings.

1 Like

In this case I should edit

It also works thank you. But uncheck "Use default gateway" is easier :slight_smile:

That command was actually for us to see what was happening. It has no affect. The ip route del and add commands were to [temporarily] fix the issue.

The steps the other user provided would be easier, and can be easily saved in configuration.

(TBH, Wireguard would be simpler than PPTP tunnels.)

1 Like

I was talking about it. This is also decision.