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 #142 from Ysurac/develop

sync
This commit is contained in:
suyuan 2021-05-30 00:03:27 +08:00 committed by GitHub
commit 1370355f83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 56 additions and 24 deletions

View file

@ -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

View file

@ -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)
@ -1037,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

View file

@ -331,6 +331,16 @@
</div>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Disable nDPI%></label>
<div class="cbi-value-field">
<input type="checkbox" name="ndpi" class="cbi-input-checkbox" value="0" <% if luci.model.uci.cursor():get("openmptcprouter","settings","ndpi") == "0" then %>checked<% end %>>
<br />
<div class="cbi-value-description">
<%:Disable nDPI, used for protocols in OMR-ByPass%>
</div>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Disable ModemManager%></label>
<div class="cbi-value-field">

View file

@ -971,7 +971,7 @@
<select class="cbi-section-create-name" name="add_interface_ifname">
<%
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.*")) and device_notvirtual(ifacea) then
if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or iface == "bond0" 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
%>
<option value="<%=ifacea%>"><%=ifacea%></option>
<%

View file

@ -790,12 +790,12 @@ function interfaces_status()
end
if uci:get("openmptcprouter","settings","external_check") ~= "0" and mArray.openmptcprouter["dns"] == true then
if mArray.openmptcprouter["service_addr_ip"] ~= "" and mArray.openmptcprouter["service_addr_ip"] ~= nil then
--if mArray.openmptcprouter["service_addr_ip"] ~= "" and mArray.openmptcprouter["service_addr_ip"] ~= nil then
mArray.openmptcprouter["wan_addr"] = ut.trim(sys.exec("curl -4 -s -m " .. timeout .. " " .. check_ipv4_website))
if mArray.openmptcprouter["wan_addr"] == "" then
mArray.openmptcprouter["wan_addr"] = ut.trim(sys.exec("dig -4 TXT +timeout=" .. timeout .. " +tries=1 +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'\"' '{print $2}'"))
end
end
--end
if mArray.openmptcprouter["ipv6"] == "enabled" or ( mArray.openmptcprouter["service_addr_ip6"] ~= "" and mArray.openmptcprouter["service_addr_ip6"] ~= nil) then
mArray.openmptcprouter["wan_addr6"] = uci:get("openmptcprouter","omr","public_detected_ipv6") or ""
if mArray.openmptcprouter["wan_addr6"] == "" then
@ -1550,6 +1550,9 @@ function interfaces_status()
table.insert(mArray.wans, data);
end
end)
if next(mArray.wans) == nil then
mArray.openmptcprouter["direct_output"] = true
end
--luci.http.prepare_content("application/json")
--luci.http.write_json(mArray)

View file

@ -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
}

View file

@ -78,7 +78,7 @@ MY_DEPENDS := \
!TARGET_mvebu:umbim !TARGET_mvebu:kmod-mii !TARGET_mvebu:kmod-usb-net !TARGET_mvebu:kmod-usb-wdm !TARGET_mvebu:kmod-usb-net-qmi-wwan !TARGET_mvebu:kmod-usb-net-cdc-mbim !TARGET_mvebu:umbim \
!TARGET_mvebu:kmod-usb-net-huawei-cdc-ncm !TARGET_mvebu:kmod-usb-net-rndis !TARGET_mvebu:kmod-usb-net-cdc-ether !TARGET_mvebu:kmod-usb-net-ipheth !TARGET_mvebu:usbmuxd \
kmod-rt2800-usb kmod-rtl8xxxu kmod-rtl8192cu kmod-net-rtl8192su kmod-rtl8812au-ct \
!TARGET_mvebu:luci-proto-qmi wpad-basic kmod-mt7601u kmod-rtl8187 \
!TARGET_mvebu:luci-proto-qmi wpad-basic kmod-mt7601u kmod-rtl8187 TARGET_r4s:kmod-r8168 (TARGET_x86||TARGET_x86_64):kmod-usb-net-rtl8152 \
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 (TARGET_x86_64||aarch64):kmod-tcp-bbr2 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 \
hwinfo (TARGET_x86||TARGET_x86_64):dmidecode luci-app-packet-capture kmod-bonding luci-proto-bonding luci-app-sysupgrade \

View file

@ -0,0 +1,3 @@
#!/bin/sh
# Needed for some device, like rtl8156 2.5G USB adapter
[ "$ACTION" = "ifup" ] && [ -n "$DEVICE" ] && ethtool -s $DEVICE autoneg on

View file

@ -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