mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
commit
f655a4583f
3 changed files with 14 additions and 12 deletions
|
@ -8,7 +8,7 @@ config glorytun-udp 'vpn'
|
||||||
option localip '10.255.254.2'
|
option localip '10.255.254.2'
|
||||||
option remoteip '10.255.254.1'
|
option remoteip '10.255.254.1'
|
||||||
option mode 'to'
|
option mode 'to'
|
||||||
option mode kxtimeout '7d'
|
option kxtimeout '7d'
|
||||||
option mode timetolerance '10m'
|
option timetolerance '10m'
|
||||||
option mode keepalive '25s'
|
option keepalive '25s'
|
||||||
option mode rateauto '0'
|
option rateauto '0'
|
|
@ -117,21 +117,22 @@ if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then
|
||||||
else
|
else
|
||||||
ID=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $3}')
|
ID=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $3}')
|
||||||
IFF=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $4}')
|
IFF=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $4}')
|
||||||
|
IP=$(ifconfig $DEVICE | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
|
||||||
case $TYPE in
|
case $TYPE in
|
||||||
"off")
|
"off")
|
||||||
[ -n "$ID" ] && ip mptcp endpoint delete id $ID
|
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
||||||
exit 0;;
|
exit 0;;
|
||||||
"on")
|
"on")
|
||||||
[ -n "$ID" ] && ip mptcp endpoint delete id $ID
|
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
||||||
ip mptcp endpoint add $IP dev $DEVICE subflow
|
ip mptcp endpoint add $IP dev $DEVICE subflow fullmesh
|
||||||
exit 0;;
|
exit 0;;
|
||||||
"signal")
|
"signal")
|
||||||
[ -n "$ID" ] && ip mptcp endpoint delete id $ID
|
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
||||||
ip mptcp endpoint add $IP dev $DEVICE signal subflow
|
ip mptcp endpoint add $IP dev $DEVICE signal subflow fullmesh
|
||||||
exit 0;;
|
exit 0;;
|
||||||
"backup")
|
"backup")
|
||||||
[ -n "$ID" ] && ip mptcp endpoint delete id $ID
|
[ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
|
||||||
ip mptcp endpoint add $IP dev $DEVICE backup
|
ip mptcp endpoint add $IP dev $DEVICE backup fullmesh
|
||||||
exit 0;;
|
exit 0;;
|
||||||
"")
|
"")
|
||||||
case "$IFF" in
|
case "$IFF" in
|
||||||
|
@ -139,6 +140,7 @@ else
|
||||||
"subflow") echo $DEVICE is in default mode;;
|
"subflow") echo $DEVICE is in default mode;;
|
||||||
"backup") echo $DEVICE is in backup mode;;
|
"backup") echo $DEVICE is in backup mode;;
|
||||||
"signal") echo $DEVICE is in signal mode;;
|
"signal") echo $DEVICE is in signal mode;;
|
||||||
|
"fullmesh") echo $DEVICE is in fullmesh mode;;
|
||||||
*) echo "$DEVICE Unkown state!" && exit 1;;
|
*) echo "$DEVICE Unkown state!" && exit 1;;
|
||||||
esac
|
esac
|
||||||
exit 0;;
|
exit 0;;
|
||||||
|
|
|
@ -1101,7 +1101,7 @@ if [ "$multipath_config" = "on" ] || [ "$multipath_config" = "backup" ]; then
|
||||||
fi
|
fi
|
||||||
[ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] && {
|
[ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] && {
|
||||||
[ "$multipath_status" = "$multipath_config" ] || {
|
[ "$multipath_status" = "$multipath_config" ] || {
|
||||||
if [ "$(sysctl -n net.mptcp.mptcp_enabled | tr -d '\n')" = "1" ]; then
|
if [ "$(sysctl -qn net.mptcp.mptcp_enabled | tr -d '\n')" = "1" ] || [ "$(sysctl -qn net.mptcp.enabled | tr -d '\n')" = "1" ]; then
|
||||||
_log "Multipath $OMR_TRACKER_DEVICE switched to $multipath_config"
|
_log "Multipath $OMR_TRACKER_DEVICE switched to $multipath_config"
|
||||||
multipath "$OMR_TRACKER_DEVICE" "$multipath_config"
|
multipath "$OMR_TRACKER_DEVICE" "$multipath_config"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue