From c2d5dc3e0890f5fc2b151ad8c626eb788301f924 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 26 May 2021 13:13:22 +0200 Subject: [PATCH 1/8] Fix disable http test --- .../luasrc/controller/openmptcprouter.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 9aef3a1f7..7c354b690 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -1013,6 +1013,10 @@ function settings_add() local disableloopdetection = luci.http.formvalue("disableloopdetection") or "0" ucic:set("openmptcprouter","settings","disableloopdetection",disableloopdetection) + -- Enable/disable http test + local disableserverhttptest = luci.http.formvalue("disableserverhttptest") or "0" + ucic:set("openmptcprouter","settings","disableserverhttptest",disableserverhttptest) + -- Enable/disable renaming intf local disableintfrename = luci.http.formvalue("disableintfrename") or "0" ucic:set("openmptcprouter","settings","disableintfrename",disableintfrename) From 0aa234d36baeff38755ed0e4bfdede472b4c4d33 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 27 May 2021 07:35:23 +0200 Subject: [PATCH 2/8] Delete old mac when setting macvlan --- macvlan/files/etc/init.d/macvlan | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/macvlan/files/etc/init.d/macvlan b/macvlan/files/etc/init.d/macvlan index 2832e5133..b38597eff 100755 --- a/macvlan/files/etc/init.d/macvlan +++ b/macvlan/files/etc/init.d/macvlan @@ -81,10 +81,12 @@ _setup_interface() { set network.$1.masterintf=$_ifname set network.$1.type=macvlan set network.$1.defaultroute=0 + delete network.$1.macaddr EOF #_macaddr=$(uci -q get "network.$1.macaddr") - _setup_macaddr "$1" "${_macaddr:-auto$(date +%s)}" + #_setup_macaddr "$1" "${_macaddr:-auto$(date +%s)}" + _setup_macaddr "$1" "auto$(date +%s)" uci -q set network.$1_dev.mtu=$(uci -q get network.$1.mtu) uci -q commit network } From d5fd515873098434fcc2e7b6f918ca4c266db146 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 28 May 2021 17:47:33 +0200 Subject: [PATCH 3/8] Initialize resolv.conf --- openmptcprouter/files/etc/uci-defaults/1940-omr-dns | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openmptcprouter/files/etc/uci-defaults/1940-omr-dns b/openmptcprouter/files/etc/uci-defaults/1940-omr-dns index 21efcdfee..705c30225 100755 --- a/openmptcprouter/files/etc/uci-defaults/1940-omr-dns +++ b/openmptcprouter/files/etc/uci-defaults/1940-omr-dns @@ -199,6 +199,10 @@ if [ -z "$(uci -q get unbound.fwd_adguard_family)" ]; then EOF fi +if [ -z "$(grep nameserver /etc/resolv.conf)" ]; then + echo "nameserver 127.0.0.1" > /etc/resolv.conf +fi + rm -f /tmp/luci-indexcache exit 0 From 7840a05a8a0480e139dac39bdfcc66f00b666b3d Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 28 May 2021 17:48:24 +0200 Subject: [PATCH 4/8] Add option to enable/disable nDPI --- .../root/etc/init.d/omr-bypass | 40 ++++++++++--------- .../luasrc/controller/openmptcprouter.lua | 4 ++ .../luasrc/view/openmptcprouter/settings.htm | 10 +++++ 3 files changed, 35 insertions(+), 19 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 164f6e42e..2b8f56972 100755 --- a/luci-app-omr-bypass/root/etc/init.d/omr-bypass +++ b/luci-app-omr-bypass/root/etc/init.d/omr-bypass @@ -341,31 +341,33 @@ _bypass_proto() { [ -z "$intf" ] && intf="all" [ -z "$proto" ] && return - if [ "$intf" = "all" ]; then - iptables-restore -w --wait=60 --noflush <<-EOF - *mangle - -A omr-bypass-dpi -m ndpi --proto $proto -j MARK --set-mark 0x539 - COMMIT - EOF - if [ "$disableipv6" = "0" ]; then - ip6tables-restore -w --wait=60 --noflush <<-EOF + if [ "$(uci -q get openmptcprouter.settings.ndpi)" != "0" ]; then + if [ "$intf" = "all" ]; then + iptables-restore -w --wait=60 --noflush <<-EOF *mangle - -A omr-bypass6-dpi -m ndpi --proto $proto -j MARK --set-mark 0x6539 + -A omr-bypass-dpi -m ndpi --proto $proto -j MARK --set-mark 0x539 COMMIT EOF - fi - else - iptables-restore -w --wait=60 --noflush <<-EOF - *mangle - -A omr-bypass-dpi -m ndpi --proto $proto -j MARK --set-mark 0x539$intfid - COMMIT - EOF - if [ "$disableipv6" = "0" ]; then - ip6tables-restore -w --wait=60 --noflush <<-EOF + if [ "$disableipv6" = "0" ]; then + ip6tables-restore -w --wait=60 --noflush <<-EOF + *mangle + -A omr-bypass6-dpi -m ndpi --proto $proto -j MARK --set-mark 0x6539 + COMMIT + EOF + fi + else + iptables-restore -w --wait=60 --noflush <<-EOF *mangle - -A omr-bypass6-dpi -m ndpi --proto $proto -j MARK --set-mark 0x6539$intfid + -A omr-bypass-dpi -m ndpi --proto $proto -j MARK --set-mark 0x539$intfid COMMIT EOF + if [ "$disableipv6" = "0" ]; then + ip6tables-restore -w --wait=60 --noflush <<-EOF + *mangle + -A omr-bypass6-dpi -m ndpi --proto $proto -j MARK --set-mark 0x6539$intfid + COMMIT + EOF + fi fi fi # Use dnsmasq ipset to bypass domains of the proto diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 7c354b690..3d243b210 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -1041,6 +1041,10 @@ function settings_add() local shadowsocksudp = luci.http.formvalue("shadowsocksudp") or "0" ucic:set("openmptcprouter","settings","shadowsocksudp",shadowsocksudp) + -- Enable/disable nDPI + local ndpi = luci.http.formvalue("ndpi") or "1" + ucic:set("openmptcprouter","settings","ndpi",ndpi) + -- Enable/disable fast open local disablefastopen = luci.http.formvalue("disablefastopen") or "0" if disablefastopen == "0" then diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm index 67bfa50c1..c866f921e 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm @@ -331,6 +331,16 @@ +
+ +
+ checked<% end %>> +
+
+ <%:Disable nDPI, used for protocols in OMR-ByPass%> +
+
+
From da3834c40702789f58dc55114953427a3ed311c9 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 28 May 2021 17:48:51 +0200 Subject: [PATCH 5/8] Remove bond0 in interface choice --- luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index c921dca30..2c33cfa2d 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -971,7 +971,7 @@