tcp 0 0 192.168.121.129:40830 192.168.121.1:49000 VERBUNDEN 1449463/vdr
tcp 0 0 192.168.121.129:2049 192.168.121.137:939 VERBUNDEN -
tcp 0 0 192.168.121.129:2049 192.168.121.139:912 VERBUNDEN -
tcp 45 0 192.168.121.129:5143 192.168.121.24:41072 VERBUNDEN -
tcp 0 0 192.168.121.129:22 192.168.121.137:55826 VERBUNDEN 1475830/sshd-sessio
tcp 0 0 192.168.121.129:2049 192.168.121.143:857 VERBUNDEN -
tcp 0 0 192.168.121.129:22 192.168.121.137:42194 VERBUNDEN 1479707/sshd-sessio
tcp 45 0 192.168.121.129:5143 192.168.121.24:43014 VERBUNDEN -
tcp 45 0 192.168.121.129:5143 192.168.121.33:56454 VERBUNDEN -
tcp 0 0 192.168.121.129:5143 192.168.121.33:52444 VERBUNDEN 1460557/VBoxHeadles
from time to time network sockets are stuck for a very long time when
the client is no longer online:
netstat -4np
tcp 0 0 192.168.121.129:40830 192.168.121.1:49000
VERBUNDEN 1449463/vdr tcp 0 0
192.168.121.129:2049 192.168.121.137:939 VERBUNDEN -
tcp 0 0 192.168.121.129:2049 192.168.121.139:912
VERBUNDEN - tcp 45 0
192.168.121.129:5143 192.168.121.24:41072 VERBUNDEN -
tcp 0 0 192.168.121.129:22 192.168.121.137:55826
VERBUNDEN 1475830/sshd-sessio tcp 0 0
192.168.121.129:2049 192.168.121.143:857 VERBUNDEN -
tcp 0 0 192.168.121.129:22 192.168.121.137:42194
VERBUNDEN 1479707/sshd-sessio tcp 45 0
192.168.121.129:5143 192.168.121.24:43014 VERBUNDEN -
tcp 45 0 192.168.121.129:5143 192.168.121.33:56454
VERBUNDEN - tcp 0 0
192.168.121.129:5143 192.168.121.33:52444 VERBUNDEN
1460557/VBoxHeadles
The clients 192.168.121.24 is disconnected for at least an hour, but
the sockets at the server seem to stay for an infinite time.
At some point I can no longer connect to the service at :5143. The
client software (xfreerdp) just hangs.
The only way to recover from this state is to end the listening
process. Since this is a virtual machine this option is not very
applicable.
The lost connections are often related to client network disconnects,
e.g. by a laptop entering suspend or WLAN interference. But this
should result in a socket with state CLOSE_WAIT which is cleaned up
after a short time. Of course, it is not reproducible. It happens only
from time to time.
How can I force the sockets to disconnect?
System is Debian 13 running VBox headless VMs. (I do not use VBox NAT.)
The clients 192.168.121.24 is disconnected for at least an hour, but the sockets at the server seem to stay for an infinite time.
On Thu, 12 Jun 2025 12:54:16 +0200, Marcel Mueller wrote:
The clients 192.168.121.24 is disconnected for at least an hour, but the
sockets at the server seem to stay for an infinite time.
This to me points to a defect in the protocol, that it does not
periodically exchange "are you there?" packets (even, say, once every 1 minute or 5 minutes), just to be sure the other end is still up.
Am 13.06.25 um 14:38 schrieb Computer Nerd Kev:
Mosh, which uses UDP, handles that better though.
UDP sadly fails if a NAT router is in between. Since it cannot know when
the connection is closed it just discards the port after a timeout w/o traffic, typically only a few minutes.
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On Thu, 12 Jun 2025 12:54:16 +0200, Marcel Mueller wrote:
The clients 192.168.121.24 is disconnected for at least an hour, but
the sockets at the server seem to stay for an infinite time.
This to me points to a defect in the protocol, that it does not
periodically exchange "are you there?" packets (even, say, once every 1
minute or 5 minutes), just to be sure the other end is still up.
But maybe the network connection was just interrupted and it'll be back
in a few minutes?
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On Thu, 12 Jun 2025 12:54:16 +0200, Marcel Mueller wrote:
The clients 192.168.121.24 is disconnected for at least an hour, but the >>> sockets at the server seem to stay for an infinite time.
This to me points to a defect in the protocol, that it does not
periodically exchange "are you there?" packets (even, say, once every 1
minute or 5 minutes), just to be sure the other end is still up.
But maybe the network connection was just interrupted and it'll be
back in a few minutes? Since my home internet via mobile broadband
is unreliable that often happens during SSH sessions. I can come
back in 15min and my SSH terminals are all working again after the
signal came back (well, not always, but sometimes).
Mosh, which
uses UDP, handles that better though.
AFAIR Classic recommendation is to change tcp keep_alive timeout.
It changes when kernel checks (sends probe packets) over inactive
tcp connection. The default is after 2 hours (7200 seconds).
AFAIR some people reported changing it to 10 or 15 minutes.
Am 13.06.25 um 14:38 schrieb Computer Nerd Kev:
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On Thu, 12 Jun 2025 12:54:16 +0200, Marcel Mueller wrote:
The clients 192.168.121.24 is disconnected for at least an hour, but the >>>> sockets at the server seem to stay for an infinite time.
This to me points to a defect in the protocol, that it does not
periodically exchange "are you there?" packets (even, say, once every 1
minute or 5 minutes), just to be sure the other end is still up.
But maybe the network connection was just interrupted and it'll be
back in a few minutes? Since my home internet via mobile broadband
is unreliable that often happens during SSH sessions. I can come
back in 15min and my SSH terminals are all working again after the
signal came back (well, not always, but sometimes).
For this purpose I would recommend "screen". It keeps your ssh session
as long as you like.
Mosh, which
uses UDP, handles that better though.
UDP sadly fails if a NAT router is in between. Since it cannot know when
the connection is closed it just discards the port after a timeout w/o traffic, typically only a few minutes.
UDP sadly fails if a NAT router is in between. Since it cannot know when
the connection is closed it just discards the port after a timeout w/o
traffic, typically only a few minutes.
Is there any way to change the timeout period?
Sysop: | Luis Silva |
---|---|
Location: | Lisbon |
Users: | 764 |
Nodes: | 10 (0 / 10) |
Uptime: | 126:47:52 |
Calls: | 278 |
Files: | 46,971 |
Messages: | 13,508 |