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

Merge branch 'test' into develop

This commit is contained in:
suyuan 2020-11-20 11:05:42 +08:00
commit ec0255f01d
9 changed files with 32 additions and 44 deletions

View file

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

View file

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

View file

@ -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
%>
<option value="<%=ifacea%>"<% if uci:get("network",ifname,"ifname") == ifacea then iffind = 1 %> selected="selected"<% end %>><%=ifacea%></option>
@ -485,7 +486,7 @@
<select class="cbi-input-select" data-update="change" id="cbid.network.<%=ifname%>.masterintf" name="cbid.network.<%=ifname%>.masterintf" size="1">
<%
for _, ifacea in ipairs(ifaces) do
if not (ifacea == "lo" or ifacea == "6in4-omr6in4" 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: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
%>
<option value="<%=ifacea%>"<% if uci:get("network",ifname,"masterintf") == ifacea then %> selected="selected"<% end %>><%=ifacea%></option>
<%
@ -808,7 +809,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.*")) 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
%>
<option value="<%=ifacea%>"><%=ifacea%></option>
<%

View file

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

View file

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

View file

@ -78,6 +78,7 @@ _launch_tracker() {
procd_set_param respawn 0 10 0
procd_set_param stderr 1
procd_close_instance
sleep 1
}
_launch_server_tracker() {

View file

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

View file

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

View file

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