Score:0

Use a VPN only for some specific routes

my flag

I want to use a VPN only for some specific routes (so that the default route is not on the VPN).

So in the Add VPN dialog I selected the "Use this connection only for resources on its network" (this doesn't change the default route) and then I added some subnetworks that I want to route to the VPN.

However, I'm not sure which gateway should I set here, as this is the VPN's gateway address, and it's dynamic (from DHCP).

Add VPN dialog

in flag
did you find any solution?
Wizard79 avatar
my flag
@brauliobo unfortunately not
in flag
finally managed to make it work and added an answer. it is focused on Ubuntu but with some changes it will work
Score:0
in flag

I'm using FreshTomato here. I managed to only redirect 3 destination IPs to the VPN.

Below is the OpenVPN custom configuration:

allow-pull-fqdn
route-nopull
script-security 2
up /opt/openvpn-routes.sh

Then the script mentioned above:

root@router:/tmp/home/root# cat /opt/openvpn-routes.sh 
#!/bin/sh
ip route add 204.11.51.251/32  dev tun11 # www.linksysinfo.org
ip route add 201.54.48.99/32   dev tun11 # www12.senado.leg.br
ip route add 34.160.111.145/32 dev tun11 # ifconfig.me

For Ubuntu you can add custom configuration with the following command:

sudo nmcli connection modify vpnu-br +vpn.data key=value

The /opt mount point was set up following the instructions from https://github.com/Entware/Entware/wiki/Install-on-TomatoUSB-and-FreshTomato

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.