Skip to content

Instantly share code, notes, and snippets.

@d2rk
Last active March 16, 2020 14:37
Show Gist options
  • Save d2rk/a129180078e3f6f98193 to your computer and use it in GitHub Desktop.
Save d2rk/a129180078e3f6f98193 to your computer and use it in GitHub Desktop.
OpenWrt 3.14.27 and OpenVPN client for CactusVPN

You can use Ubuntu configuration files from https://www.cactusvpn.com/downloads/ to setup OpenVPN.

How to setup OpenVPN client for CactusVPN:

  1. Update configuration files.
  2. Start OpenVPN as /etc/init.d/openvpn start or make it start at boot as /etc/init.d/openvpn enable.

You can also start OpenVPN client manually as follows:

$ openvpn --cd /etc/openvpn --config /etc/openvpn/cactusvpn.ovpn

For some reason kmod-tun is not loaded on startup, thus you will have to do this manually before running openvpn:

$ opkg files kmod-tun
/etc/modules.d/30-tun
/lib/modules/3.14.28/tun.ko
$ insmod /lib/modules/3.14.28/tun.ko

or add this to /etc/rc.local.

UPDATE: sometimes you need to route some traffic across VPN:

$ ip route add <source> via <gateway>
# /etc/config/dhcp
config dnsmasq
...
option server '8.8.8.8'
option server '8.8.4.4'
# /etc/config/firewall
config zone
option name 'vpn'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
option network 'vpn'
config forwarding
option dest 'vpn'
option src 'lan'
# /etc/config/network
config interface 'vpn'
option proto 'none'
option ifname 'tap0'
# /etc/config/openvpn
package openvpn
config openvpn cactusvpn
option enabled 1
option config /etc/openvpn/cactusvpn.ovpn
@djspacedevil
Copy link

This dont work.

No effect.

@d2rk
Copy link
Author

d2rk commented Jun 14, 2017

Logs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment