Skip to content

Instantly share code, notes, and snippets.

@ValdikSS
Last active August 29, 2015 14:06
Show Gist options
  • Save ValdikSS/78b96927457720fb3802 to your computer and use it in GitHub Desktop.
Save ValdikSS/78b96927457720fb3802 to your computer and use it in GitHub Desktop.
+ cat /tmp/out
+ mwan3_ifupdown
+ local counter enabled iface_count iface_id route_args wan_metric
+ [ -n eth0.2 ]
+ [ -n wan ]
+ uci get -P /var/state mwan3.wan
+ [ interface == interface ]
+ config_load mwan3
+ [ -n ]
+ uci_load mwan3
+ local PACKAGE=mwan3
+ local DATA
+ local RET
+ local VAR
+ _C=0
+ [ -z ]
+ export -n CONFIG_LIST_STATE=
+ export -n CONFIG_SECTIONS=
+ export -n CONFIG_NUM_SECTIONS=0
+ export -n CONFIG_SECTION=
+ /sbin/uci -P /var/state -S -n export mwan3
+ DATA=package mwan3
config rule 'server'
option src_ip '192.168.5.10'
option proto 'all'
option use_policy 'wan_only'
config rule 'lan_subnet'
option src_ip '192.168.5.0/24'
option proto 'all'
option use_policy 'vpn_only'
config rule 'guests'
option src_ip '192.168.6.0/24'
option proto 'all'
option use_policy 'wan_only'
config interface 'wan'
option enabled '1'
option reliability '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '3'
config interface 'sevpn'
option enabled '1'
option reliability '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '3'
config member 'wan_link'
option interface 'wan'
option metric '20'
option weight '20'
config member 'vpn_link'
option interface 'sevpn'
option metric '50'
option weight '50'
config policy 'wan_only'
list use_member 'wan_link'
config policy 'vpn_only'
list use_member 'vpn_link'
+ RET=0
+ [ 0 != 0 -o -z package mwan3
config rule 'server'
option src_ip '192.168.5.10'
option proto 'all'
option use_policy 'wan_only'
config rule 'lan_subnet'
option src_ip '192.168.5.0/24'
option proto 'all'
option use_policy 'vpn_only'
config rule 'guests'
option src_ip '192.168.6.0/24'
option proto 'all'
option use_policy 'wan_only'
config interface 'wan'
option enabled '1'
option reliability '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '3'
config interface 'sevpn'
option enabled '1'
option reliability '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '3'
config member 'wan_link'
option interface 'wan'
option metric '20'
option weight '20'
config member 'vpn_link'
option interface 'sevpn'
option metric '50'
option weight '50'
config policy 'wan_only'
list use_member 'wan_link'
config policy 'vpn_only'
list use_member 'vpn_link' ]
+ eval package mwan3
config rule 'server'
option src_ip '192.168.5.10'
option proto 'all'
option use_policy 'wan_only'
config rule 'lan_subnet'
option src_ip '192.168.5.0/24'
option proto 'all'
option use_policy 'vpn_only'
config rule 'guests'
option src_ip '192.168.6.0/24'
option proto 'all'
option use_policy 'wan_only'
config interface 'wan'
option enabled '1'
option reliability '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '3'
config interface 'sevpn'
option enabled '1'
option reliability '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '3'
config member 'wan_link'
option interface 'wan'
option metric '20'
option weight '20'
config member 'vpn_link'
option interface 'sevpn'
option metric '50'
option weight '50'
config policy 'wan_only'
list use_member 'wan_link'
config policy 'vpn_only'
list use_member 'vpn_link'
+ package mwan3
+ return 0
+ config rule server
+ local cfgtype=rule
+ local name=server
+ export -n CONFIG_NUM_SECTIONS=1
+ name=server
+ append CONFIG_SECTIONS server
+ local var=CONFIG_SECTIONS
+ local value=server
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server
+ [ -n ]
+ config_cb rule server
+ return 0
+ export -n CONFIG_SECTION=server
+ export -n CONFIG_server_TYPE=rule
+ option src_ip 192.168.5.10
+ local varname=src_ip
+ shift
+ local value=192.168.5.10
+ export -n CONFIG_server_src_ip=192.168.5.10
+ [ -n ]
+ option_cb src_ip 192.168.5.10
+ return 0
+ option proto all
+ local varname=proto
+ shift
+ local value=all
+ export -n CONFIG_server_proto=all
+ [ -n ]
+ option_cb proto all
+ return 0
+ option use_policy wan_only
+ local varname=use_policy
+ shift
+ local value=wan_only
+ export -n CONFIG_server_use_policy=wan_only
+ [ -n ]
+ option_cb use_policy wan_only
+ return 0
+ config rule lan_subnet
+ local cfgtype=rule
+ local name=lan_subnet
+ export -n CONFIG_NUM_SECTIONS=2
+ name=lan_subnet
+ append CONFIG_SECTIONS lan_subnet
+ local var=CONFIG_SECTIONS
+ local value=lan_subnet
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet
+ [ -n ]
+ config_cb rule lan_subnet
+ return 0
+ export -n CONFIG_SECTION=lan_subnet
+ export -n CONFIG_lan_subnet_TYPE=rule
+ option src_ip 192.168.5.0/24
+ local varname=src_ip
+ shift
+ local value=192.168.5.0/24
+ export -n CONFIG_lan_subnet_src_ip=192.168.5.0/24
+ [ -n ]
+ option_cb src_ip 192.168.5.0/24
+ return 0
+ option proto all
+ local varname=proto
+ shift
+ local value=all
+ export -n CONFIG_lan_subnet_proto=all
+ [ -n ]
+ option_cb proto all
+ return 0
+ option use_policy vpn_only
+ local varname=use_policy
+ shift
+ local value=vpn_only
+ export -n CONFIG_lan_subnet_use_policy=vpn_only
+ [ -n ]
+ option_cb use_policy vpn_only
+ return 0
+ config rule guests
+ local cfgtype=rule
+ local name=guests
+ export -n CONFIG_NUM_SECTIONS=3
+ name=guests
+ append CONFIG_SECTIONS guests
+ local var=CONFIG_SECTIONS
+ local value=guests
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests
+ [ -n ]
+ config_cb rule guests
+ return 0
+ export -n CONFIG_SECTION=guests
+ export -n CONFIG_guests_TYPE=rule
+ option src_ip 192.168.6.0/24
+ local varname=src_ip
+ shift
+ local value=192.168.6.0/24
+ export -n CONFIG_guests_src_ip=192.168.6.0/24
+ [ -n ]
+ option_cb src_ip 192.168.6.0/24
+ return 0
+ option proto all
+ local varname=proto
+ shift
+ local value=all
+ export -n CONFIG_guests_proto=all
+ [ -n ]
+ option_cb proto all
+ return 0
+ option use_policy wan_only
+ local varname=use_policy
+ shift
+ local value=wan_only
+ export -n CONFIG_guests_use_policy=wan_only
+ [ -n ]
+ option_cb use_policy wan_only
+ return 0
+ config interface wan
+ local cfgtype=interface
+ local name=wan
+ export -n CONFIG_NUM_SECTIONS=4
+ name=wan
+ append CONFIG_SECTIONS wan
+ local var=CONFIG_SECTIONS
+ local value=wan
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests wan
+ [ -n ]
+ config_cb interface wan
+ return 0
+ export -n CONFIG_SECTION=wan
+ export -n CONFIG_wan_TYPE=interface
+ option enabled 1
+ local varname=enabled
+ shift
+ local value=1
+ export -n CONFIG_wan_enabled=1
+ [ -n ]
+ option_cb enabled 1
+ return 0
+ option reliability 1
+ local varname=reliability
+ shift
+ local value=1
+ export -n CONFIG_wan_reliability=1
+ [ -n ]
+ option_cb reliability 1
+ return 0
+ option count 1
+ local varname=count
+ shift
+ local value=1
+ export -n CONFIG_wan_count=1
+ [ -n ]
+ option_cb count 1
+ return 0
+ option timeout 2
+ local varname=timeout
+ shift
+ local value=2
+ export -n CONFIG_wan_timeout=2
+ [ -n ]
+ option_cb timeout 2
+ return 0
+ option interval 5
+ local varname=interval
+ shift
+ local value=5
+ export -n CONFIG_wan_interval=5
+ [ -n ]
+ option_cb interval 5
+ return 0
+ option down 3
+ local varname=down
+ shift
+ local value=3
+ export -n CONFIG_wan_down=3
+ [ -n ]
+ option_cb down 3
+ return 0
+ option up 3
+ local varname=up
+ shift
+ local value=3
+ export -n CONFIG_wan_up=3
+ [ -n ]
+ option_cb up 3
+ return 0
+ config interface sevpn
+ local cfgtype=interface
+ local name=sevpn
+ export -n CONFIG_NUM_SECTIONS=5
+ name=sevpn
+ append CONFIG_SECTIONS sevpn
+ local var=CONFIG_SECTIONS
+ local value=sevpn
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests wan sevpn
+ [ -n ]
+ config_cb interface sevpn
+ return 0
+ export -n CONFIG_SECTION=sevpn
+ export -n CONFIG_sevpn_TYPE=interface
+ option enabled 1
+ local varname=enabled
+ shift
+ local value=1
+ export -n CONFIG_sevpn_enabled=1
+ [ -n ]
+ option_cb enabled 1
+ return 0
+ option reliability 1
+ local varname=reliability
+ shift
+ local value=1
+ export -n CONFIG_sevpn_reliability=1
+ [ -n ]
+ option_cb reliability 1
+ return 0
+ option count 1
+ local varname=count
+ shift
+ local value=1
+ export -n CONFIG_sevpn_count=1
+ [ -n ]
+ option_cb count 1
+ return 0
+ option timeout 2
+ local varname=timeout
+ shift
+ local value=2
+ export -n CONFIG_sevpn_timeout=2
+ [ -n ]
+ option_cb timeout 2
+ return 0
+ option interval 5
+ local varname=interval
+ shift
+ local value=5
+ export -n CONFIG_sevpn_interval=5
+ [ -n ]
+ option_cb interval 5
+ return 0
+ option down 3
+ local varname=down
+ shift
+ local value=3
+ export -n CONFIG_sevpn_down=3
+ [ -n ]
+ option_cb down 3
+ return 0
+ option up 3
+ local varname=up
+ shift
+ local value=3
+ export -n CONFIG_sevpn_up=3
+ [ -n ]
+ option_cb up 3
+ return 0
+ config member wan_link
+ local cfgtype=member
+ local name=wan_link
+ export -n CONFIG_NUM_SECTIONS=6
+ name=wan_link
+ append CONFIG_SECTIONS wan_link
+ local var=CONFIG_SECTIONS
+ local value=wan_link
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests wan sevpn wan_link
+ [ -n ]
+ config_cb member wan_link
+ return 0
+ export -n CONFIG_SECTION=wan_link
+ export -n CONFIG_wan_link_TYPE=member
+ option interface wan
+ local varname=interface
+ shift
+ local value=wan
+ export -n CONFIG_wan_link_interface=wan
+ [ -n ]
+ option_cb interface wan
+ return 0
+ option metric 20
+ local varname=metric
+ shift
+ local value=20
+ export -n CONFIG_wan_link_metric=20
+ [ -n ]
+ option_cb metric 20
+ return 0
+ option weight 20
+ local varname=weight
+ shift
+ local value=20
+ export -n CONFIG_wan_link_weight=20
+ [ -n ]
+ option_cb weight 20
+ return 0
+ config member vpn_link
+ local cfgtype=member
+ local name=vpn_link
+ export -n CONFIG_NUM_SECTIONS=7
+ name=vpn_link
+ append CONFIG_SECTIONS vpn_link
+ local var=CONFIG_SECTIONS
+ local value=vpn_link
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests wan sevpn wan_link vpn_link
+ [ -n ]
+ config_cb member vpn_link
+ return 0
+ export -n CONFIG_SECTION=vpn_link
+ export -n CONFIG_vpn_link_TYPE=member
+ option interface sevpn
+ local varname=interface
+ shift
+ local value=sevpn
+ export -n CONFIG_vpn_link_interface=sevpn
+ [ -n ]
+ option_cb interface sevpn
+ return 0
+ option metric 50
+ local varname=metric
+ shift
+ local value=50
+ export -n CONFIG_vpn_link_metric=50
+ [ -n ]
+ option_cb metric 50
+ return 0
+ option weight 50
+ local varname=weight
+ shift
+ local value=50
+ export -n CONFIG_vpn_link_weight=50
+ [ -n ]
+ option_cb weight 50
+ return 0
+ config policy wan_only
+ local cfgtype=policy
+ local name=wan_only
+ export -n CONFIG_NUM_SECTIONS=8
+ name=wan_only
+ append CONFIG_SECTIONS wan_only
+ local var=CONFIG_SECTIONS
+ local value=wan_only
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests wan sevpn wan_link vpn_link wan_only
+ [ -n ]
+ config_cb policy wan_only
+ return 0
+ export -n CONFIG_SECTION=wan_only
+ export -n CONFIG_wan_only_TYPE=policy
+ list use_member wan_link
+ local varname=use_member
+ shift
+ local value=wan_link
+ local len
+ config_get len wan_only use_member_LENGTH 0
+ eval export -n -- len=${CONFIG_wan_only_use_member_LENGTH:-${4}}
+ export -n -- len=0
+ [ 0 = 0 ]
+ append CONFIG_LIST_STATE wan_only_use_member
+ local var=CONFIG_LIST_STATE
+ local value=wan_only_use_member
+ local sep=
+ eval export -n -- "CONFIG_LIST_STATE=${CONFIG_LIST_STATE:+${CONFIG_LIST_STATE}${value:+$sep}}$value"
+ export -n -- CONFIG_LIST_STATE=wan_only_use_member
+ len=1
+ config_set wan_only use_member_ITEM1 wan_link
+ local section=wan_only
+ local option=use_member_ITEM1
+ local value=wan_link
+ local old_section=wan_only
+ CONFIG_SECTION=wan_only
+ option use_member_ITEM1 wan_link
+ local varname=use_member_ITEM1
+ shift
+ local value=wan_link
+ export -n CONFIG_wan_only_use_member_ITEM1=wan_link
+ [ -n ]
+ option_cb use_member_ITEM1 wan_link
+ return 0
+ CONFIG_SECTION=wan_only
+ config_set wan_only use_member_LENGTH 1
+ local section=wan_only
+ local option=use_member_LENGTH
+ local value=1
+ local old_section=wan_only
+ CONFIG_SECTION=wan_only
+ option use_member_LENGTH 1
+ local varname=use_member_LENGTH
+ shift
+ local value=1
+ export -n CONFIG_wan_only_use_member_LENGTH=1
+ [ -n ]
+ option_cb use_member_LENGTH 1
+ return 0
+ CONFIG_SECTION=wan_only
+ append CONFIG_wan_only_use_member wan_link
+ local var=CONFIG_wan_only_use_member
+ local value=wan_link
+ local sep=
+ eval export -n -- "CONFIG_wan_only_use_member=${CONFIG_wan_only_use_member:+${CONFIG_wan_only_use_member}${value:+$sep}}$value"
+ export -n -- CONFIG_wan_only_use_member=wan_link
+ list_cb use_member wan_link
+ return 0
+ config policy vpn_only
+ local cfgtype=policy
+ local name=vpn_only
+ export -n CONFIG_NUM_SECTIONS=9
+ name=vpn_only
+ append CONFIG_SECTIONS vpn_only
+ local var=CONFIG_SECTIONS
+ local value=vpn_only
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests wan sevpn wan_link vpn_link wan_only vpn_only
+ [ -n ]
+ config_cb policy vpn_only
+ return 0
+ export -n CONFIG_SECTION=vpn_only
+ export -n CONFIG_vpn_only_TYPE=policy
+ list use_member vpn_link
+ local varname=use_member
+ shift
+ local value=vpn_link
+ local len
+ config_get len vpn_only use_member_LENGTH 0
+ eval export -n -- len=${CONFIG_vpn_only_use_member_LENGTH:-${4}}
+ export -n -- len=0
+ [ 0 = 0 ]
+ append CONFIG_LIST_STATE vpn_only_use_member
+ local var=CONFIG_LIST_STATE
+ local value=vpn_only_use_member
+ local sep=
+ eval export -n -- "CONFIG_LIST_STATE=${CONFIG_LIST_STATE:+${CONFIG_LIST_STATE}${value:+$sep}}$value"
+ export -n -- CONFIG_LIST_STATE=wan_only_use_member vpn_only_use_member
+ len=1
+ config_set vpn_only use_member_ITEM1 vpn_link
+ local section=vpn_only
+ local option=use_member_ITEM1
+ local value=vpn_link
+ local old_section=vpn_only
+ CONFIG_SECTION=vpn_only
+ option use_member_ITEM1 vpn_link
+ local varname=use_member_ITEM1
+ shift
+ local value=vpn_link
+ export -n CONFIG_vpn_only_use_member_ITEM1=vpn_link
+ [ -n ]
+ option_cb use_member_ITEM1 vpn_link
+ return 0
+ CONFIG_SECTION=vpn_only
+ config_set vpn_only use_member_LENGTH 1
+ local section=vpn_only
+ local option=use_member_LENGTH
+ local value=1
+ local old_section=vpn_only
+ CONFIG_SECTION=vpn_only
+ option use_member_LENGTH 1
+ local varname=use_member_LENGTH
+ shift
+ local value=1
+ export -n CONFIG_vpn_only_use_member_LENGTH=1
+ [ -n ]
+ option_cb use_member_LENGTH 1
+ return 0
+ CONFIG_SECTION=vpn_only
+ append CONFIG_vpn_only_use_member vpn_link
+ local var=CONFIG_vpn_only_use_member
+ local value=vpn_link
+ local sep=
+ eval export -n -- "CONFIG_vpn_only_use_member=${CONFIG_vpn_only_use_member:+${CONFIG_vpn_only_use_member}${value:+$sep}}$value"
+ export -n -- CONFIG_vpn_only_use_member=vpn_link
+ list_cb use_member vpn_link
+ return 0
+ unset DATA
+ config_cb
+ return 0
+ return 0
+ config_get enabled wan enabled 0
+ eval export -n -- enabled=${CONFIG_wan_enabled:-${4}}
+ export -n -- enabled=1
+ counter=0
+ [ ifup == ifup ]
+ [ 1 -eq 1 ]
+ ip -4 route list dev eth0.2 default
+ head -1
+ [ -z default via 92.42.31.1 proto static metric 20 -a 0 -lt 10 ]
+ mwan3_get_route_args
+ head -1
+ sed /.*via \([^ ]*\) .*$/!d;s//\1/;q
+ egrep [0-9]{1,3}(\.[0-9]{1,3}){3}
+ ip -4 route list dev eth0.2 default
+ route_args=92.42.31.1
+ [ -n 92.42.31.1 ]
+ route_args=via 92.42.31.1
+ route_args=nexthop via 92.42.31.1 dev eth0.2
+ pgrep -f -o hotplug-call
+ [ 14930 -ne 14930 -a 0 -lt 60 ]
+ config_foreach mwan3_get_iface_id interface
+ local ___function=mwan3_get_iface_id
+ [ 2 -ge 1 ]
+ shift
+ local ___type=interface
+ [ 1 -ge 1 ]
+ shift
+ local section cfgtype
+ [ -z server lan_subnet guests wan sevpn wan_link vpn_link wan_only vpn_only ]
+ config_get cfgtype server TYPE
+ eval export -n -- cfgtype=${CONFIG_server_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype lan_subnet TYPE
+ eval export -n -- cfgtype=${CONFIG_lan_subnet_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype guests TYPE
+ eval export -n -- cfgtype=${CONFIG_guests_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype wan TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n interface -a xinterface != xinterface ]
+ eval mwan3_get_iface_id "$section" "$@"
+ mwan3_get_iface_id wan
+ let iface_count++
+ [ wan == wan ]
+ iface_id=1
+ config_get cfgtype sevpn TYPE
+ eval export -n -- cfgtype=${CONFIG_sevpn_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n interface -a xinterface != xinterface ]
+ eval mwan3_get_iface_id "$section" "$@"
+ mwan3_get_iface_id sevpn
+ let iface_count++
+ [ sevpn == wan ]
+ config_get cfgtype wan_link TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n interface -a xmember != xinterface ]
+ continue
+ config_get cfgtype vpn_link TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n interface -a xmember != xinterface ]
+ continue
+ config_get cfgtype wan_only TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n interface -a xpolicy != xinterface ]
+ continue
+ config_get cfgtype vpn_only TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n interface -a xpolicy != xinterface ]
+ continue
+ [ -n 1 ]
+ [ 2 -le 250 ]
+ unset iface_count
+ unset counter
+ logger -t mwan3 -p notice ifup interface wan (eth0.2)
+ mwan3_set_general_iptables
+ iptables -S mwan3_ifaces -t mangle
+ iptables -N mwan3_ifaces -t mangle
+ iptables -S mwan3_rules -t mangle
+ iptables -N mwan3_rules -t mangle
+ iptables -S mwan3_connected -t mangle
+ iptables -N mwan3_connected -t mangle
+ iptables -S mwan3_hook -t mangle
+ iptables -N mwan3_hook -t mangle
+ iptables -A mwan3_hook -t mangle -j CONNMARK --restore-mark --nfmask 0xff00 --ctmask 0xff00
+ iptables -A mwan3_hook -t mangle -m mark --mark 0x0/0xff00 -j mwan3_ifaces
+ iptables -A mwan3_hook -t mangle -m mark --mark 0x0/0xff00 -j mwan3_rules
+ iptables -A mwan3_hook -t mangle -j CONNMARK --save-mark --nfmask 0xff00 --ctmask 0xff00
+ iptables -A mwan3_hook -t mangle -j mwan3_connected
+ iptables -S mwan3_output_hook -t mangle
+ iptables -N mwan3_output_hook -t mangle
+ grep mwan3_hook
+ iptables -S PREROUTING -t mangle
+ iptables -A PREROUTING -t mangle -j mwan3_hook
+ grep mwan3_hook
+ iptables -S OUTPUT -t mangle
+ iptables -A OUTPUT -t mangle -j mwan3_hook
+ grep mwan3_output_hook
+ iptables -S OUTPUT -t mangle
+ iptables -A OUTPUT -t mangle -j mwan3_output_hook
+ iptables -F mwan3_rules -t mangle
+ mwan3_set_iface_iptables
+ local local_net local_nets
+ awk {print $1}
+ egrep [0-9]{1,3}(\.[0-9]{1,3}){3}
+ ip -4 route list dev eth0.2 scope link
+ local_net=31.220.43.152
92.42.31.0/24
93.95.98.176
95.215.45.33
+ iptables -S mwan3_iface_wan -t mangle
+ iptables -N mwan3_iface_wan -t mangle
+ iptables -F mwan3_iface_wan -t mangle
+ iptables -D mwan3_ifaces -t mangle -i eth0.2 -m mark --mark 0x0/0xff00 -j mwan3_iface_wan
+ [ ifup == ifup ]
+ [ -n 31.220.43.152
92.42.31.0/24
93.95.98.176
95.215.45.33 ]
+ [ ifup == ifup ]
+ iptables -I mwan3_iface_wan -t mangle -s 31.220.43.152 92.42.31.0/24 93.95.98.176 95.215.45.33 -m mark --mark 0x0/0xff00 -m comment --comment wan -j MARK --set-xmark 0xff00/0xff00
Bad argument `92.42.31.0/24'
Try `iptables -h' or 'iptables --help' for more information.
+ [ ifup == ifup ]
+ iptables -I mwan3_iface_wan -t mangle -s 31.220.43.152 92.42.31.0/24 93.95.98.176 95.215.45.33 -m mark --mark 0x0/0xff00 -m comment --comment wan -j MARK --set-xmark 0xff00/0xff00
Bad argument `92.42.31.0/24'
Try `iptables -h' or 'iptables --help' for more information.
+ [ ifup == ifup ]
+ iptables -I mwan3_iface_wan -t mangle -s 31.220.43.152 92.42.31.0/24 93.95.98.176 95.215.45.33 -m mark --mark 0x0/0xff00 -m comment --comment wan -j MARK --set-xmark 0xff00/0xff00
Bad argument `92.42.31.0/24'
Try `iptables -h' or 'iptables --help' for more information.
+ [ ifup == ifup ]
+ iptables -I mwan3_iface_wan -t mangle -s 31.220.43.152 92.42.31.0/24 93.95.98.176 95.215.45.33 -m mark --mark 0x0/0xff00 -m comment --comment wan -j MARK --set-xmark 0xff00/0xff00
Bad argument `92.42.31.0/24'
Try `iptables -h' or 'iptables --help' for more information.
+ iptables -A mwan3_iface_wan -t mangle -m mark --mark 0x0/0xff00 -m comment --comment wan -j MARK --set-xmark 256/0xff00
+ iptables -A mwan3_ifaces -t mangle -i eth0.2 -m mark --mark 0x0/0xff00 -j mwan3_iface_wan
+ [ ifup == ifdown ]
+ mwan3_set_iface_route
+ ip -4 route flush table 1
+ [ ifup == ifup ]
+ ip -4 route add table 1 default nexthop via 92.42.31.1 dev eth0.2
+ mwan3_set_iface_rules
+ awk $1 == "1001:"
+ ip -4 rule list
+ [ -n ]
+ ip -4 rule list
+ awk $1 == "2001:"
+ [ -n ]
+ ip -4 rule list
+ awk $1 == "2254:"
+ [ -n ]
+ [ ifup == ifup ]
+ ip -4 rule add pref 1001 iif eth0.2 lookup main
+ [ ifup == ifup ]
+ ip -4 rule add pref 2001 fwmark 256/0xff00 lookup 1
+ ip rule add pref 2254 fwmark 0xfe00/0xff00 unreachable
+ [ ifup == ifup ]
+ mwan3_track
+ local track_ip track_ips reliability count timeout interval down up
+ config_list_foreach wan track_ip mwan3_list_track_ips
+ [ 3 -ge 3 ]
+ local section=wan
+ shift
+ local option=track_ip
+ shift
+ local function=mwan3_list_track_ips
+ shift
+ local val
+ local len
+ local c=1
+ config_get len wan track_ip_LENGTH
+ eval export -n -- len=${CONFIG_wan_track_ip_LENGTH:-${4}}
+ export -n -- len=
+ [ -z ]
+ return 0
+ [ -n ]
+ iptables -D mwan3_output_hook -t mangle -p icmp -m icmp --icmp-type 8 -m length --length 32 -j mwan3_track_wan
+ iptables -F mwan3_track_wan -t mangle
+ iptables -X mwan3_track_wan -t mangle
+ config_foreach mwan3_set_policies_iptables policy
+ local ___function=mwan3_set_policies_iptables
+ [ 2 -ge 1 ]
+ shift
+ local ___type=policy
+ [ 1 -ge 1 ]
+ shift
+ local section cfgtype
+ [ -z server lan_subnet guests wan sevpn wan_link vpn_link wan_only vpn_only ]
+ config_get cfgtype server TYPE
+ eval export -n -- cfgtype=${CONFIG_server_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n policy -a xrule != xpolicy ]
+ continue
+ config_get cfgtype lan_subnet TYPE
+ eval export -n -- cfgtype=${CONFIG_lan_subnet_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n policy -a xrule != xpolicy ]
+ continue
+ config_get cfgtype guests TYPE
+ eval export -n -- cfgtype=${CONFIG_guests_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n policy -a xrule != xpolicy ]
+ continue
+ config_get cfgtype wan TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n policy -a xinterface != xpolicy ]
+ continue
+ config_get cfgtype sevpn TYPE
+ eval export -n -- cfgtype=${CONFIG_sevpn_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n policy -a xinterface != xpolicy ]
+ continue
+ config_get cfgtype wan_link TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n policy -a xmember != xpolicy ]
+ continue
+ config_get cfgtype vpn_link TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n policy -a xmember != xpolicy ]
+ continue
+ config_get cfgtype wan_only TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n policy -a xpolicy != xpolicy ]
+ eval mwan3_set_policies_iptables "$section" "$@"
+ mwan3_set_policies_iptables wan_only
+ local lowest_metric policy total_weight
+ policy=wan_only
+ echo wan_only
+ cut -c1-15
+ [ wan_only != wan_only ]
+ iptables -S mwan3_policy_wan_only -t mangle
+ iptables -N mwan3_policy_wan_only -t mangle
+ iptables -F mwan3_policy_wan_only -t mangle
+ iptables -A mwan3_policy_wan_only -t mangle -m mark --mark 0x0/0xff00 -m comment --comment unreachable -j MARK --set-xmark 0xfe00/0xff00
+ lowest_metric=256
+ total_weight=0
+ config_list_foreach wan_only use_member mwan3_set_policy
+ [ 3 -ge 3 ]
+ local section=wan_only
+ shift
+ local option=use_member
+ shift
+ local function=mwan3_set_policy
+ shift
+ local val
+ local len
+ local c=1
+ config_get len wan_only use_member_LENGTH
+ eval export -n -- len=${CONFIG_wan_only_use_member_LENGTH:-${4}}
+ export -n -- len=1
+ [ -z 1 ]
+ [ 1 -le 1 ]
+ config_get val wan_only use_member_ITEM1
+ eval export -n -- val=${CONFIG_wan_only_use_member_ITEM1:-${4}}
+ export -n -- val=wan_link
+ eval mwan3_set_policy "$val" "$@"
+ mwan3_set_policy wan_link
+ local iface_count iface_id metric probability weight
+ config_get INTERFACE wan_link interface
+ eval export -n -- INTERFACE=${CONFIG_wan_link_interface:-${4}}
+ export -n -- INTERFACE=wan
+ config_get metric wan_link metric 1
+ eval export -n -- metric=${CONFIG_wan_link_metric:-${4}}
+ export -n -- metric=20
+ config_get weight wan_link weight 1
+ eval export -n -- weight=${CONFIG_wan_link_weight:-${4}}
+ export -n -- weight=20
+ [ -n wan ]
+ config_foreach mwan3_get_iface_id interface
+ local ___function=mwan3_get_iface_id
+ [ 2 -ge 1 ]
+ shift
+ local ___type=interface
+ [ 1 -ge 1 ]
+ shift
+ local section cfgtype
+ [ -z server lan_subnet guests wan sevpn wan_link vpn_link wan_only vpn_only ]
+ config_get cfgtype server TYPE
+ eval export -n -- cfgtype=${CONFIG_server_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype lan_subnet TYPE
+ eval export -n -- cfgtype=${CONFIG_lan_subnet_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype guests TYPE
+ eval export -n -- cfgtype=${CONFIG_guests_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype wan TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n interface -a xinterface != xinterface ]
+ eval mwan3_get_iface_id "$section" "$@"
+ mwan3_get_iface_id wan
+ let iface_count++
+ [ wan == wan ]
+ iface_id=1
+ config_get cfgtype sevpn TYPE
+ eval export -n -- cfgtype=${CONFIG_sevpn_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n interface -a xinterface != xinterface ]
+ eval mwan3_get_iface_id "$section" "$@"
+ mwan3_get_iface_id sevpn
+ let iface_count++
+ [ sevpn == wan ]
+ config_get cfgtype wan_link TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n interface -a xmember != xinterface ]
+ continue
+ config_get cfgtype vpn_link TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n interface -a xmember != xinterface ]
+ continue
+ config_get cfgtype wan_only TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n interface -a xpolicy != xinterface ]
+ continue
+ config_get cfgtype vpn_only TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n interface -a xpolicy != xinterface ]
+ continue
+ [ -n 1 ]
+ iptables -S mwan3_iface_wan -t mangle
+ [ 20 -lt 256 ]
+ total_weight=20
+ iptables -F mwan3_policy_wan_only -t mangle
+ iptables -A mwan3_policy_wan_only -t mangle -m mark --mark 0x0/0xff00 -m comment --comment wan 20 20 -j MARK --set-xmark 256/0xff00
+ lowest_metric=20
+ c=2
+ [ 2 -le 1 ]
+ config_get cfgtype vpn_only TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n policy -a xpolicy != xpolicy ]
+ eval mwan3_set_policies_iptables "$section" "$@"
+ mwan3_set_policies_iptables vpn_only
+ local lowest_metric policy total_weight
+ policy=vpn_only
+ cut -c1-15
+ echo vpn_only
+ [ vpn_only != vpn_only ]
+ iptables -S mwan3_policy_vpn_only -t mangle
+ iptables -N mwan3_policy_vpn_only -t mangle
+ iptables -F mwan3_policy_vpn_only -t mangle
+ iptables -A mwan3_policy_vpn_only -t mangle -m mark --mark 0x0/0xff00 -m comment --comment unreachable -j MARK --set-xmark 0xfe00/0xff00
+ lowest_metric=256
+ total_weight=0
+ config_list_foreach vpn_only use_member mwan3_set_policy
+ [ 3 -ge 3 ]
+ local section=vpn_only
+ shift
+ local option=use_member
+ shift
+ local function=mwan3_set_policy
+ shift
+ local val
+ local len
+ local c=1
+ config_get len vpn_only use_member_LENGTH
+ eval export -n -- len=${CONFIG_vpn_only_use_member_LENGTH:-${4}}
+ export -n -- len=1
+ [ -z 1 ]
+ [ 1 -le 1 ]
+ config_get val vpn_only use_member_ITEM1
+ eval export -n -- val=${CONFIG_vpn_only_use_member_ITEM1:-${4}}
+ export -n -- val=vpn_link
+ eval mwan3_set_policy "$val" "$@"
+ mwan3_set_policy vpn_link
+ local iface_count iface_id metric probability weight
+ config_get INTERFACE vpn_link interface
+ eval export -n -- INTERFACE=${CONFIG_vpn_link_interface:-${4}}
+ export -n -- INTERFACE=sevpn
+ config_get metric vpn_link metric 1
+ eval export -n -- metric=${CONFIG_vpn_link_metric:-${4}}
+ export -n -- metric=50
+ config_get weight vpn_link weight 1
+ eval export -n -- weight=${CONFIG_vpn_link_weight:-${4}}
+ export -n -- weight=50
+ [ -n sevpn ]
+ config_foreach mwan3_get_iface_id interface
+ local ___function=mwan3_get_iface_id
+ [ 2 -ge 1 ]
+ shift
+ local ___type=interface
+ [ 1 -ge 1 ]
+ shift
+ local section cfgtype
+ [ -z server lan_subnet guests wan sevpn wan_link vpn_link wan_only vpn_only ]
+ config_get cfgtype server TYPE
+ eval export -n -- cfgtype=${CONFIG_server_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype lan_subnet TYPE
+ eval export -n -- cfgtype=${CONFIG_lan_subnet_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype guests TYPE
+ eval export -n -- cfgtype=${CONFIG_guests_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype wan TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n interface -a xinterface != xinterface ]
+ eval mwan3_get_iface_id "$section" "$@"
+ mwan3_get_iface_id wan
+ let iface_count++
+ [ wan == sevpn ]
+ config_get cfgtype sevpn TYPE
+ eval export -n -- cfgtype=${CONFIG_sevpn_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n interface -a xinterface != xinterface ]
+ eval mwan3_get_iface_id "$section" "$@"
+ mwan3_get_iface_id sevpn
+ let iface_count++
+ [ sevpn == sevpn ]
+ iface_id=2
+ config_get cfgtype wan_link TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n interface -a xmember != xinterface ]
+ continue
+ config_get cfgtype vpn_link TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n interface -a xmember != xinterface ]
+ continue
+ config_get cfgtype wan_only TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n interface -a xpolicy != xinterface ]
+ continue
+ config_get cfgtype vpn_only TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n interface -a xpolicy != xinterface ]
+ continue
+ [ -n 2 ]
+ iptables -S mwan3_iface_sevpn -t mangle
+ c=2
+ [ 2 -le 1 ]
+ config_foreach mwan3_set_user_rules_iptables rule
+ local ___function=mwan3_set_user_rules_iptables
+ [ 2 -ge 1 ]
+ shift
+ local ___type=rule
+ [ 1 -ge 1 ]
+ shift
+ local section cfgtype
+ [ -z server lan_subnet guests wan sevpn wan_link vpn_link wan_only vpn_only ]
+ config_get cfgtype server TYPE
+ eval export -n -- cfgtype=${CONFIG_server_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n rule -a xrule != xrule ]
+ eval mwan3_set_user_rules_iptables "$section" "$@"
+ mwan3_set_user_rules_iptables server
+ local proto src_ip src_port dest_ip dest_port use_policy
+ config_get proto server proto all
+ eval export -n -- proto=${CONFIG_server_proto:-${4}}
+ export -n -- proto=all
+ config_get src_ip server src_ip 0.0.0.0/0
+ eval export -n -- src_ip=${CONFIG_server_src_ip:-${4}}
+ export -n -- src_ip=192.168.5.10
+ config_get src_port server src_port 0:65535
+ eval export -n -- src_port=${CONFIG_server_src_port:-${4}}
+ export -n -- src_port=0:65535
+ config_get dest_ip server dest_ip 0.0.0.0/0
+ eval export -n -- dest_ip=${CONFIG_server_dest_ip:-${4}}
+ export -n -- dest_ip=0.0.0.0/0
+ config_get dest_port server dest_port 0:65535
+ eval export -n -- dest_port=${CONFIG_server_dest_port:-${4}}
+ export -n -- dest_port=0:65535
+ config_get use_policy server use_policy
+ eval export -n -- use_policy=${CONFIG_server_use_policy:-${4}}
+ export -n -- use_policy=wan_only
+ [ -n wan_only ]
+ [ wan_only == default ]
+ [ wan_only == unreachable ]
+ use_policy=mwan3_policy_wan_only
+ iptables -A mwan3_rules -t mangle -p all -s 192.168.5.10 -d 0.0.0.0/0 -m mark --mark 0/0xff00 -m comment --comment server -j mwan3_policy_wan_only
+ config_get cfgtype lan_subnet TYPE
+ eval export -n -- cfgtype=${CONFIG_lan_subnet_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n rule -a xrule != xrule ]
+ eval mwan3_set_user_rules_iptables "$section" "$@"
+ mwan3_set_user_rules_iptables lan_subnet
+ local proto src_ip src_port dest_ip dest_port use_policy
+ config_get proto lan_subnet proto all
+ eval export -n -- proto=${CONFIG_lan_subnet_proto:-${4}}
+ export -n -- proto=all
+ config_get src_ip lan_subnet src_ip 0.0.0.0/0
+ eval export -n -- src_ip=${CONFIG_lan_subnet_src_ip:-${4}}
+ export -n -- src_ip=192.168.5.0/24
+ config_get src_port lan_subnet src_port 0:65535
+ eval export -n -- src_port=${CONFIG_lan_subnet_src_port:-${4}}
+ export -n -- src_port=0:65535
+ config_get dest_ip lan_subnet dest_ip 0.0.0.0/0
+ eval export -n -- dest_ip=${CONFIG_lan_subnet_dest_ip:-${4}}
+ export -n -- dest_ip=0.0.0.0/0
+ config_get dest_port lan_subnet dest_port 0:65535
+ eval export -n -- dest_port=${CONFIG_lan_subnet_dest_port:-${4}}
+ export -n -- dest_port=0:65535
+ config_get use_policy lan_subnet use_policy
+ eval export -n -- use_policy=${CONFIG_lan_subnet_use_policy:-${4}}
+ export -n -- use_policy=vpn_only
+ [ -n vpn_only ]
+ [ vpn_only == default ]
+ [ vpn_only == unreachable ]
+ use_policy=mwan3_policy_vpn_only
+ iptables -A mwan3_rules -t mangle -p all -s 192.168.5.0/24 -d 0.0.0.0/0 -m mark --mark 0/0xff00 -m comment --comment lan_subnet -j mwan3_policy_vpn_only
+ config_get cfgtype guests TYPE
+ eval export -n -- cfgtype=${CONFIG_guests_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n rule -a xrule != xrule ]
+ eval mwan3_set_user_rules_iptables "$section" "$@"
+ mwan3_set_user_rules_iptables guests
+ local proto src_ip src_port dest_ip dest_port use_policy
+ config_get proto guests proto all
+ eval export -n -- proto=${CONFIG_guests_proto:-${4}}
+ export -n -- proto=all
+ config_get src_ip guests src_ip 0.0.0.0/0
+ eval export -n -- src_ip=${CONFIG_guests_src_ip:-${4}}
+ export -n -- src_ip=192.168.6.0/24
+ config_get src_port guests src_port 0:65535
+ eval export -n -- src_port=${CONFIG_guests_src_port:-${4}}
+ export -n -- src_port=0:65535
+ config_get dest_ip guests dest_ip 0.0.0.0/0
+ eval export -n -- dest_ip=${CONFIG_guests_dest_ip:-${4}}
+ export -n -- dest_ip=0.0.0.0/0
+ config_get dest_port guests dest_port 0:65535
+ eval export -n -- dest_port=${CONFIG_guests_dest_port:-${4}}
+ export -n -- dest_port=0:65535
+ config_get use_policy guests use_policy
+ eval export -n -- use_policy=${CONFIG_guests_use_policy:-${4}}
+ export -n -- use_policy=wan_only
+ [ -n wan_only ]
+ [ wan_only == default ]
+ [ wan_only == unreachable ]
+ use_policy=mwan3_policy_wan_only
+ iptables -A mwan3_rules -t mangle -p all -s 192.168.6.0/24 -d 0.0.0.0/0 -m mark --mark 0/0xff00 -m comment --comment guests -j mwan3_policy_wan_only
+ config_get cfgtype wan TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n rule -a xinterface != xrule ]
+ continue
+ config_get cfgtype sevpn TYPE
+ eval export -n -- cfgtype=${CONFIG_sevpn_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n rule -a xinterface != xrule ]
+ continue
+ config_get cfgtype wan_link TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n rule -a xmember != xrule ]
+ continue
+ config_get cfgtype vpn_link TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n rule -a xmember != xrule ]
+ continue
+ config_get cfgtype wan_only TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n rule -a xpolicy != xrule ]
+ continue
+ config_get cfgtype vpn_only TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n rule -a xpolicy != xrule ]
+ continue
+ mwan3_set_connected_iptables
+ local connected_networks
+ iptables -S mwan3_connected -t mangle
+ iptables -F mwan3_connected -t mangle
+ awk {print $1}
+ egrep [0-9]{1,3}(\.[0-9]{1,3}){3}
+ ip -4 route
+ iptables -A mwan3_connected -t mangle -d 31.220.43.152 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 92.42.31.0/24 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 93.95.98.176 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 95.215.45.33 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 192.168.5.0/24 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 192.168.6.0/24 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 192.168.99.98 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 192.168.200.0/25 -j MARK --set-xmark 0xff00/0xff00
+ iptables -I mwan3_connected -t mangle -d 224.0.0.0/3 -j MARK --set-xmark 0xff00/0xff00
+ iptables -I mwan3_connected -t mangle -d 127.0.0.0/8 -j MARK --set-xmark 0xff00/0xff00
+ mwan3_ifupdown
+ local counter enabled iface_count iface_id route_args wan_metric
+ [ -n tun0 ]
+ [ -n sevpn ]
+ uci get -P /var/state mwan3.sevpn
+ [ interface == interface ]
+ config_load mwan3
+ [ -n ]
+ uci_load mwan3
+ local PACKAGE=mwan3
+ local DATA
+ local RET
+ local VAR
+ _C=0
+ [ -z ]
+ export -n CONFIG_LIST_STATE=
+ export -n CONFIG_SECTIONS=
+ export -n CONFIG_NUM_SECTIONS=0
+ export -n CONFIG_SECTION=
+ /sbin/uci -P /var/state -S -n export mwan3
+ DATA=package mwan3
config rule 'server'
option src_ip '192.168.5.10'
option proto 'all'
option use_policy 'wan_only'
config rule 'lan_subnet'
option src_ip '192.168.5.0/24'
option proto 'all'
option use_policy 'vpn_only'
config rule 'guests'
option src_ip '192.168.6.0/24'
option proto 'all'
option use_policy 'wan_only'
config interface 'wan'
option enabled '1'
option reliability '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '3'
config interface 'sevpn'
option enabled '1'
option reliability '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '3'
config member 'wan_link'
option interface 'wan'
option metric '20'
option weight '20'
config member 'vpn_link'
option interface 'sevpn'
option metric '50'
option weight '50'
config policy 'wan_only'
list use_member 'wan_link'
config policy 'vpn_only'
list use_member 'vpn_link'
+ RET=0
+ [ 0 != 0 -o -z package mwan3
config rule 'server'
option src_ip '192.168.5.10'
option proto 'all'
option use_policy 'wan_only'
config rule 'lan_subnet'
option src_ip '192.168.5.0/24'
option proto 'all'
option use_policy 'vpn_only'
config rule 'guests'
option src_ip '192.168.6.0/24'
option proto 'all'
option use_policy 'wan_only'
config interface 'wan'
option enabled '1'
option reliability '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '3'
config interface 'sevpn'
option enabled '1'
option reliability '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '3'
config member 'wan_link'
option interface 'wan'
option metric '20'
option weight '20'
config member 'vpn_link'
option interface 'sevpn'
option metric '50'
option weight '50'
config policy 'wan_only'
list use_member 'wan_link'
config policy 'vpn_only'
list use_member 'vpn_link' ]
+ eval package mwan3
config rule 'server'
option src_ip '192.168.5.10'
option proto 'all'
option use_policy 'wan_only'
config rule 'lan_subnet'
option src_ip '192.168.5.0/24'
option proto 'all'
option use_policy 'vpn_only'
config rule 'guests'
option src_ip '192.168.6.0/24'
option proto 'all'
option use_policy 'wan_only'
config interface 'wan'
option enabled '1'
option reliability '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '3'
config interface 'sevpn'
option enabled '1'
option reliability '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '3'
config member 'wan_link'
option interface 'wan'
option metric '20'
option weight '20'
config member 'vpn_link'
option interface 'sevpn'
option metric '50'
option weight '50'
config policy 'wan_only'
list use_member 'wan_link'
config policy 'vpn_only'
list use_member 'vpn_link'
+ package mwan3
+ return 0
+ config rule server
+ local cfgtype=rule
+ local name=server
+ export -n CONFIG_NUM_SECTIONS=1
+ name=server
+ append CONFIG_SECTIONS server
+ local var=CONFIG_SECTIONS
+ local value=server
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server
+ [ -n ]
+ config_cb rule server
+ return 0
+ export -n CONFIG_SECTION=server
+ export -n CONFIG_server_TYPE=rule
+ option src_ip 192.168.5.10
+ local varname=src_ip
+ shift
+ local value=192.168.5.10
+ export -n CONFIG_server_src_ip=192.168.5.10
+ [ -n ]
+ option_cb src_ip 192.168.5.10
+ return 0
+ option proto all
+ local varname=proto
+ shift
+ local value=all
+ export -n CONFIG_server_proto=all
+ [ -n ]
+ option_cb proto all
+ return 0
+ option use_policy wan_only
+ local varname=use_policy
+ shift
+ local value=wan_only
+ export -n CONFIG_server_use_policy=wan_only
+ [ -n ]
+ option_cb use_policy wan_only
+ return 0
+ config rule lan_subnet
+ local cfgtype=rule
+ local name=lan_subnet
+ export -n CONFIG_NUM_SECTIONS=2
+ name=lan_subnet
+ append CONFIG_SECTIONS lan_subnet
+ local var=CONFIG_SECTIONS
+ local value=lan_subnet
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet
+ [ -n ]
+ config_cb rule lan_subnet
+ return 0
+ export -n CONFIG_SECTION=lan_subnet
+ export -n CONFIG_lan_subnet_TYPE=rule
+ option src_ip 192.168.5.0/24
+ local varname=src_ip
+ shift
+ local value=192.168.5.0/24
+ export -n CONFIG_lan_subnet_src_ip=192.168.5.0/24
+ [ -n ]
+ option_cb src_ip 192.168.5.0/24
+ return 0
+ option proto all
+ local varname=proto
+ shift
+ local value=all
+ export -n CONFIG_lan_subnet_proto=all
+ [ -n ]
+ option_cb proto all
+ return 0
+ option use_policy vpn_only
+ local varname=use_policy
+ shift
+ local value=vpn_only
+ export -n CONFIG_lan_subnet_use_policy=vpn_only
+ [ -n ]
+ option_cb use_policy vpn_only
+ return 0
+ config rule guests
+ local cfgtype=rule
+ local name=guests
+ export -n CONFIG_NUM_SECTIONS=3
+ name=guests
+ append CONFIG_SECTIONS guests
+ local var=CONFIG_SECTIONS
+ local value=guests
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests
+ [ -n ]
+ config_cb rule guests
+ return 0
+ export -n CONFIG_SECTION=guests
+ export -n CONFIG_guests_TYPE=rule
+ option src_ip 192.168.6.0/24
+ local varname=src_ip
+ shift
+ local value=192.168.6.0/24
+ export -n CONFIG_guests_src_ip=192.168.6.0/24
+ [ -n ]
+ option_cb src_ip 192.168.6.0/24
+ return 0
+ option proto all
+ local varname=proto
+ shift
+ local value=all
+ export -n CONFIG_guests_proto=all
+ [ -n ]
+ option_cb proto all
+ return 0
+ option use_policy wan_only
+ local varname=use_policy
+ shift
+ local value=wan_only
+ export -n CONFIG_guests_use_policy=wan_only
+ [ -n ]
+ option_cb use_policy wan_only
+ return 0
+ config interface wan
+ local cfgtype=interface
+ local name=wan
+ export -n CONFIG_NUM_SECTIONS=4
+ name=wan
+ append CONFIG_SECTIONS wan
+ local var=CONFIG_SECTIONS
+ local value=wan
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests wan
+ [ -n ]
+ config_cb interface wan
+ return 0
+ export -n CONFIG_SECTION=wan
+ export -n CONFIG_wan_TYPE=interface
+ option enabled 1
+ local varname=enabled
+ shift
+ local value=1
+ export -n CONFIG_wan_enabled=1
+ [ -n ]
+ option_cb enabled 1
+ return 0
+ option reliability 1
+ local varname=reliability
+ shift
+ local value=1
+ export -n CONFIG_wan_reliability=1
+ [ -n ]
+ option_cb reliability 1
+ return 0
+ option count 1
+ local varname=count
+ shift
+ local value=1
+ export -n CONFIG_wan_count=1
+ [ -n ]
+ option_cb count 1
+ return 0
+ option timeout 2
+ local varname=timeout
+ shift
+ local value=2
+ export -n CONFIG_wan_timeout=2
+ [ -n ]
+ option_cb timeout 2
+ return 0
+ option interval 5
+ local varname=interval
+ shift
+ local value=5
+ export -n CONFIG_wan_interval=5
+ [ -n ]
+ option_cb interval 5
+ return 0
+ option down 3
+ local varname=down
+ shift
+ local value=3
+ export -n CONFIG_wan_down=3
+ [ -n ]
+ option_cb down 3
+ return 0
+ option up 3
+ local varname=up
+ shift
+ local value=3
+ export -n CONFIG_wan_up=3
+ [ -n ]
+ option_cb up 3
+ return 0
+ config interface sevpn
+ local cfgtype=interface
+ local name=sevpn
+ export -n CONFIG_NUM_SECTIONS=5
+ name=sevpn
+ append CONFIG_SECTIONS sevpn
+ local var=CONFIG_SECTIONS
+ local value=sevpn
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests wan sevpn
+ [ -n ]
+ config_cb interface sevpn
+ return 0
+ export -n CONFIG_SECTION=sevpn
+ export -n CONFIG_sevpn_TYPE=interface
+ option enabled 1
+ local varname=enabled
+ shift
+ local value=1
+ export -n CONFIG_sevpn_enabled=1
+ [ -n ]
+ option_cb enabled 1
+ return 0
+ option reliability 1
+ local varname=reliability
+ shift
+ local value=1
+ export -n CONFIG_sevpn_reliability=1
+ [ -n ]
+ option_cb reliability 1
+ return 0
+ option count 1
+ local varname=count
+ shift
+ local value=1
+ export -n CONFIG_sevpn_count=1
+ [ -n ]
+ option_cb count 1
+ return 0
+ option timeout 2
+ local varname=timeout
+ shift
+ local value=2
+ export -n CONFIG_sevpn_timeout=2
+ [ -n ]
+ option_cb timeout 2
+ return 0
+ option interval 5
+ local varname=interval
+ shift
+ local value=5
+ export -n CONFIG_sevpn_interval=5
+ [ -n ]
+ option_cb interval 5
+ return 0
+ option down 3
+ local varname=down
+ shift
+ local value=3
+ export -n CONFIG_sevpn_down=3
+ [ -n ]
+ option_cb down 3
+ return 0
+ option up 3
+ local varname=up
+ shift
+ local value=3
+ export -n CONFIG_sevpn_up=3
+ [ -n ]
+ option_cb up 3
+ return 0
+ config member wan_link
+ local cfgtype=member
+ local name=wan_link
+ export -n CONFIG_NUM_SECTIONS=6
+ name=wan_link
+ append CONFIG_SECTIONS wan_link
+ local var=CONFIG_SECTIONS
+ local value=wan_link
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests wan sevpn wan_link
+ [ -n ]
+ config_cb member wan_link
+ return 0
+ export -n CONFIG_SECTION=wan_link
+ export -n CONFIG_wan_link_TYPE=member
+ option interface wan
+ local varname=interface
+ shift
+ local value=wan
+ export -n CONFIG_wan_link_interface=wan
+ [ -n ]
+ option_cb interface wan
+ return 0
+ option metric 20
+ local varname=metric
+ shift
+ local value=20
+ export -n CONFIG_wan_link_metric=20
+ [ -n ]
+ option_cb metric 20
+ return 0
+ option weight 20
+ local varname=weight
+ shift
+ local value=20
+ export -n CONFIG_wan_link_weight=20
+ [ -n ]
+ option_cb weight 20
+ return 0
+ config member vpn_link
+ local cfgtype=member
+ local name=vpn_link
+ export -n CONFIG_NUM_SECTIONS=7
+ name=vpn_link
+ append CONFIG_SECTIONS vpn_link
+ local var=CONFIG_SECTIONS
+ local value=vpn_link
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests wan sevpn wan_link vpn_link
+ [ -n ]
+ config_cb member vpn_link
+ return 0
+ export -n CONFIG_SECTION=vpn_link
+ export -n CONFIG_vpn_link_TYPE=member
+ option interface sevpn
+ local varname=interface
+ shift
+ local value=sevpn
+ export -n CONFIG_vpn_link_interface=sevpn
+ [ -n ]
+ option_cb interface sevpn
+ return 0
+ option metric 50
+ local varname=metric
+ shift
+ local value=50
+ export -n CONFIG_vpn_link_metric=50
+ [ -n ]
+ option_cb metric 50
+ return 0
+ option weight 50
+ local varname=weight
+ shift
+ local value=50
+ export -n CONFIG_vpn_link_weight=50
+ [ -n ]
+ option_cb weight 50
+ return 0
+ config policy wan_only
+ local cfgtype=policy
+ local name=wan_only
+ export -n CONFIG_NUM_SECTIONS=8
+ name=wan_only
+ append CONFIG_SECTIONS wan_only
+ local var=CONFIG_SECTIONS
+ local value=wan_only
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests wan sevpn wan_link vpn_link wan_only
+ [ -n ]
+ config_cb policy wan_only
+ return 0
+ export -n CONFIG_SECTION=wan_only
+ export -n CONFIG_wan_only_TYPE=policy
+ list use_member wan_link
+ local varname=use_member
+ shift
+ local value=wan_link
+ local len
+ config_get len wan_only use_member_LENGTH 0
+ eval export -n -- len=${CONFIG_wan_only_use_member_LENGTH:-${4}}
+ export -n -- len=0
+ [ 0 = 0 ]
+ append CONFIG_LIST_STATE wan_only_use_member
+ local var=CONFIG_LIST_STATE
+ local value=wan_only_use_member
+ local sep=
+ eval export -n -- "CONFIG_LIST_STATE=${CONFIG_LIST_STATE:+${CONFIG_LIST_STATE}${value:+$sep}}$value"
+ export -n -- CONFIG_LIST_STATE=wan_only_use_member
+ len=1
+ config_set wan_only use_member_ITEM1 wan_link
+ local section=wan_only
+ local option=use_member_ITEM1
+ local value=wan_link
+ local old_section=wan_only
+ CONFIG_SECTION=wan_only
+ option use_member_ITEM1 wan_link
+ local varname=use_member_ITEM1
+ shift
+ local value=wan_link
+ export -n CONFIG_wan_only_use_member_ITEM1=wan_link
+ [ -n ]
+ option_cb use_member_ITEM1 wan_link
+ return 0
+ CONFIG_SECTION=wan_only
+ config_set wan_only use_member_LENGTH 1
+ local section=wan_only
+ local option=use_member_LENGTH
+ local value=1
+ local old_section=wan_only
+ CONFIG_SECTION=wan_only
+ option use_member_LENGTH 1
+ local varname=use_member_LENGTH
+ shift
+ local value=1
+ export -n CONFIG_wan_only_use_member_LENGTH=1
+ [ -n ]
+ option_cb use_member_LENGTH 1
+ return 0
+ CONFIG_SECTION=wan_only
+ append CONFIG_wan_only_use_member wan_link
+ local var=CONFIG_wan_only_use_member
+ local value=wan_link
+ local sep=
+ eval export -n -- "CONFIG_wan_only_use_member=${CONFIG_wan_only_use_member:+${CONFIG_wan_only_use_member}${value:+$sep}}$value"
+ export -n -- CONFIG_wan_only_use_member=wan_link
+ list_cb use_member wan_link
+ return 0
+ config policy vpn_only
+ local cfgtype=policy
+ local name=vpn_only
+ export -n CONFIG_NUM_SECTIONS=9
+ name=vpn_only
+ append CONFIG_SECTIONS vpn_only
+ local var=CONFIG_SECTIONS
+ local value=vpn_only
+ local sep=
+ eval export -n -- "CONFIG_SECTIONS=${CONFIG_SECTIONS:+${CONFIG_SECTIONS}${value:+$sep}}$value"
+ export -n -- CONFIG_SECTIONS=server lan_subnet guests wan sevpn wan_link vpn_link wan_only vpn_only
+ [ -n ]
+ config_cb policy vpn_only
+ return 0
+ export -n CONFIG_SECTION=vpn_only
+ export -n CONFIG_vpn_only_TYPE=policy
+ list use_member vpn_link
+ local varname=use_member
+ shift
+ local value=vpn_link
+ local len
+ config_get len vpn_only use_member_LENGTH 0
+ eval export -n -- len=${CONFIG_vpn_only_use_member_LENGTH:-${4}}
+ export -n -- len=0
+ [ 0 = 0 ]
+ append CONFIG_LIST_STATE vpn_only_use_member
+ local var=CONFIG_LIST_STATE
+ local value=vpn_only_use_member
+ local sep=
+ eval export -n -- "CONFIG_LIST_STATE=${CONFIG_LIST_STATE:+${CONFIG_LIST_STATE}${value:+$sep}}$value"
+ export -n -- CONFIG_LIST_STATE=wan_only_use_member vpn_only_use_member
+ len=1
+ config_set vpn_only use_member_ITEM1 vpn_link
+ local section=vpn_only
+ local option=use_member_ITEM1
+ local value=vpn_link
+ local old_section=vpn_only
+ CONFIG_SECTION=vpn_only
+ option use_member_ITEM1 vpn_link
+ local varname=use_member_ITEM1
+ shift
+ local value=vpn_link
+ export -n CONFIG_vpn_only_use_member_ITEM1=vpn_link
+ [ -n ]
+ option_cb use_member_ITEM1 vpn_link
+ return 0
+ CONFIG_SECTION=vpn_only
+ config_set vpn_only use_member_LENGTH 1
+ local section=vpn_only
+ local option=use_member_LENGTH
+ local value=1
+ local old_section=vpn_only
+ CONFIG_SECTION=vpn_only
+ option use_member_LENGTH 1
+ local varname=use_member_LENGTH
+ shift
+ local value=1
+ export -n CONFIG_vpn_only_use_member_LENGTH=1
+ [ -n ]
+ option_cb use_member_LENGTH 1
+ return 0
+ CONFIG_SECTION=vpn_only
+ append CONFIG_vpn_only_use_member vpn_link
+ local var=CONFIG_vpn_only_use_member
+ local value=vpn_link
+ local sep=
+ eval export -n -- "CONFIG_vpn_only_use_member=${CONFIG_vpn_only_use_member:+${CONFIG_vpn_only_use_member}${value:+$sep}}$value"
+ export -n -- CONFIG_vpn_only_use_member=vpn_link
+ list_cb use_member vpn_link
+ return 0
+ unset DATA
+ config_cb
+ return 0
+ return 0
+ config_get enabled sevpn enabled 0
+ eval export -n -- enabled=${CONFIG_sevpn_enabled:-${4}}
+ export -n -- enabled=1
+ counter=0
+ [ ifup == ifup ]
+ [ 1 -eq 1 ]
+ ip -4 route list dev tun0 default
+ head -1
+ [ -z default via 192.168.200.1 proto static metric 50 -a 0 -lt 10 ]
+ mwan3_get_route_args
+ ip -4 route list dev tun0 default
+ head -1
+ sed /.*via \([^ ]*\) .*$/!d;s//\1/;q
+ egrep [0-9]{1,3}(\.[0-9]{1,3}){3}
+ route_args=192.168.200.1
+ [ -n 192.168.200.1 ]
+ route_args=via 192.168.200.1
+ route_args=nexthop via 192.168.200.1 dev tun0
+ pgrep -f -o hotplug-call
+ [ 15115 -ne 15115 -a 0 -lt 60 ]
+ config_foreach mwan3_get_iface_id interface
+ local ___function=mwan3_get_iface_id
+ [ 2 -ge 1 ]
+ shift
+ local ___type=interface
+ [ 1 -ge 1 ]
+ shift
+ local section cfgtype
+ [ -z server lan_subnet guests wan sevpn wan_link vpn_link wan_only vpn_only ]
+ config_get cfgtype server TYPE
+ eval export -n -- cfgtype=${CONFIG_server_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype lan_subnet TYPE
+ eval export -n -- cfgtype=${CONFIG_lan_subnet_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype guests TYPE
+ eval export -n -- cfgtype=${CONFIG_guests_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype wan TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n interface -a xinterface != xinterface ]
+ eval mwan3_get_iface_id "$section" "$@"
+ mwan3_get_iface_id wan
+ let iface_count++
+ [ wan == sevpn ]
+ config_get cfgtype sevpn TYPE
+ eval export -n -- cfgtype=${CONFIG_sevpn_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n interface -a xinterface != xinterface ]
+ eval mwan3_get_iface_id "$section" "$@"
+ mwan3_get_iface_id sevpn
+ let iface_count++
+ [ sevpn == sevpn ]
+ iface_id=2
+ config_get cfgtype wan_link TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n interface -a xmember != xinterface ]
+ continue
+ config_get cfgtype vpn_link TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n interface -a xmember != xinterface ]
+ continue
+ config_get cfgtype wan_only TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n interface -a xpolicy != xinterface ]
+ continue
+ config_get cfgtype vpn_only TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n interface -a xpolicy != xinterface ]
+ continue
+ [ -n 2 ]
+ [ 2 -le 250 ]
+ unset iface_count
+ unset counter
+ logger -t mwan3 -p notice ifup interface sevpn (tun0)
+ mwan3_set_general_iptables
+ iptables -S mwan3_ifaces -t mangle
+ iptables -S mwan3_rules -t mangle
+ iptables -S mwan3_connected -t mangle
+ iptables -S mwan3_hook -t mangle
+ iptables -S mwan3_output_hook -t mangle
+ grep mwan3_hook
+ iptables -S PREROUTING -t mangle
+ grep mwan3_hook
+ iptables -S OUTPUT -t mangle
+ grep mwan3_output_hook
+ iptables -S OUTPUT -t mangle
+ iptables -F mwan3_rules -t mangle
+ mwan3_set_iface_iptables
+ local local_net local_nets
+ awk {print $1}
+ egrep [0-9]{1,3}(\.[0-9]{1,3}){3}
+ ip -4 route list dev tun0 scope link
+ local_net=192.168.99.98
192.168.200.0/25
+ iptables -S mwan3_iface_sevpn -t mangle
+ iptables -N mwan3_iface_sevpn -t mangle
+ iptables -F mwan3_iface_sevpn -t mangle
+ iptables -D mwan3_ifaces -t mangle -i tun0 -m mark --mark 0x0/0xff00 -j mwan3_iface_sevpn
+ [ ifup == ifup ]
+ [ -n 192.168.99.98
192.168.200.0/25 ]
+ [ ifup == ifup ]
+ iptables -I mwan3_iface_sevpn -t mangle -s 192.168.99.98 192.168.200.0/25 -m mark --mark 0x0/0xff00 -m comment --comment sevpn -j MARK --set-xmark 0xff00/0xff00
Bad argument `192.168.200.0/25'
Try `iptables -h' or 'iptables --help' for more information.
+ [ ifup == ifup ]
+ iptables -I mwan3_iface_sevpn -t mangle -s 192.168.99.98 192.168.200.0/25 -m mark --mark 0x0/0xff00 -m comment --comment sevpn -j MARK --set-xmark 0xff00/0xff00
Bad argument `192.168.200.0/25'
Try `iptables -h' or 'iptables --help' for more information.
+ iptables -A mwan3_iface_sevpn -t mangle -m mark --mark 0x0/0xff00 -m comment --comment sevpn -j MARK --set-xmark 512/0xff00
+ iptables -A mwan3_ifaces -t mangle -i tun0 -m mark --mark 0x0/0xff00 -j mwan3_iface_sevpn
+ [ ifup == ifdown ]
+ mwan3_set_iface_route
+ ip -4 route flush table 2
+ [ ifup == ifup ]
+ ip -4 route add table 2 default nexthop via 192.168.200.1 dev tun0
+ mwan3_set_iface_rules
+ awk $1 == "1002:"
+ ip -4 rule list
+ [ -n ]
+ ip -4 rule list
+ awk $1 == "2002:"
+ [ -n ]
+ ip -4 rule list
+ awk $1 == "2254:"
+ [ -n 2254: from all fwmark 0xfe00/0xff00 unreachable ]
+ ip -4 rule del pref 2254
+ awk $1 == "2254:"
+ ip -4 rule list
+ [ -n ]
+ [ ifup == ifup ]
+ ip -4 rule add pref 1002 iif tun0 lookup main
+ [ ifup == ifup ]
+ ip -4 rule add pref 2002 fwmark 512/0xff00 lookup 2
+ ip rule add pref 2254 fwmark 0xfe00/0xff00 unreachable
+ [ ifup == ifup ]
+ mwan3_track
+ local track_ip track_ips reliability count timeout interval down up
+ config_list_foreach sevpn track_ip mwan3_list_track_ips
+ [ 3 -ge 3 ]
+ local section=sevpn
+ shift
+ local option=track_ip
+ shift
+ local function=mwan3_list_track_ips
+ shift
+ local val
+ local len
+ local c=1
+ config_get len sevpn track_ip_LENGTH
+ eval export -n -- len=${CONFIG_sevpn_track_ip_LENGTH:-${4}}
+ export -n -- len=
+ [ -z ]
+ return 0
+ [ -n ]
+ iptables -D mwan3_output_hook -t mangle -p icmp -m icmp --icmp-type 8 -m length --length 32 -j mwan3_track_sevpn
+ iptables -F mwan3_track_sevpn -t mangle
+ iptables -X mwan3_track_sevpn -t mangle
+ config_foreach mwan3_set_policies_iptables policy
+ local ___function=mwan3_set_policies_iptables
+ [ 2 -ge 1 ]
+ shift
+ local ___type=policy
+ [ 1 -ge 1 ]
+ shift
+ local section cfgtype
+ [ -z server lan_subnet guests wan sevpn wan_link vpn_link wan_only vpn_only ]
+ config_get cfgtype server TYPE
+ eval export -n -- cfgtype=${CONFIG_server_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n policy -a xrule != xpolicy ]
+ continue
+ config_get cfgtype lan_subnet TYPE
+ eval export -n -- cfgtype=${CONFIG_lan_subnet_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n policy -a xrule != xpolicy ]
+ continue
+ config_get cfgtype guests TYPE
+ eval export -n -- cfgtype=${CONFIG_guests_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n policy -a xrule != xpolicy ]
+ continue
+ config_get cfgtype wan TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n policy -a xinterface != xpolicy ]
+ continue
+ config_get cfgtype sevpn TYPE
+ eval export -n -- cfgtype=${CONFIG_sevpn_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n policy -a xinterface != xpolicy ]
+ continue
+ config_get cfgtype wan_link TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n policy -a xmember != xpolicy ]
+ continue
+ config_get cfgtype vpn_link TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n policy -a xmember != xpolicy ]
+ continue
+ config_get cfgtype wan_only TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n policy -a xpolicy != xpolicy ]
+ eval mwan3_set_policies_iptables "$section" "$@"
+ mwan3_set_policies_iptables wan_only
+ local lowest_metric policy total_weight
+ policy=wan_only
+ echo wan_only
+ cut -c1-15
+ [ wan_only != wan_only ]
+ iptables -S mwan3_policy_wan_only -t mangle
+ iptables -F mwan3_policy_wan_only -t mangle
+ iptables -A mwan3_policy_wan_only -t mangle -m mark --mark 0x0/0xff00 -m comment --comment unreachable -j MARK --set-xmark 0xfe00/0xff00
+ lowest_metric=256
+ total_weight=0
+ config_list_foreach wan_only use_member mwan3_set_policy
+ [ 3 -ge 3 ]
+ local section=wan_only
+ shift
+ local option=use_member
+ shift
+ local function=mwan3_set_policy
+ shift
+ local val
+ local len
+ local c=1
+ config_get len wan_only use_member_LENGTH
+ eval export -n -- len=${CONFIG_wan_only_use_member_LENGTH:-${4}}
+ export -n -- len=1
+ [ -z 1 ]
+ [ 1 -le 1 ]
+ config_get val wan_only use_member_ITEM1
+ eval export -n -- val=${CONFIG_wan_only_use_member_ITEM1:-${4}}
+ export -n -- val=wan_link
+ eval mwan3_set_policy "$val" "$@"
+ mwan3_set_policy wan_link
+ local iface_count iface_id metric probability weight
+ config_get INTERFACE wan_link interface
+ eval export -n -- INTERFACE=${CONFIG_wan_link_interface:-${4}}
+ export -n -- INTERFACE=wan
+ config_get metric wan_link metric 1
+ eval export -n -- metric=${CONFIG_wan_link_metric:-${4}}
+ export -n -- metric=20
+ config_get weight wan_link weight 1
+ eval export -n -- weight=${CONFIG_wan_link_weight:-${4}}
+ export -n -- weight=20
+ [ -n wan ]
+ config_foreach mwan3_get_iface_id interface
+ local ___function=mwan3_get_iface_id
+ [ 2 -ge 1 ]
+ shift
+ local ___type=interface
+ [ 1 -ge 1 ]
+ shift
+ local section cfgtype
+ [ -z server lan_subnet guests wan sevpn wan_link vpn_link wan_only vpn_only ]
+ config_get cfgtype server TYPE
+ eval export -n -- cfgtype=${CONFIG_server_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype lan_subnet TYPE
+ eval export -n -- cfgtype=${CONFIG_lan_subnet_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype guests TYPE
+ eval export -n -- cfgtype=${CONFIG_guests_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype wan TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n interface -a xinterface != xinterface ]
+ eval mwan3_get_iface_id "$section" "$@"
+ mwan3_get_iface_id wan
+ let iface_count++
+ [ wan == wan ]
+ iface_id=1
+ config_get cfgtype sevpn TYPE
+ eval export -n -- cfgtype=${CONFIG_sevpn_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n interface -a xinterface != xinterface ]
+ eval mwan3_get_iface_id "$section" "$@"
+ mwan3_get_iface_id sevpn
+ let iface_count++
+ [ sevpn == wan ]
+ config_get cfgtype wan_link TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n interface -a xmember != xinterface ]
+ continue
+ config_get cfgtype vpn_link TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n interface -a xmember != xinterface ]
+ continue
+ config_get cfgtype wan_only TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n interface -a xpolicy != xinterface ]
+ continue
+ config_get cfgtype vpn_only TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n interface -a xpolicy != xinterface ]
+ continue
+ [ -n 1 ]
+ iptables -S mwan3_iface_wan -t mangle
+ [ 20 -lt 256 ]
+ total_weight=20
+ iptables -F mwan3_policy_wan_only -t mangle
+ iptables -A mwan3_policy_wan_only -t mangle -m mark --mark 0x0/0xff00 -m comment --comment wan 20 20 -j MARK --set-xmark 256/0xff00
+ lowest_metric=20
+ c=2
+ [ 2 -le 1 ]
+ config_get cfgtype vpn_only TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n policy -a xpolicy != xpolicy ]
+ eval mwan3_set_policies_iptables "$section" "$@"
+ mwan3_set_policies_iptables vpn_only
+ local lowest_metric policy total_weight
+ policy=vpn_only
+ echo vpn_only
+ cut -c1-15
+ [ vpn_only != vpn_only ]
+ iptables -S mwan3_policy_vpn_only -t mangle
+ iptables -F mwan3_policy_vpn_only -t mangle
+ iptables -A mwan3_policy_vpn_only -t mangle -m mark --mark 0x0/0xff00 -m comment --comment unreachable -j MARK --set-xmark 0xfe00/0xff00
+ lowest_metric=256
+ total_weight=0
+ config_list_foreach vpn_only use_member mwan3_set_policy
+ [ 3 -ge 3 ]
+ local section=vpn_only
+ shift
+ local option=use_member
+ shift
+ local function=mwan3_set_policy
+ shift
+ local val
+ local len
+ local c=1
+ config_get len vpn_only use_member_LENGTH
+ eval export -n -- len=${CONFIG_vpn_only_use_member_LENGTH:-${4}}
+ export -n -- len=1
+ [ -z 1 ]
+ [ 1 -le 1 ]
+ config_get val vpn_only use_member_ITEM1
+ eval export -n -- val=${CONFIG_vpn_only_use_member_ITEM1:-${4}}
+ export -n -- val=vpn_link
+ eval mwan3_set_policy "$val" "$@"
+ mwan3_set_policy vpn_link
+ local iface_count iface_id metric probability weight
+ config_get INTERFACE vpn_link interface
+ eval export -n -- INTERFACE=${CONFIG_vpn_link_interface:-${4}}
+ export -n -- INTERFACE=sevpn
+ config_get metric vpn_link metric 1
+ eval export -n -- metric=${CONFIG_vpn_link_metric:-${4}}
+ export -n -- metric=50
+ config_get weight vpn_link weight 1
+ eval export -n -- weight=${CONFIG_vpn_link_weight:-${4}}
+ export -n -- weight=50
+ [ -n sevpn ]
+ config_foreach mwan3_get_iface_id interface
+ local ___function=mwan3_get_iface_id
+ [ 2 -ge 1 ]
+ shift
+ local ___type=interface
+ [ 1 -ge 1 ]
+ shift
+ local section cfgtype
+ [ -z server lan_subnet guests wan sevpn wan_link vpn_link wan_only vpn_only ]
+ config_get cfgtype server TYPE
+ eval export -n -- cfgtype=${CONFIG_server_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype lan_subnet TYPE
+ eval export -n -- cfgtype=${CONFIG_lan_subnet_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype guests TYPE
+ eval export -n -- cfgtype=${CONFIG_guests_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n interface -a xrule != xinterface ]
+ continue
+ config_get cfgtype wan TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n interface -a xinterface != xinterface ]
+ eval mwan3_get_iface_id "$section" "$@"
+ mwan3_get_iface_id wan
+ let iface_count++
+ [ wan == sevpn ]
+ config_get cfgtype sevpn TYPE
+ eval export -n -- cfgtype=${CONFIG_sevpn_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n interface -a xinterface != xinterface ]
+ eval mwan3_get_iface_id "$section" "$@"
+ mwan3_get_iface_id sevpn
+ let iface_count++
+ [ sevpn == sevpn ]
+ iface_id=2
+ config_get cfgtype wan_link TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n interface -a xmember != xinterface ]
+ continue
+ config_get cfgtype vpn_link TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n interface -a xmember != xinterface ]
+ continue
+ config_get cfgtype wan_only TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n interface -a xpolicy != xinterface ]
+ continue
+ config_get cfgtype vpn_only TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n interface -a xpolicy != xinterface ]
+ continue
+ [ -n 2 ]
+ iptables -S mwan3_iface_sevpn -t mangle
+ [ 50 -lt 256 ]
+ total_weight=50
+ iptables -F mwan3_policy_vpn_only -t mangle
+ iptables -A mwan3_policy_vpn_only -t mangle -m mark --mark 0x0/0xff00 -m comment --comment sevpn 50 50 -j MARK --set-xmark 512/0xff00
+ lowest_metric=50
+ c=2
+ [ 2 -le 1 ]
+ config_foreach mwan3_set_user_rules_iptables rule
+ local ___function=mwan3_set_user_rules_iptables
+ [ 2 -ge 1 ]
+ shift
+ local ___type=rule
+ [ 1 -ge 1 ]
+ shift
+ local section cfgtype
+ [ -z server lan_subnet guests wan sevpn wan_link vpn_link wan_only vpn_only ]
+ config_get cfgtype server TYPE
+ eval export -n -- cfgtype=${CONFIG_server_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n rule -a xrule != xrule ]
+ eval mwan3_set_user_rules_iptables "$section" "$@"
+ mwan3_set_user_rules_iptables server
+ local proto src_ip src_port dest_ip dest_port use_policy
+ config_get proto server proto all
+ eval export -n -- proto=${CONFIG_server_proto:-${4}}
+ export -n -- proto=all
+ config_get src_ip server src_ip 0.0.0.0/0
+ eval export -n -- src_ip=${CONFIG_server_src_ip:-${4}}
+ export -n -- src_ip=192.168.5.10
+ config_get src_port server src_port 0:65535
+ eval export -n -- src_port=${CONFIG_server_src_port:-${4}}
+ export -n -- src_port=0:65535
+ config_get dest_ip server dest_ip 0.0.0.0/0
+ eval export -n -- dest_ip=${CONFIG_server_dest_ip:-${4}}
+ export -n -- dest_ip=0.0.0.0/0
+ config_get dest_port server dest_port 0:65535
+ eval export -n -- dest_port=${CONFIG_server_dest_port:-${4}}
+ export -n -- dest_port=0:65535
+ config_get use_policy server use_policy
+ eval export -n -- use_policy=${CONFIG_server_use_policy:-${4}}
+ export -n -- use_policy=wan_only
+ [ -n wan_only ]
+ [ wan_only == default ]
+ [ wan_only == unreachable ]
+ use_policy=mwan3_policy_wan_only
+ iptables -A mwan3_rules -t mangle -p all -s 192.168.5.10 -d 0.0.0.0/0 -m mark --mark 0/0xff00 -m comment --comment server -j mwan3_policy_wan_only
+ config_get cfgtype lan_subnet TYPE
+ eval export -n -- cfgtype=${CONFIG_lan_subnet_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n rule -a xrule != xrule ]
+ eval mwan3_set_user_rules_iptables "$section" "$@"
+ mwan3_set_user_rules_iptables lan_subnet
+ local proto src_ip src_port dest_ip dest_port use_policy
+ config_get proto lan_subnet proto all
+ eval export -n -- proto=${CONFIG_lan_subnet_proto:-${4}}
+ export -n -- proto=all
+ config_get src_ip lan_subnet src_ip 0.0.0.0/0
+ eval export -n -- src_ip=${CONFIG_lan_subnet_src_ip:-${4}}
+ export -n -- src_ip=192.168.5.0/24
+ config_get src_port lan_subnet src_port 0:65535
+ eval export -n -- src_port=${CONFIG_lan_subnet_src_port:-${4}}
+ export -n -- src_port=0:65535
+ config_get dest_ip lan_subnet dest_ip 0.0.0.0/0
+ eval export -n -- dest_ip=${CONFIG_lan_subnet_dest_ip:-${4}}
+ export -n -- dest_ip=0.0.0.0/0
+ config_get dest_port lan_subnet dest_port 0:65535
+ eval export -n -- dest_port=${CONFIG_lan_subnet_dest_port:-${4}}
+ export -n -- dest_port=0:65535
+ config_get use_policy lan_subnet use_policy
+ eval export -n -- use_policy=${CONFIG_lan_subnet_use_policy:-${4}}
+ export -n -- use_policy=vpn_only
+ [ -n vpn_only ]
+ [ vpn_only == default ]
+ [ vpn_only == unreachable ]
+ use_policy=mwan3_policy_vpn_only
+ iptables -A mwan3_rules -t mangle -p all -s 192.168.5.0/24 -d 0.0.0.0/0 -m mark --mark 0/0xff00 -m comment --comment lan_subnet -j mwan3_policy_vpn_only
+ config_get cfgtype guests TYPE
+ eval export -n -- cfgtype=${CONFIG_guests_TYPE:-${4}}
+ export -n -- cfgtype=rule
+ [ -n rule -a xrule != xrule ]
+ eval mwan3_set_user_rules_iptables "$section" "$@"
+ mwan3_set_user_rules_iptables guests
+ local proto src_ip src_port dest_ip dest_port use_policy
+ config_get proto guests proto all
+ eval export -n -- proto=${CONFIG_guests_proto:-${4}}
+ export -n -- proto=all
+ config_get src_ip guests src_ip 0.0.0.0/0
+ eval export -n -- src_ip=${CONFIG_guests_src_ip:-${4}}
+ export -n -- src_ip=192.168.6.0/24
+ config_get src_port guests src_port 0:65535
+ eval export -n -- src_port=${CONFIG_guests_src_port:-${4}}
+ export -n -- src_port=0:65535
+ config_get dest_ip guests dest_ip 0.0.0.0/0
+ eval export -n -- dest_ip=${CONFIG_guests_dest_ip:-${4}}
+ export -n -- dest_ip=0.0.0.0/0
+ config_get dest_port guests dest_port 0:65535
+ eval export -n -- dest_port=${CONFIG_guests_dest_port:-${4}}
+ export -n -- dest_port=0:65535
+ config_get use_policy guests use_policy
+ eval export -n -- use_policy=${CONFIG_guests_use_policy:-${4}}
+ export -n -- use_policy=wan_only
+ [ -n wan_only ]
+ [ wan_only == default ]
+ [ wan_only == unreachable ]
+ use_policy=mwan3_policy_wan_only
+ iptables -A mwan3_rules -t mangle -p all -s 192.168.6.0/24 -d 0.0.0.0/0 -m mark --mark 0/0xff00 -m comment --comment guests -j mwan3_policy_wan_only
+ config_get cfgtype wan TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n rule -a xinterface != xrule ]
+ continue
+ config_get cfgtype sevpn TYPE
+ eval export -n -- cfgtype=${CONFIG_sevpn_TYPE:-${4}}
+ export -n -- cfgtype=interface
+ [ -n rule -a xinterface != xrule ]
+ continue
+ config_get cfgtype wan_link TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n rule -a xmember != xrule ]
+ continue
+ config_get cfgtype vpn_link TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_link_TYPE:-${4}}
+ export -n -- cfgtype=member
+ [ -n rule -a xmember != xrule ]
+ continue
+ config_get cfgtype wan_only TYPE
+ eval export -n -- cfgtype=${CONFIG_wan_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n rule -a xpolicy != xrule ]
+ continue
+ config_get cfgtype vpn_only TYPE
+ eval export -n -- cfgtype=${CONFIG_vpn_only_TYPE:-${4}}
+ export -n -- cfgtype=policy
+ [ -n rule -a xpolicy != xrule ]
+ continue
+ mwan3_set_connected_iptables
+ local connected_networks
+ iptables -S mwan3_connected -t mangle
+ iptables -F mwan3_connected -t mangle
+ ip -4 route
+ awk {print $1}
+ egrep [0-9]{1,3}(\.[0-9]{1,3}){3}
+ iptables -A mwan3_connected -t mangle -d 31.220.43.152 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 92.42.31.0/24 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 93.95.98.176 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 95.215.45.33 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 192.168.5.0/24 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 192.168.6.0/24 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 192.168.99.98 -j MARK --set-xmark 0xff00/0xff00
+ iptables -A mwan3_connected -t mangle -d 192.168.200.0/25 -j MARK --set-xmark 0xff00/0xff00
+ iptables -I mwan3_connected -t mangle -d 224.0.0.0/3 -j MARK --set-xmark 0xff00/0xff00
+ iptables -I mwan3_connected -t mangle -d 127.0.0.0/8 -j MARK --set-xmark 0xff00/0xff00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment