NeoxHC
29
Unfortunately, it is still not working, access is given when VPN is disconnected:
to double check I did things properly,
1st file - edited as per directions in picture above.
2nd file, I did comment what suggested, I am only missing last line in the second picture, where I have the following:
ovpn_main() {
local ip
local host
local enable
eanble=$(uci get glconfig.openvpn.enable 2>/dev/null)
[ “$eanble” = “1” ] || return
# Load default rules
#if [ "$INTERFACE" = "ovpn" ]; then
# # add default rules and force to main table
# [ -z "$(ip route list | grep -E "0.0.0.0/1 (.*) $DEVICE" 2>/dev/null)" ] && {
# ip route add 0.0.0.0/1 dev $DEVICE 2>/dev/null
# ipset add mwan3_connected_v4 0.0.0.0/1 2>/dev/null
# }
# [ -z "$(ip route list | grep -E "128.0.0.0/1 (.*) $DEVICE" 2>/dev/null)" ] && {
# ip route add 128.0.0.0/1 dev $DEVICE 2>/dev/null
# ipset add mwan3_connected_v4 128.0.0.0/1 2>/dev/null
# }
#fi
host=$(uci get glconfig.openvpn.host 2>/dev/null)
[ -n "$host" ] || return
ip=$(echo $host | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}')
[ -n "$ip" ] && {
refresh_route $ip
}
}