1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00

Merge pull request #164 from Ysurac/develop

sync
This commit is contained in:
suyuan 2021-08-01 11:55:18 +08:00 committed by GitHub
commit 97c2f956b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 153 additions and 59 deletions

View file

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=iperf PKG_NAME:=iperf
PKG_VERSION:=3.10.1 PKG_VERSION:=3.10.1
PKG_RELEASE:=1 PKG_RELEASE:=10
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.es.net/pub/iperf PKG_SOURCE_URL:=https://downloads.es.net/pub/iperf

View file

@ -10,10 +10,10 @@ include $(TOPDIR)/rules.mk
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libqmi.git PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
PKG_SOURCE_VERSION:=29fab8a1d4496ca5a1d32bb486013b1868a718ba PKG_SOURCE_VERSION:=311af7e04cd16a732ec799969b1e8d9c5334ac27
PKG_NAME:=libqmi PKG_NAME:=libqmi
PKG_VERSION:=1.29.3-$(PKG_SOURCE_VERSION) PKG_VERSION:=1.29.3-$(PKG_SOURCE_VERSION)
PKG_RELEASE:=10 PKG_RELEASE:=11
PKG_FIXUP:=autoreconf PKG_FIXUP:=autoreconf
PKG_MAINTAINER:=Nicholas Smith <nicholas.smith@telcoantennas.com.au> PKG_MAINTAINER:=Nicholas Smith <nicholas.smith@telcoantennas.com.au>

View file

@ -292,12 +292,24 @@ function wizard_add()
ucic:set("network",intf,"masterintf",masterintf) ucic:set("network",intf,"masterintf",masterintf)
elseif typeintf == "" and ifname ~= "" and (proto == "static" or proto == "dhcp" or proto == "dhcpv6") then elseif typeintf == "" and ifname ~= "" and (proto == "static" or proto == "dhcp" or proto == "dhcpv6") then
ucic:set("network",intf,"device",ifname) ucic:set("network",intf,"device",ifname)
ucic:set("network",intf .. "_dev","device")
ucic:set("network",intf .. "_dev","name",ifname)
elseif typeintf == "" and device ~= "" and proto == "ncm" then elseif typeintf == "" and device ~= "" and proto == "ncm" then
ucic:set("network",intf,"device",device_ncm) ucic:set("network",intf,"device",device_ncm)
ucic:set("network",intf .. "_dev","device")
ucic:set("network",intf .. "_dev","name",device_ncm)
elseif typeintf == "" and device ~= "" and proto == "qmi" then elseif typeintf == "" and device ~= "" and proto == "qmi" then
ucic:set("network",intf,"device",device_qmi) ucic:set("network",intf,"device",device_qmi)
ucic:set("network",intf .. "_dev","device")
ucic:set("network",intf .. "_dev","name",device_qmi)
elseif typeintf == "" and device ~= "" and proto == "modemmanager" then elseif typeintf == "" and device ~= "" and proto == "modemmanager" then
ucic:set("network",intf,"device",device_manager) ucic:set("network",intf,"device",device_manager)
ucic:set("network",intf .. "_dev","device")
ucic:set("network",intf .. "_dev","name",device_manager)
elseif typeintf == "" and ifname ~= "" and proto == "static" then
ucic:set("network",intf,"device",ifname)
ucic:set("network",intf .. "_dev","device")
ucic:set("network",intf .. "_dev","name",ifname)
end end
if proto == "pppoe" then if proto == "pppoe" then
ucic:set("network",intf,"pppd_options","persist maxfail 0") ucic:set("network",intf,"pppd_options","persist maxfail 0")

View file

