|
|
@ -6,6 +6,7 @@ IPS="/usr/sbin/ipset" |
|
|
|
IPT4="/usr/sbin/iptables -t mangle -w" |
|
|
|
IPT6="/usr/sbin/ip6tables -t mangle -w" |
|
|
|
LOG="/usr/bin/logger -t mwan3 -p" |
|
|
|
CONNTRACK_FILE="/proc/net/nf_conntrack" |
|
|
|
|
|
|
|
mwan3_get_iface_id() |
|
|
|
{ |
|
|
@ -360,7 +361,7 @@ mwan3_delete_iface_ipset_entries() |
|
|
|
|
|
|
|
mwan3_track() |
|
|
|
{ |
|
|
|
local track_ip track_ips reliability count timeout interval down up |
|
|
|
local track_ip track_ips reliability count timeout interval down up size |
|
|
|
|
|
|
|
mwan3_list_track_ips() |
|
|
|
{ |
|
|
@ -380,8 +381,9 @@ mwan3_track() |
|
|
|
config_get interval $1 interval 10 |
|
|
|
config_get down $1 down 5 |
|
|
|
config_get up $1 up 5 |
|
|
|
config_get size $1 size 56 |
|
|
|
|
|
|
|
[ -x /usr/sbin/mwan3track ] && /usr/sbin/mwan3track $1 $2 $reliability $count $timeout $interval $down $up $track_ips & |
|
|
|
[ -x /usr/sbin/mwan3track ] && /usr/sbin/mwan3track $1 $2 $reliability $count $timeout $interval $down $up $size $track_ips & |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
@ -804,3 +806,36 @@ mwan3_report_rules_v6() |
|
|
|
$IPT6 -L mwan3_rules -n -v 2> /dev/null | tail -n+3 | sed 's/mark.*//' | sed 's/mwan3_policy_/- /' | sed 's/mwan3_rule_/S /' |
|
|
|
fi |
|
|
|
} |
|
|
|
|
|
|
|
mwan3_flush_conntrack() |
|
|
|
{ |
|
|
|
local flush_conntrack |
|
|
|
|
|
|
|
config_get flush_conntrack $1 flush_conntrack never |
|
|
|
|
|
|
|
if [ -e "$CONNTRACK_FILE" ]; then |
|
|
|
case $flush_conntrack in |
|
|
|
ifup) |
|
|
|
[ "$3" = "ifup" ] && { |
|
|
|
echo f > ${CONNTRACK_FILE} |
|
|
|
$LOG info "connection tracking flushed on interface $1 ($2) $3" |
|
|
|
} |
|
|
|
;; |
|
|
|
ifdown) |
|
|
|
[ "$3" = "ifdown" ] && { |
|
|
|
echo f > ${CONNTRACK_FILE} |
|
|
|
$LOG info "connection tracking flushed on interface $1 ($2) $3" |
|
|
|
} |
|
|
|
;; |
|
|
|
always) |
|
|
|
echo f > ${CONNTRACK_FILE} |
|
|
|
$LOG info "connection tracking flushed on interface $1 ($2) $3" |
|
|
|
;; |
|
|
|
never) |
|
|
|
$LOG info "connection tracking not flushed on interface $1 ($2) $3" |
|
|
|
;; |
|
|
|
esac |
|
|
|
else |
|
|
|
$LOG warning "connection tracking not enabled" |
|
|
|
fi |
|
|
|
} |