Skip to content

Commit

Permalink
Fix intermittent failure to create subnet routes
Browse files Browse the repository at this point in the history
netifd was interferring with adding routes due to our dummy interface in the network config. Replace this with a definition in the firewall config instead.
  • Loading branch information
lantis1008 committed Apr 21, 2019
1 parent 141de20 commit 8b8b5e3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package/plugin-gargoyle-openvpn/files/etc/openvpn.firewall
Expand Up @@ -139,7 +139,7 @@ initialize()
local_openvpn_port=$(netstat -u -t -p -a -e -n 2>/dev/null | awk ' $0 ~/openvpn/ { gsub(/^.*:/, "", $4) ; print $4 ; } ')
openvpn_proto=$(netstat -u -t -p -a -e -n 2>/dev/null | awk ' $0 ~/openvpn/ { print $1 ; } ')
wan_if=$(uci -P /var/state get network.wan.ifname 2>/dev/null)
vpn_if=$(uci -P /var/state get network.vpn.ifname 2>/dev/null)
vpn_if=$(uci -P /var/state get firewall.vpn_zone.device 2>/dev/null)
if [ -n "$local_openvpn_port" ] && [ -n "$openvpn_proto" ] && [ -n "$wan_if" ] && [ -n "$vpn_if" ] ; then

# create openvpn bandwidth monitor chains
Expand Down
8 changes: 1 addition & 7 deletions package/plugin-gargoyle-openvpn/files/www/js/openvpn.js
Expand Up @@ -28,15 +28,9 @@ function saveChanges()
{
if(enabled)
{
uci.set("network", "vpn", "", "interface")
uci.set("network", "vpn", "ifname", "tun0")
uci.set("network", "vpn", "proto", "none")
uci.set("network", "vpn", "defaultroute", "0")
uci.set("network", "vpn", "peerdns", "0")

uci.set("firewall", "vpn_zone", "", "zone")
uci.set("firewall", "vpn_zone", "name", "vpn")
uci.set("firewall", "vpn_zone", "network", "vpn")
uci.set("firewall", "vpn_zone", "device", "tun0")
uci.set("firewall", "vpn_zone", "input", "ACCEPT")
uci.set("firewall", "vpn_zone", "output", "ACCEPT")
uci.set("firewall", "vpn_zone", "forward", "ACCEPT")
Expand Down
2 changes: 1 addition & 1 deletion package/qos-gargoyle/files/qos_gargoyle.init
Expand Up @@ -757,7 +757,7 @@ define_interface()
local_ip=$(ifconfig br-lan | sed -n 's/.*inet addr:\([0-9/.]*\).*/\1/p')

#Determine the VPN interface if there is one.
vpn_interface=$(uci -P /var/state get network.vpn.ifname 2>/dev/null)
vpn_interface=$(uci -P /var/state get firewall.vpn_zone.device 2>/dev/null)
$echo_off
}

Expand Down

0 comments on commit 8b8b5e3

Please sign in to comment.