@ -6,9 +6,8 @@
# Released under GPL 3 or later # Released under GPL 3 or later
if [ -d "/proc/sys/net/mptcp" ]; then if [ -d "/proc/sys/net/mptcp" ]; then
if [ `cat /proc/sys/net/mptcp/mptcp_enabled` = 0 ]; then if ([ -f /proc/sys/net/mptcp/mptcp_enabled ] && [ `cat /proc/sys/net/mptcp/mptcp_enabled` = 0 ]) || ([ -f /proc/sys/net/mptcp/enabled ] && [ `cat /proc/sys/net/mptcp/enabled` = 0 ]); then
echo "MPTCP is disabled!" echo "MPTCP is disabled!"
echo "Please set net.mptcp.mptcp_enabled = 1"
exit 1 exit 1
fi fi
else else
@ -43,12 +42,28 @@ case $1 in
cat /proc/net/mptcp_fullmesh cat /proc/net/mptcp_fullmesh
exit 0;; exit 0;;
"-k") "-k")
echo Enabled: `cat /proc/sys/net/mptcp/mptcp_enabled` if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then
echo Path Manager: `cat /proc/sys/net/mptcp/mptcp_path_manager` echo Enabled: `cat /proc/sys/net/mptcp/mptcp_enabled`
echo Use checksum: `cat /proc/sys/net/mptcp/mptcp_checksum` elif [ -f /proc/sys/net/mptcp/enabled ]; then
echo Scheduler: `cat /proc/sys/net/mptcp/mptcp_scheduler` echo Enabled: `cat /proc/sys/net/mptcp/enabled`
echo Syn retries: `cat /proc/sys/net/mptcp/mptcp_syn_retries` fi
echo Debugmode: `cat /proc/sys/net/mptcp/mptcp_debug` if [ -f /proc/sys/net/mptcp/mptcp_path_manager ]; then
echo Path Manager: `cat /proc/sys/net/mptcp/mptcp_path_manager`
fi
if [ -f /proc/sys/net/mptcp/mptcp_checksum ]; then
echo Use checksum: `cat /proc/sys/net/mptcp/mptcp_checksum`
else
echo Use checksum: `cat /proc/sys/net/mptcp/checksum_enabled`
fi
if [ -f /proc/sys/net/mptcp/mptcp_scheduler ]; then
echo Scheduler: `cat /proc/sys/net/mptcp/mptcp_scheduler`
fi
if [ -f /proc/sys/net/mptcp/mptcp_syn_retries ]; then
echo Syn retries: `cat /proc/sys/net/mptcp/mptcp_syn_retries`
fi
if [ -f /proc/sys/net/mptcp/mptcp_debug ]; then
echo Debugmode: `cat /proc/sys/net/mptcp/mptcp_debug`
fi
echo echo
echo See http://multipath-tcp.org/ for details echo See http://multipath-tcp.org/ for details
exit 0 ;; exit 0 ;;
@ -70,33 +85,65 @@ TYPE="$2"
exit 1 exit 1
} }
FLAG_PATH="/sys/class/net/$DEVICE/flags" if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then
IFF=`cat $FLAG_PATH` FLAG_PATH="/sys/class/net/$DEVICE/flags"
IFF=`cat $FLAG_PATH`
IFF_OFF="0x80000" IFF_OFF="0x80000"
IFF_ON="0x00" IFF_ON="0x00"
IFF_BACKUP="0x100000" IFF_BACKUP="0x100000"
IFF_HANDOVER="0x200000" IFF_HANDOVER="0x200000"
IFF_MASK="0x380000" IFF_MASK="0x380000"
case $TYPE in case $TYPE in
"off") FLAG=$IFF_OFF;; "off") FLAG=$IFF_OFF;;
"on") FLAG=$IFF_ON;; "on") FLAG=$IFF_ON;;
"backup") FLAG=$IFF_BACKUP;; "backup") FLAG=$IFF_BACKUP;;
"handover") FLAG=$IFF_HANDOVER;; "handover") FLAG=$IFF_HANDOVER;;
"") "")
IFF=`printf "0x%02x" $(($IFF&$IFF_MASK))` IFF=`printf "0x%02x" $(($IFF&$IFF_MASK))`
case "$IFF" in case "$IFF" in
$IFF_OFF) echo $DEVICE is deactivated;; $IFF_OFF) echo $DEVICE is deactivated;;
$IFF_ON) echo $DEVICE is in default mode;; $IFF_ON) echo $DEVICE is in default mode;;
$IFF_BACKUP) echo $DEVICE is in backup mode;; $IFF_BACKUP) echo $DEVICE is in backup mode;;
$IFF_HANDOVER) echo $DEVICE is in handover mode;; $IFF_HANDOVER) echo $DEVICE is in handover mode;;
*) echo "Unkown state!" && exit 1;; *) echo "Unkown state!" && exit 1;;
esac esac
exit 0;; exit 0;;
*) echo "Unkown flag! Use 'multipath -h' for help" && exit 1;; *) echo "Unkown flag! Use 'multipath -h' for help" && exit 1;;
esac esac
printf "0x%02x" $(($(($IFF^$(($IFF&$IFF_MASK))))|$FLAG)) > $FLAG_PATH printf "0x%02x" $(($(($IFF^$(($IFF&$IFF_MASK))))|$FLAG)) > $FLAG_PATH
else
ID=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $3}')
IFF=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $4}')
case $TYPE in
"off")
[ -n "$ID" ] && ip mptcp endpoint delete id $ID
exit 0;;
"on")
[ -n "$ID" ] && ip mptcp endpoint delete id $ID
ip mptcp endpoint add $IP dev $DEVICE subflow
exit 0;;
"signal")
[ -n "$ID" ] && ip mptcp endpoint delete id $ID
ip mptcp endpoint add $IP dev $DEVICE signal subflow
exit 0;;
"backup")
[ -n "$ID" ] && ip mptcp endpoint delete id $ID
ip mptcp endpoint add $IP dev $DEVICE backup
exit 0;;
"")
case "$IFF" in
"") echo $DEVICE is deactivated;;
"subflow") echo $DEVICE is in default mode;;
"backup") echo $DEVICE is in backup mode;;
"signal") echo $DEVICE is in signal mode;;
*) echo "$DEVICE Unkown state!" && exit 1;;
esac
exit 0;;
*) echo "Unkown flag! Use 'multipath -h' for help" && exit 1;;
esac
fi

