From 36b3217086395fdca3dea4abcc233f621581a98d Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 17 Nov 2020 13:34:42 +0100 Subject: [PATCH 01/10] Remove tcp_retries2 default --- shadowsocks-libev/files/shadowsocks.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/shadowsocks-libev/files/shadowsocks.conf b/shadowsocks-libev/files/shadowsocks.conf index 1c4703f5b..159ea3860 100644 --- a/shadowsocks-libev/files/shadowsocks.conf +++ b/shadowsocks-libev/files/shadowsocks.conf @@ -51,5 +51,4 @@ net.ipv4.tcp_mtu_probing = 0 net.netfilter.nf_conntrack_max = 131072 net.ipv4.tcp_ecn = 1 -net.ipv4.tcp_retries2 = 10 #net.ipv4.tcp_sack = 0 From f3691c0407b7dbb8485527911d5f6b4e1b3e96a6 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 17 Nov 2020 15:31:33 +0100 Subject: [PATCH 02/10] Fix MPTCP interface trigger --- mptcp/files/etc/init.d/mptcp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/mptcp/files/etc/init.d/mptcp b/mptcp/files/etc/init.d/mptcp index ee8027b05..57e4fa63d 100755 --- a/mptcp/files/etc/init.d/mptcp +++ b/mptcp/files/etc/init.d/mptcp @@ -470,17 +470,13 @@ reload_service() { return 0 } -add_interface_trigger() { - local interface ignore - - config_get interface "$1" interface - config_get_bool ignore "$1" ignore 0 - - [ -n "$interface" -a $ignore -eq 0 ] && procd_add_interface_trigger "interface.*" "$interface" /etc/init.d/mptcp reload -} +service_triggers_load_interface() { is_supported_interface "$1" && ifaces="${ifaces}${1} "; } service_triggers() { + local ifaces n + config_load network; config_foreach service_triggers_load_interface 'interface'; procd_add_reload_trigger "network" - config_load network - config_foreach add_interface_trigger interface + procd_open_trigger + for n in $ifaces; do procd_add_reload_interface_trigger "$n"; procd_add_interface_trigger "interface.*" "$n" /etc/init.d/mptcp reload; done; + procd_close_trigger } From 8f1fe8fbf1d027c6a1e2d13e03e28d2e98b3addc Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 17 Nov 2020 15:32:55 +0100 Subject: [PATCH 03/10] Add a sleep between omr-tracker interface run --- omr-tracker/files/etc/init.d/omr-tracker | 1 + 1 file changed, 1 insertion(+) diff --git a/omr-tracker/files/etc/init.d/omr-tracker b/omr-tracker/files/etc/init.d/omr-tracker index 5d470808b..e0d78e5ae 100755 --- a/omr-tracker/files/etc/init.d/omr-tracker +++ b/omr-tracker/files/etc/init.d/omr-tracker @@ -78,6 +78,7 @@ _launch_tracker() { procd_set_param respawn 0 10 0 procd_set_param stderr 1 procd_close_instance + sleep $((RANDOM % 10)) } _launch_server_tracker() { From 3a05dd460a7a54ee26c2b828e115138545f166b4 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 17 Nov 2020 15:33:22 +0100 Subject: [PATCH 04/10] Only display real interface in wizard --- .../luasrc/view/openmptcprouter/wizard.htm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index 0ee9ad9a2..51e13edba 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -14,7 +14,8 @@ local ifacename = uci:get("network",ifacen,"ifname") local ifacetype = uci:get("network",ifacen,"type") or "" local ifaceproto = uci:get("network",ifacen,"proto") or "" - if ifacename == dev and (ifacetype == "macvlan" or ifacetype == "bridge" or ifaceproto == "6in4") then + --if ifacename == dev and (ifacetype == "macvlan" or ifacetype == "bridge" or ifaceproto == "6in4") then + if ifacename == dev and (ifacetype == "macvlan" or ifaceproto == "6in4") then return false end end @@ -380,7 +381,7 @@ <% iffind=0 for _, ifacea in ipairs(ifaces) do - if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*") or ifacea:match("^tun.*")) then + if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*") or ifacea:match("^tun.*")) and device_notvirtual(ifacea) then if uci:get("network",ifname,"proto") ~= "macvlan" then %> @@ -485,7 +486,7 @@ <% for _, ifacea in ipairs(ifaces) do - if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*")) then + if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*")) and device_notvirtual(ifacea) then %> <% From 48b31a1b2d8f9de5d6493768a7b24d9b6544323c Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 19 Nov 2020 19:24:11 +0100 Subject: [PATCH 05/10] Update Glorytun UDP --- glorytun-udp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glorytun-udp/Makefile b/glorytun-udp/Makefile index 121af0912..c2dd9da15 100644 --- a/glorytun-udp/Makefile +++ b/glorytun-udp/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/angt/glorytun.git -PKG_SOURCE_VERSION:=97607fdf5c6c33df512ed85190a1fd93b5f45e77 +PKG_SOURCE_VERSION:=32267e86a6da05b285bb3bf2b136c105dc0af4bb PKG_NAME:=glorytun-udp PKG_VERSION:=0.3.4-$(PKG_SOURCE_VERSION) PKG_RELEASE:=23 From fc4662b575c4c3f85022230eb68c4a762d027357 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 19 Nov 2020 19:24:29 +0100 Subject: [PATCH 06/10] Update path options for glorytun UDP --- .../share/omr/post-tracking.d/post-tracking | 38 +++++++------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking index a7ca34d0d..9c3c9063a 100755 --- a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking +++ b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking @@ -318,7 +318,7 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then # multipath "$OMR_TRACKER_DEVICE" off > /dev/null 2>&1 #fi if [ -n "$OMR_TRACKER_DEVICE_IP" ]; then - glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 set down > /dev/null 2>&1 + glorytun-udp path addr $OMR_TRACKER_DEVICE_IP dev tun0 set down > /dev/null 2>&1 fi if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" = "1" ]; then VPN_BASE_INTF="$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.baseintf)" @@ -561,7 +561,7 @@ if [ -n "$OMR_TRACKER_DEVICE_IP" ] && [ -n "$OMR_TRACKER_DEVICE_GATEWAY" ]; then fi fi -[ "$multipath_config" = "on" ] && { +if [ "$multipath_config" = "on" ] || [ "$multipath_config" = "backup" ]; then download="$(uci -q get network.$OMR_TRACKER_INTERFACE.downloadspeed)" [ -z "$download" ] && download="$(uci -q get sqm.$OMR_TRACKER_INTERFACE.download)" upload="$(uci -q get network.$OMR_TRACKER_INTERFACE.uploadspeed)" @@ -569,38 +569,28 @@ fi if [ "$(uci -q show | grep mptcpr)" = "" ]; then touch /etc/config/openmptcprouter fi - if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" != "1" ] && [ "$(pgrep glorytun-udp)" != "" ] && ([ "$(glorytun-udp path | grep $OMR_TRACKER_DEVICE_IP)" = "" ] || [ "$(glorytun-udp path $OMR_TRACKER_DEVICE_IP | awk '{print $13}')" = "0" ] || [ "$(glorytun-udp path $OMR_TRACKER_DEVICE_IP | awk '{print $16}')" = "0" ]); then + gtudpst="up" + [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] && [ "$multipath_config" = "backup" ] && [ "$(pgrep glorytun-udp)" != "" ] && gtudpst="backup" + if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" != "1" ] && [ "$(pgrep glorytun-udp)" != "" ] && [ "$(glorytun-udp path | grep $OMR_TRACKER_DEVICE_IP)" = "" ]; then if [ "$download" != "0" ] && [ "$download" != "" ] && [ "$upload" != "0" ] && [ "$upload" != "" ]; then if [ "$(uci -q get glorytun.vpn.rateauto)" = "1" ]; then - glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 set up rate auto tx $((upload*1000/8)) rx $((download*1000/8)) > /dev/null 2>&1 + glorytun-udp path addr $OMR_TRACKER_DEVICE_IP dev tun0 set up rate auto tx $((upload*1000/8)) rx $((download*1000/8)) > /dev/null 2>&1 else - glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 set up rate fixed tx $((upload*1000/8)) rx $((download*1000/8)) > /dev/null 2>&1 + glorytun-udp path addr $OMR_TRACKER_DEVICE_IP dev tun0 set up rate fixed tx $((upload*1000/8)) rx $((download*1000/8)) > /dev/null 2>&1 fi else if [ "$(uci -q get glorytun.vpn.rateauto)" = "1" ]; then - glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 set up rate auto tx 12500000 rx 12500000 > /dev/null 2>&1 + glorytun-udp path addr $OMR_TRACKER_DEVICE_IP dev tun0 set up rate auto tx 12500000 rx 12500000 > /dev/null 2>&1 else - glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 set up rate fixed tx 12500000 rx 12500000 > /dev/null 2>&1 + glorytun-udp path addr $OMR_TRACKER_DEVICE_IP dev tun0 set up rate fixed tx 12500000 rx 12500000 > /dev/null 2>&1 fi fi fi -# if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" = "1" ] && [ "$(pgrep glorytun-udp)" != "" ] && ([ "$(glorytun-udp path | grep $OMR_TRACKER_DEVICE_IP)" = "" ] || [ "$(glorytun-udp path $OMR_TRACKER_DEVICE_IP | awk '{print $13}')" = "0" ] || [ "$(glorytun-udp path $OMR_TRACKER_DEVICE_IP | awk '{print $16}')" = "0" ]); then -# if [ "$download" != "0" ] && [ "$download" != "" ] && [ "$upload" != "0" ] && [ "$upload" != "" ]; then -# if [ "$(uci -q get glorytun.vpn.rateauto)" = "1" ]; then -# glorytun-udp path $OMR_TRACKER_DEVICE_IP to 10.255.250.1 $(uci -q get glorytun.vpn.port) dev tun0 set up rate auto tx ${upload}000 rx ${download}000 > /dev/null 2>&1 -# else -# glorytun-udp path $OMR_TRACKER_DEVICE_IP to 10.255.250.1 $(uci -q get glorytun.vpn.port) dev tun0 set up rate fixed tx ${upload}000 rx ${download}000 > /dev/null 2>&1 -# fi -# else -# if [ "$(uci -q get glorytun.vpn.rateauto)" = "1" ]; then -# glorytun-udp path $OMR_TRACKER_DEVICE_IP to 10.255.250.1 $(uci -q get glorytun.vpn.port) dev tun0 set up rate auto tx 125000000 rx 125000000 > /dev/null 2>&1 -# else -# glorytun-udp path $OMR_TRACKER_DEVICE_IP to 10.255.250.1 $(uci -q get glorytun.vpn.port) dev tun0 set up rate fixed tx 125000000 rx 125000000 > /dev/null 2>&1 -# fi -# fi -# fi -} -[ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] && [ "$multipath_config" = "backup" ] && [ "$(pgrep glorytun-udp)" != "" ] && glorytun-udp path $OMR_TRACKER_DEVICE_IP dev tun0 set backup rate auto rx 125000000 tx 125000000 > /dev/null 2>&1 + if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" != "1" ] && [ "$(pgrep glorytun-udp)" != "" ] && [ "$(glorytun-udp set | grep 'kxtimeout 7d')" = "" ]; then + glorytun-udp set dev tun0 kxtimeout 7d > /dev/null 2>&1 + fi + [ "$multipath_config" = "backup" ] && [ "$(pgrep glorytun-udp)" != "" ] && glorytun-udp path addr $OMR_TRACKER_DEVICE_IP dev tun0 set pref 500 > /dev/null 2>&1 +fi [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] && { [ "$multipath_status" = "$multipath_config" ] || { if [ "$(sysctl -n net.mptcp.mptcp_enabled | tr -d '\n')" = "1" ]; then From 029eff6c4375d151f38b181ef3b8093cecf8df29 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 19 Nov 2020 19:24:51 +0100 Subject: [PATCH 07/10] Fixed sleep between wan tracker --- omr-tracker/files/etc/init.d/omr-tracker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omr-tracker/files/etc/init.d/omr-tracker b/omr-tracker/files/etc/init.d/omr-tracker index e0d78e5ae..e7bf920a7 100755 --- a/omr-tracker/files/etc/init.d/omr-tracker +++ b/omr-tracker/files/etc/init.d/omr-tracker @@ -78,7 +78,7 @@ _launch_tracker() { procd_set_param respawn 0 10 0 procd_set_param stderr 1 procd_close_instance - sleep $((RANDOM % 10)) + sleep 1 } _launch_server_tracker() { From af7a9bd433d38c6d1d731086a06e44454302ac72 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 19 Nov 2020 19:25:16 +0100 Subject: [PATCH 08/10] Fix find IP for omr-test-speed --- openmptcprouter/files/bin/omr-test-speed | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmptcprouter/files/bin/omr-test-speed b/openmptcprouter/files/bin/omr-test-speed index bc3efae22..fb433b625 100755 --- a/openmptcprouter/files/bin/omr-test-speed +++ b/openmptcprouter/files/bin/omr-test-speed @@ -27,7 +27,7 @@ if [ -z "$INTERFACE" ]; then curl -4 $HOST >/dev/null || echo else domain=$(echo $HOST | awk -F/ '{print $3}') - hostip=$(dig +short A $domain | tr -d "\n") + hostip=$(dig +nocmd +noall +answer A $domain | grep -v CNAME | awk '{print $5}' | tr -d "\n") ipset add ss_rules_dst_bypass_all $hostip curl -4 $HOST >/dev/null || echo ipset del ss_rules_dst_bypass_all $hostip From a90606ba481755d465e69ee022b60d024bef0153 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 19 Nov 2020 19:25:44 +0100 Subject: [PATCH 09/10] Fix find IP for omr-bypass domains bypass --- luci-app-omr-bypass/root/etc/init.d/omr-bypass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luci-app-omr-bypass/root/etc/init.d/omr-bypass b/luci-app-omr-bypass/root/etc/init.d/omr-bypass index 8e5a0c5bd..3708a0fce 100755 --- a/luci-app-omr-bypass/root/etc/init.d/omr-bypass +++ b/luci-app-omr-bypass/root/etc/init.d/omr-bypass @@ -56,12 +56,12 @@ _bypass_domain() { domain=$(echo $domain | sed 's:^\.::') #logger -t "omr-bypass" "Get IPs of $domain..." if [ -z $RELOAD ]; then - resolve=$(dig a +timeout=1 +tries=1 +nocmd +noall +answer $domain | awk '{print $5}') + resolve=$(dig a +timeout=1 +tries=1 +nocmd +noall +answer $domain | grep -v CNAME | awk '{print $5}') for ip in $resolve; do _bypass_ip $ip $intf done if [ "$disableipv6" = "0" ]; then - resolve=$(dig aaaa +timeout=1 +tries=1 +nocmd +noall +answer $domain | awk '{print $5}') + resolve=$(dig aaaa +timeout=1 +tries=1 +nocmd +noall +answer $domain | grep AAAA | awk '{print $5}') for ip in $resolve; do _bypass_ip $ip $intf done From 437b0ac984c5999e194e95600b5328d1e66d561a Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 19 Nov 2020 19:26:06 +0100 Subject: [PATCH 10/10] Add hwinfo and dmidecode by default --- openmptcprouter-full/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openmptcprouter-full/Makefile b/openmptcprouter-full/Makefile index eace2e5bd..8afa8bbcb 100644 --- a/openmptcprouter-full/Makefile +++ b/openmptcprouter-full/Makefile @@ -79,7 +79,8 @@ MY_DEPENDS := \ kmod-rt2800-usb kmod-rtl8xxxu kmod-rtl8192cu kmod-net-rtl8192su \ !TARGET_mvebu:luci-proto-qmi wpad-basic kmod-mt7601u kmod-rtl8187 \ luci-app-mlvpn mlvpn 464xlat !TARGET_mvebu:kmod-usb-net-smsc75xx kmod-zram kmod-swconfig swconfig kmod-ipt-nat kmod-ipt-nat6 luci-app-https-dns-proxy kmod-tcp-nanqinlang iptables-mod-ipopt igmpproxy ss iptraf-ng \ - luci-app-acl block-mount blockd fstools luci-app-shutdown libwebp luci-proto-gre tcptraceroute luci-proto-mbim kmod-rtl8xxxu kmod-ath9k-htc luci-app-ttyd luci-mod-dashboard (TARGET_x86||TARGET_x86_64):rtl8192eu-firmware kmod-usb2 libustream-wolfssl (TARGET_x86||TARGET_x86_64):kmod-ixgbevf + luci-app-acl block-mount blockd fstools luci-app-shutdown libwebp luci-proto-gre tcptraceroute luci-proto-mbim kmod-rtl8xxxu kmod-ath9k-htc luci-app-ttyd luci-mod-dashboard (TARGET_x86||TARGET_x86_64):rtl8192eu-firmware kmod-usb2 libustream-wolfssl (TARGET_x86||TARGET_x86_64):kmod-ixgbevf \ + hwinfo (TARGET_x86||TARGET_x86_64):dmidecode # luci-theme-bootstrap luci-theme-openwrt-2020 luci-theme-openwrt luci-app-status # luci-proto-bonding luci-app-statistics luci-proto-gre # softethervpn5-client softethervpn5-server luci-app-nginx-ha