Page 1 of 1

Route only specific hostnames through the VPN

Posted: Sun Apr 11, 2021 11:24 pm
by vinopenvpn
Hello,
I have been trying to figure out how to route specific hostname (example.com) through the VPN and all other traffic will not use VPN.
I tried adding following to the .ovpn file

Code: Select all

route-nopull
route IP_ADDRESS 255.255.255.0
where IP_ADDRESS is the ip address for the host (example.com) that I want to go through the VPN but I get an error

Code: Select all

Options error: option 'redirect-gateway' cannot be used in this context ([PUSH-OPTIONS])
Options error: option 'dhcp-option' cannot be used in this context ([PUSH-OPTIONS])
Options error: option 'route' cannot be used in this context ([PUSH-OPTIONS])
Is this something possible to do? Also I would like to avoid ip address and specify hostname (I think I need allow-pull-fqdn but that is next step)

I have an Asus router with Merlin firmware.

Re: Route only specific hostnames through the VPN

Posted: Mon Apr 12, 2021 12:16 am
by TinCanTech
Never use --route-nopull .. unless you want to break your VPN.

Instead, use --pull-filter ignore "what ever you want to ignore"

Or better yet, learn how to configure your router so it does what you want.

Then you can add what-ever routes you like with --route