View file

@ -834,17 +834,17 @@ if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "om
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE="interface" uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE="interface"
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.latency="$OMR_TRACKER_LATENCY" uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.latency="$OMR_TRACKER_LATENCY"
if [ "$(uci -q get glorytun.vpn.enable)" != "1" ] || [ "$(uci -q get glorytun-udp.vpn.enable)" != "1" ]; then if [ "$(uci -q get glorytun.vpn.enable)" != "1" ] || [ "$(uci -q get glorytun-udp.vpn.enable)" != "1" ]; then
if [ -n "$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu)" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then if [ -n "$(uci -q get network.${OMR_TRACKER_INTERFACE}_dev.mtu)" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
mtu=$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu) mtu=$(uci -q get network.${OMR_TRACKER_INTERFACE}_dev.mtu)
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu uci -q set openmptcprouter.${OMR_TRACKER_INTERFACE}.mtu=$mtu
[ -n "$mtu" ] && ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1 [ -n "$mtu" ] && ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.lc=$(date +"%s") uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.lc=$(date +"%s")
elif [ -z "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.mtu)" ] && [ -n "$OMR_TRACKER_DEVICE_IP" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then elif [ -z "$(uci -q get openmptcprouter.${OMR_TRACKER_INTERFACE}.mtu)" ] && [ -n "$OMR_TRACKER_DEVICE_IP" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
if [ -n "$serverip" ] && [ "$serverip" != "127.0.0.1" ]; then if [ -n "$serverip" ] && [ "$serverip" != "127.0.0.1" ]; then
local mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP $serverip) local mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP $serverip)
#local mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP 8.8.8.8) #local mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP 8.8.8.8)
[ -n "$mtu" ] && { [ -n "$mtu" ] && {
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu uci -q set openmptcprouter.${OMR_TRACKER_INTERFACE}.mtu=$mtu
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1 ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.lc=$(date +"%s") uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.lc=$(date +"%s")
} }
@ -1188,8 +1188,8 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
[ -n "$omrtracebox" ] && [ -z "$(echo $omrtracebox | grep error)" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status="$omrtracebox" [ -n "$omrtracebox" ] && [ -z "$(echo $omrtracebox | grep error)" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status="$omrtracebox"
} }
if [ "$OMR_TRACKER_INTERFACE" != "omrvpn" ] && [ "$(uci -q get glorytun.vpn.enable)" != "1" ] && [ "$(uci -q get glorytun-udp.vpn.enable)" != "1" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then if [ "$OMR_TRACKER_INTERFACE" != "omrvpn" ] && [ "$(uci -q get glorytun.vpn.enable)" != "1" ] && [ "$(uci -q get glorytun-udp.vpn.enable)" != "1" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
if [ -n "$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu)" ]; then if [ -n "$(uci -q get network.${OMR_TRACKER_INTERFACE}_dev.mtu)" ]; then
mtu=$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu) mtu=$(uci -q get network.${OMR_TRACKER_INTERFACE}_dev.mtu)
[ -n "$mtu" ] && { [ -n "$mtu" ] && {
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1 ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
@ -1252,10 +1252,10 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
[ -n "$omrtracebox" ] && [ -z "$(echo $omrtracebox | grep error)" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status="$omrtracebox" [ -n "$omrtracebox" ] && [ -z "$(echo $omrtracebox | grep error)" ] && uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mptcp_status="$omrtracebox"
} }
if [ "$OMR_TRACKER_INTERFACE" != "omrvpn" ] && [ "$(uci -q get glorytun.vpn.enable)" != "1" ] && [ "$(uci -q get glorytun-udp.vpn.enable)" != "1" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then if [ "$OMR_TRACKER_INTERFACE" != "omrvpn" ] && [ "$(uci -q get glorytun.vpn.enable)" != "1" ] && [ "$(uci -q get glorytun-udp.vpn.enable)" != "1" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
if [ -n "$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu)" ]; then if [ -n "$(uci -q get network.${OMR_TRACKER_INTERFACE}_dev.mtu)" ]; then
mtu=$(uci -q get network.$OMR_TRACKER_INTERFACE.mtu) mtu=$(uci -q get network.${OMR_TRACKER_INTERFACE}_dev.mtu)
[ -n "$mtu" ] && { [ -n "$mtu" ] && {
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu uci -q set openmptcprouter.${OMR_TRACKER_INTERFACE}.mtu=$mtu
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1 ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
} }
elif [ -n "$OMR_TRACKER_DEVICE_IP" ]; then elif [ -n "$OMR_TRACKER_DEVICE_IP" ]; then

View file

@ -884,6 +884,7 @@ _vps_firewall_redirect_port() {
config_get v2ray $1 v2ray "0" config_get v2ray $1 v2ray "0"
config_get name $1 name config_get name $1 name
config_get dmz $1 dmz "0" config_get dmz $1 dmz "0"
config_get target $1 target "REDIRECT"
if [ -z "$src_dport" ] && [ -n "$dest_port" ]; then if [ -z "$src_dport" ] && [ -n "$dest_port" ]; then
src_dport=$dest_port src_dport=$dest_port
fi fi
@ -918,42 +919,74 @@ _vps_firewall_redirect_port() {
iptables-save --counters | sed "s:-d $src_dip/32::g" | iptables-restore -w iptables-save --counters | sed "s:-d $src_dip/32::g" | iptables-restore -w
} }
[ -n "$src_ip" ] && comment=" from $src_ip" [ -n "$src_ip" ] && comment=" from $src_ip"
checkfw=$(echo "$vpsfwlist" | grep "# OMR $username redirect router $src_dport port $protoi${comment}") if [ "$target" = "ACCEPT" ]; then
checkfw=$(echo "$vpsfwlist" | grep "# OMR $username open router $src_dport port $protoi${comment}")
else
checkfw=$(echo "$vpsfwlist" | grep "# OMR $username redirect router $src_dport port $protoi${comment}")
fi
fi fi
else else
if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then
checkfw=$(echo "$vpsfw6list" | grep "$src_dport # OMR $username redirect router $src_dport port $protoi") if [ "$target" = "ACCEPT" ]; then
checkfw=$(echo "$vpsfw6list" | grep "$src_dport # OMR $username open router $src_dport port $protoi")
else
checkfw=$(echo "$vpsfw6list" | grep "$src_dport # OMR $username redirect router $src_dport port $protoi")
fi
else else
comment="" comment=""
[ -n "$src_dip" ] && comment=" to $src_dip" [ -n "$src_dip" ] && comment=" to $src_dip"
[ -n "$src_ip" ] && comment=" from $src_ip" [ -n "$src_ip" ] && comment=" from $src_ip"
checkfw=$(echo "$vpsfw6list" | grep "# OMR $username redirect router $src_dport port $protoi${comment}") if [ "$target" = "ACCEPT" ]; then
checkfw=$(echo "$vpsfw6list" | grep "# OMR $username open router $src_dport port $protoi${comment}")
else
checkfw=$(echo "$vpsfw6list" | grep "# OMR $username redirect router $src_dport port $protoi${comment}")
fi
fi fi
fi fi
if [ "$checkfw" = "" ]; then if [ "$checkfw" = "" ]; then
settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","source_dip" : "'$src_dip'","source_ip" : "'$src_ip'","proto" : "'$protoi'","fwtype" : "DNAT","ipproto" : "'$family'"}' settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","source_dip" : "'$src_dip'","source_ip" : "'$src_ip'","proto" : "'$protoi'","fwtype" : "'$target'","ipproto" : "'$family'"}'
_set_json "shorewallopen" "$settings" _set_json "shorewallopen" "$settings"
fi fi
if [ "$family" = "ipv4" ]; then if [ "$family" = "ipv4" ]; then
if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then
vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR $username redirect router $src_dport port $protoi") if [ "$target" = "ACCEPT" ]; then
[ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR redirect router $src_dport port $protoi") vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR $username open router $src_dport port $protoi")
[ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR open router $src_dport port $protoi")
else
vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR $username redirect router $src_dport port $protoi")
[ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR redirect router $src_dport port $protoi")
fi
else else
comment="" comment=""
[ -n "$src_dip" ] && comment=" to $src_dip" [ -n "$src_dip" ] && comment=" to $src_dip"
[ -n "$src_ip" ] && comment=" from $src_ip" [ -n "$src_ip" ] && comment=" from $src_ip"
vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR $username redirect router $src_dport port $protoi${comment}") if [ "$target" = "ACCEPT" ]; then
[ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR redirect router $src_dport port $protoi${comment}") vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR $username open router $src_dport port $protoi${comment}")
[ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR open router $src_dport port $protoi${comment}")
else
vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR $username redirect router $src_dport port $protoi${comment}")
[ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR redirect router $src_dport port $protoi${comment}")
fi
fi fi
else else
if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then
vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR $username redirect router $src_dport port $protoi") if [ "$target" = "ACCEPT" ]; then
[ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR redirect router $src_dport port $protoi") vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR $username open router $src_dport port $protoi")
[ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR open router $src_dport port $protoi")
else
vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR $username redirect router $src_dport port $protoi")
[ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR redirect router $src_dport port $protoi")
fi
else else
[ -n "$src_dip" ] && comment=" to $src_dip" [ -n "$src_dip" ] && comment=" to $src_dip"
[ -n "$src_ip" ] && comment=" from $src_ip" [ -n "$src_ip" ] && comment=" from $src_ip"
vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR $username redirect router $src_dport port $protoi${comment}") if [ "$target" = "ACCEPT" ]; then
[ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR redirect router $src_dport port $protoi${comment}") vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR $username open router $src_dport port $protoi${comment}")
[ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR open router $src_dport port $protoi${comment}")
else
vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR $username redirect router $src_dport port $protoi${comment}")
[ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR redirect router $src_dport port $protoi${comment}")
fi
fi fi
fi fi
else else

View file

@ -62,6 +62,8 @@ _setup_wan_interface() {
set network.$1.ip4table=wan set network.$1.ip4table=wan
set network.$1.multipath=$3 set network.$1.multipath=$3
set network.$1.defaultroute=0 set network.$1.defaultroute=0
set network.$1_dev=device
set network.$1_dev.name=$2
commit network commit network
add_list firewall.@zone[1].network=$1 add_list firewall.@zone[1].network=$1
commit firewall commit firewall

View file

@ -2,7 +2,7 @@
if [ "$(uci -q get wifi-iface.radio0)" != "" ] && [ "$(uci -q get wifi-iface.default_radio0.key)" = "12345678" ]; then if [ "$(uci -q get wifi-iface.radio0)" != "" ] && [ "$(uci -q get wifi-iface.default_radio0.key)" = "12345678" ]; then
if [ "$(uci -q get wifi-device.radio0.country)" = "" ]; then if [ "$(uci -q get wifi-device.radio0.country)" = "" ]; then
uci -q batch <<-EOF >/dev/null uci -q batch <<-EOF >/dev/null
set wifi-device.radio0.country='00' set wifi-device.radio0.country='FR'
commit wifi-device commit wifi-device
EOF EOF
fi fi