Page 1 of 1

Client TCP connection is 0 but not reconnect or disconnect

Posted: Sat Mar 02, 2024 1:20 pm
by dfc643
Hi everyone,

I have a private network running in same ISP in my city.
the SoftEther as the access server without any function of layer-3.

the SoftEther can running properly in short time (less than 5 days).
the client connection will broken (but not disconnect) if client connected to server more than 5 days.

the fault manifests as:
1. client shows connected to the server properly.
2. client cannot ping any ip in private network (include gateway) replies timed out.
3. virtual hub shows client tcp connection is 0 in server side.
4. client network back to normal if client disconnect and reconnect.
5. whether client mode or cascade mode has the problem.
Image

logging (loop forever):

Code: Select all

2024-03-02 21:21:59.061 On the TCP Listener (Port 11000), a Client (IP address xx.xx.yy.yy, Host name "xx.xx.yy.yy", Port number xxyy) has connected.
2024-03-02 21:21:59.061 For the client (IP address: xx.xx.yy.yy, host name: "xx.xx.yy.yy", port number: xxyy), connection "CID-165146" has been created.
2024-03-02 21:21:59.091 SSL communication for connection "CID-165146" has been started. The encryption algorithm name is "TLS_AES_256_GCM_SHA384".
2024-03-02 21:21:59.101 Connection "CID-165146" has been terminated.
server side: openwrt / softether 5.01 dev
client side: windows / softether 4.38 (cascade) / softether 4.43 (client)

what expected:
1. client do redial if client network broken.

how to solve it? thx.

Re: Client TCP connection is 0 but not reconnect or disconnect

Posted: Sat Mar 02, 2024 1:36 pm
by solo
https://openwrt.org/packages/pkgdata/so ... vpn-server
I see 4.38-9760-2 there, try it instead of v5.

Re: Client TCP connection is 0 but not reconnect or disconnect

Posted: Sun Mar 03, 2024 1:16 am
by dfc643
solo wrote:
Sat Mar 02, 2024 1:36 pm
https://openwrt.org/packages/pkgdata/so ... vpn-server
I see 4.38-9760-2 there, try it instead of v5.
thank you! try it first. :)

Re: Client TCP connection is 0 but not reconnect or disconnect

Posted: Wed Mar 06, 2024 1:44 pm
by dfc643
i wrote a script to kick-out broken session finally :)

Code: Select all

#!/bin/sh
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
SEVPN_PORT="5555"
SEVPN_HUB="VPNHUB123"
SEVPN_PASS="*********"
SEVPN_CMD="/usr/bin/vpncmd /Server localhost:$SEVPN_PORT /Hub:$SEVPN_HUB /Password:$SEVPN_PASS /CSV /CMD"


#__force_disconnect_broken_sessions__
SE_BROKEN_SESSIONS=$($SEVPN_CMD SessionList | grep -E ',0 / [0-9]+,' | awk -F, '{print $1}')
echo "$SE_BROKEN_SESSIONS" | while read -r line ; do
	printf "%-60s" "Found broken session: $line, trying to disconnection ..."
	$SEVPN_CMD SessionDisconnect $line 2>&1 >/dev/null
	if [ $? -eq 0 ]; then
		printf "%20s\n" "[ Disconnected ]"
	else
		printf "%20s\n" "[ Failed ]"
	fi
done


echo "script finished!"
exit 0
put it in crontab

Code: Select all

#__disconnect_broken_session_sevpn__
10/* * * * * /root/sevpnhelper &
it works!