Desperately trying to configure OpenVPN client mode!

I have been trying to implement a OpenVPN client connection on my router to tunnel certain websites to a different country. So routing blocked websites in my country to the Netherlands via OpenVPN. But only certain websites.

What I did:

  1. Created a interface called NL-VPN, creating a physical device called tun0
  2. Created Firewall settings

Here is the /etc/openvpn file

config openvpn 'NL'
option client '1'
option proto 'udp'
option resolv_retry 'infinite'
option nobind '1'
option persist_key '1'
option persist_tun '1'
option user 'nobody'
#option cert '/etc/openvpn/ca.crt'
#option key '/etc/openvpn/client.key'
option compress 'lzo'
option port '1194'
option auth_user_pass '/etc/openvpn/user.txt'
option auth 'SHA256'
option cipher 'AES-256-CBC'
option mute_replay_warnings '1'
option ca '/etc/openvpn/ca.crt'
option auth_nocache '1'
option enabled '1'
list remote ''
option dev 'tun0'
option verb '1'

Now when I connect via OpenVPN in LUCI, I get this:

and this

And I cannot connect to the Internet at all.
I guess there is some routing issue.

EDIT: Great. After a reboot I cannot even start the OpenVPN process

what have you tested?

What do you mean? I cannot get it running.
I have used the same VPN connection with other devices and they work perfectly.

service log restart; service openvpn restart; sleep 10; logread -e openvpn

nothing :confused:

ubus call system board

Thanks for your hints.

OK, I'm a step closer. I have now managed to redo everything and could connect to the VPN.
Now I only want to route certain websites through the VPN.
I edited the config file and change it to:


This is which is tunneled through the VPN. The rest of the internet is not accessible.

How can I route only the websites I enter through route and the rest through the normal wan0?

route address mask vpn_gateway

Note that:

  • Every site can use more than one domain.
  • Every domain can use more than one IP address.
  • IP addresses can be dynamic.

Thanks. Where do I enter that?

1 Like