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 remoteip '10.255.254.1'
 | 
			
		||||
	option mode 'to'
 | 
			
		||||
	option mode kxtimeout '7d'
 | 
			
		||||
	option mode timetolerance '10m'
 | 
			
		||||
	option mode keepalive '25s'
 | 
			
		||||
	option mode rateauto '0'
 | 
			
		||||
	option kxtimeout '7d'
 | 
			
		||||
	option timetolerance '10m'
 | 
			
		||||
	option keepalive '25s'
 | 
			
		||||
	option rateauto '0'
 | 
			
		||||
| 
						 | 
				
			
			@ -117,21 +117,22 @@ if [ -f /proc/sys/net/mptcp/mptcp_enabled ]; then
 | 
			
		|||
else
 | 
			
		||||
        ID=$(ip mptcp endpoint show | grep "dev $DEVICE" | awk '{print $3}')
 | 
			
		||||
        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
 | 
			
		||||
                "off")
 | 
			
		||||
                        [ -n "$ID" ] && ip mptcp endpoint delete id $ID
 | 
			
		||||
                        [ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
 | 
			
		||||
                        exit 0;;
 | 
			
		||||
                "on")
 | 
			
		||||
                        [ -n "$ID" ] && ip mptcp endpoint delete id $ID
 | 
			
		||||
                        ip mptcp endpoint add $IP dev $DEVICE subflow
 | 
			
		||||
                        [ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
 | 
			
		||||
                        ip mptcp endpoint add $IP dev $DEVICE subflow fullmesh
 | 
			
		||||
                        exit 0;;
 | 
			
		||||
                "signal")
 | 
			
		||||
                        [ -n "$ID" ] && ip mptcp endpoint delete id $ID
 | 
			
		||||
                        ip mptcp endpoint add $IP dev $DEVICE signal subflow
 | 
			
		||||
                        [ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
 | 
			
		||||
                        ip mptcp endpoint add $IP dev $DEVICE signal subflow fullmesh
 | 
			
		||||
                        exit 0;;
 | 
			
		||||
                "backup")
 | 
			
		||||
                        [ -n "$ID" ] && ip mptcp endpoint delete id $ID
 | 
			
		||||
                        ip mptcp endpoint add $IP dev $DEVICE backup
 | 
			
		||||
                        [ -n "$ID" ] && ip mptcp endpoint delete id $ID 2>&1 >/dev/null
 | 
			
		||||
                        ip mptcp endpoint add $IP dev $DEVICE backup fullmesh
 | 
			
		||||
                        exit 0;;
 | 
			
		||||
                "")
 | 
			
		||||
                        case "$IFF" in
 | 
			
		||||
| 
						 | 
				
			
			@ -139,6 +140,7 @@ else
 | 
			
		|||
                                "subflow")   echo $DEVICE is in default mode;;
 | 
			
		||||
                                "backup")    echo $DEVICE is in backup mode;;
 | 
			
		||||
                                "signal")    echo $DEVICE is in signal mode;;
 | 
			
		||||
                                "fullmesh")  echo $DEVICE is in fullmesh mode;;
 | 
			
		||||
                                *)           echo "$DEVICE Unkown state!" && exit 1;;
 | 
			
		||||
                        esac
 | 
			
		||||
                        exit 0;;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1101,7 +1101,7 @@ if [ "$multipath_config" = "on" ] || [ "$multipath_config" = "backup" ]; then
 | 
			
		|||
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
 | 
			
		||||
		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"
 | 
			
		||||
			multipath "$OMR_TRACKER_DEVICE" "$multipath_config"
 | 
			
		||||
		fi
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue