VPN for specific websites and IPs only?

I was following instructions (provided below) to modify an .opvn file so that I could route specific websites / IPs over VPN but not all traffic.

It is not working and I was wondering if that is because the rules in the profile are being overruled by the openvpn settings on OpenWRT / GLI (perhaps /etc/config/openwrt or another file)?

Does anyone have any idea how I may achieve this?


Now open the *.ovpn file of the VPN server you'd like to use with e.g. Notepad or any other document viewer.

At the top you add the following 2 lines:



The first line prevents the VPN client from creating a standard rule that forces ALL traffic through the VPN connection.

The second line tells your machine what IPs should be used via VPN connection.

Replace “” with the IP you want being used via VPN connection.


This could be done actually. I have tried similar configs. You can check the log too see if the rules are added.

logread |grep openvpn