I am try to have a static IP go through my OpenVPN VPN at all times and have all other IPs not go through the VPN.
I have got it mostly working but I cannot get the UP/DOWN scripts to work when called from OpenVPN as they should.
I used the instructions at http://beenje.github.io/blog/posts/openvpn-source-based-routing/ with my unique entries for "CONFIGURING" paragraphs 2 (N/A) and para 5 (my WAN connection but DNS OK).
The other "Source based routing" section paragraphs the paras 3&4 client IP changed but otherwise I followed the instructions.
I got it to work manually, I entered the UP/DOWN script commands manually in Putty and the client IP did go through the VPN and other IPs did not, so works for me.
The issue I have is that when I set-up OpenVPN to use the UP/DOWN scripts I get the following error in the System Log: "daemon.err openvpn(PIA_NLD_AES128): WARNING: Failed running command (--up/--down): could not execute external program"
I set via LUCI GUI the following in the OpenVPN client setup:
Saved and stop/restarts multiple time to troubleshoot.
My scripts are: /etc/openvpn/upvpn and /etc/openvpn/downvpn permissions are 0777 and user group 00 (via filezilla).
Example Up script is:
#!/bin/sh client=192.168.1.199 tun_dev=$1 tun_mtu=$2 link_mtu=$3 ifconfig_local_ip=$4 ifconfig_remote_ip=$5 echo "Routing client $client traffic through VPN" ip rule add from $client priority 10 table vpn ip route add $client dev $tun_dev table vpn ip route add default via $ifconfig_remote_ip dev $tun_dev table vpn ip route flush cache
**Question is: **
How do I get OpenVPN to execute the UP/DOWN scripts correctly in OpenWRT "LEDE-STABLE Reboot 17.01-SNAPSHOT r3267-f4fc12f / LuCI lede-17.01 branch (git-17.061.45451-2fe510b)"?