mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
commit
11ebf9b005
4 changed files with 23 additions and 9 deletions
|
@ -131,6 +131,14 @@ if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then
|
||||||
|
|
||||||
printf "0x%02x" $(($(($IFF^$(($IFF&$IFF_MASK))))|$FLAG)) > $FLAG_PATH
|
printf "0x%02x" $(($(($IFF^$(($IFF&$IFF_MASK))))|$FLAG)) > $FLAG_PATH
|
||||||
else
|
else
|
||||||
|
# Remove not needed if* interfaces in MPTCP
|
||||||
|
oldintfs=$(ip mptcp endpoint show | grep "dev eth" | awk '{ print $3 }')
|
||||||
|
[ -n "$oldintfs" ] && {
|
||||||
|
for oldintf in $oldintfs; do
|
||||||
|
ip mptcp endpoint delete id $oldintf 2>&1 >/dev/null
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
ID=$(ip mptcp endpoint show | grep -m 1 "dev $DEVICE" | awk '{print $3}')
|
ID=$(ip mptcp endpoint show | grep -m 1 "dev $DEVICE" | awk '{print $3}')
|
||||||
IFF=$(ip mptcp endpoint show | grep -m 1 "dev $DEVICE" | awk '{print $4}')
|
IFF=$(ip mptcp endpoint show | grep -m 1 "dev $DEVICE" | awk '{print $4}')
|
||||||
IP=$(ip a show $DEVICE | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
|
IP=$(ip a show $DEVICE | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
|
||||||
|
|
|
@ -129,15 +129,21 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get openmptcprouter.$OMR_TRAC
|
||||||
elif [ -n "$OMR_TRACKER_DEVICE_IP" ]; then
|
elif [ -n "$OMR_TRACKER_DEVICE_IP" ]; then
|
||||||
[ -n "$serverip" ] && [ "$serverip" != "127.0.0.1" ] && {
|
[ -n "$serverip" ] && [ "$serverip" != "127.0.0.1" ] && {
|
||||||
local mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP $serverip)
|
local mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP $serverip)
|
||||||
[ -n "$mtu" ] && {
|
[ -n "$mtu" ] && [ "$mtu" != "$(ip --json link show dev $OMR_TRACKER_DEVICE | jsonfilter -e '@[0].mtu' | tr -d '\n')" ] && {
|
||||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu
|
mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP $serverip)
|
||||||
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
|
[ -n "$mtu" ] && [ "$mtu" != "$(ip --json link show dev $OMR_TRACKER_DEVICE | jsonfilter -e '@[0].mtu' | tr -d '\n')" ] && {
|
||||||
|
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu
|
||||||
|
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} || {
|
} || {
|
||||||
local mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP 1.1.1.1)
|
local mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP 1.1.1.1)
|
||||||
[ -n "$mtu" ] && {
|
[ -n "$mtu" ] && [ "$mtu" != "$(ip --json link show dev $OMR_TRACKER_DEVICE | jsonfilter -e '@[0].mtu' | tr -d '\n')" ] && {
|
||||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu
|
mtu=$(omr-mtu $OMR_TRACKER_DEVICE_IP $serverip)
|
||||||
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
|
[ -n "$mtu" ] && [ "$mtu" != "$(ip --json link show dev $OMR_TRACKER_DEVICE | jsonfilter -e '@[0].mtu' | tr -d '\n')" ] && {
|
||||||
|
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.mtu=$mtu
|
||||||
|
ip link set dev $OMR_TRACKER_DEVICE mtu $mtu > /dev/null 2>&1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -450,7 +450,7 @@ add_v2ray_redirect_rules() {
|
||||||
commandline="-l ${port} -s $OUTBOUND_SERVERS_V4 --rule-name def --src-default forward --dst-default forward --local-default forward"
|
commandline="-l ${port} -s $OUTBOUND_SERVERS_V4 --rule-name def --src-default forward --dst-default forward --local-default forward"
|
||||||
[ "$(uci -q get v2ray.main_transparent_proxy.redirect_udp)" = "1" ] && ([ "$(uci -q get v2ray.omrout.protocol)" = "vless" ] || [ "$(uci -q get v2ray.omrout.protocol)" = "vmess" ]) && commandline="$commandline -L ${port}"
|
[ "$(uci -q get v2ray.main_transparent_proxy.redirect_udp)" = "1" ] && ([ "$(uci -q get v2ray.omrout.protocol)" = "vless" ] || [ "$(uci -q get v2ray.omrout.protocol)" = "vmess" ]) && commandline="$commandline -L ${port}"
|
||||||
v2ray-rules $commandline
|
v2ray-rules $commandline
|
||||||
[ "$(uci -q get v2ray.main.inbounds | grep omr6)" != "" ] && {
|
[ "$(uci -q get v2ray.main.inbounds | grep omr6)" != "" ] && [ -n "$OUTBOUND_SERVERS_V6" ] && {
|
||||||
v2ray-rules6 -f
|
v2ray-rules6 -f
|
||||||
commandline="-l $((port+1)) -L $((port+1)) -s $OUTBOUND_SERVERS_V6 --rule-name def --src-default forward --dst-default forward --local-default forward"
|
commandline="-l $((port+1)) -L $((port+1)) -s $OUTBOUND_SERVERS_V6 --rule-name def --src-default forward --dst-default forward --local-default forward"
|
||||||
[ "$(uci -q get v2ray.main_transparent_proxy.redirect_udp)" = "1" ] && ([ "$(uci -q get v2ray.omrout.protocol)" = "vless" ] || [ "$(uci -q get v2ray.omrout.protocol)" = "vmess" ]) && commandline="$commandline -L ${port+1}"
|
[ "$(uci -q get v2ray.main_transparent_proxy.redirect_udp)" = "1" ] && ([ "$(uci -q get v2ray.omrout.protocol)" = "vless" ] || [ "$(uci -q get v2ray.omrout.protocol)" = "vmess" ]) && commandline="$commandline -L ${port+1}"
|
||||||
|
|
|
@ -52,7 +52,7 @@ Usage: v2ray-rules6 [options]
|
||||||
--local-default <bypass|forward|checkdst>
|
--local-default <bypass|forward|checkdst>
|
||||||
Default action for local out TCP traffic
|
Default action for local out TCP traffic
|
||||||
|
|
||||||
The following ipsets will be created by ss-rules. They are also intended to be
|
The following ipsets will be created by v2ray-rules. They are also intended to be
|
||||||
populated by other programs like dnsmasq with ipset support
|
populated by other programs like dnsmasq with ipset support
|
||||||
|
|
||||||
v2ray_rules6_src_bypass
|
v2ray_rules6_src_bypass
|
||||||
|
@ -73,7 +73,7 @@ o_dst_default=bypass
|
||||||
o_local_default=bypass
|
o_local_default=bypass
|
||||||
|
|
||||||
__errmsg() {
|
__errmsg() {
|
||||||
echo "ss-rules6: $*" >&2
|
echo "v2ray-rules6: $*" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
v2ray_rules6_parse_args() {
|
v2ray_rules6_parse_args() {
|
||||||
|
|
Loading…
Reference in a new issue