rathole icon indicating copy to clipboard operation
rathole copied to clipboard

TCP connection floods overwhelm the client

Open zzzorgo opened this issue 8 months ago • 3 comments

Describe the bug One of my rathole clients (not sure about the others) creates a lot of TCP connections without closing them. The half of the connections are in CLOSE_WAIT state and the other half in ESTABLISHED. This could be as bad as 1300+ simultaneous TCP connections for only two services.

To Reproduce Steps to reproduce the behavior:

  1. Start the server and the client
  2. Wait for about 24 hours

Configuration Configuration used to reproduce the behavior:

# client.toml
[client]
remote_addr = "XXXX:XXXX"

[client.transport]
type = "tls"

[client.transport.tls]
trusted_root = "XXXX.pem"

[client.services.local_balancer]
token = "XXXX"
local_addr = "127.0.0.1:8081"

[client.services.local_ssh]
token = "XXXX"
local_addr = "127.0.0.1:22"
# server.toml
[server]
bind_addr = "XXXX:XXXX"

[server.transport]
type = "tls"

[server.transport.tls]
pkcs12 = "XXXX.pfx"
pkcs12_password = "XXXX"

[server.services.local_balancer]
token = "XXXX"
bind_addr = "0.0.0.0:64115"

[server.services.local_ssh]
token = "XXXX"
bind_addr = "0.0.0.0:64116"

[server.services.local_balancer_bryansk]
token = "XXXX"
bind_addr = "0.0.0.0:64117"

[server.services.local_ssh_bryansk]
token = "XXXX"
bind_addr = "0.0.0.0:64118"

Logs Rathole log log.txt

Netstat output when the flood is there netstat.log

Netstat output after rathole process restarting netstat-after-restarting.log

Environment:

  • OS: Ubuntu 22.04.4 LTS
  • rathole --version output:
rathole 
Build Timestamp:     2024-05-19T09:14:41.914676647Z
Build Version:       0.5.0
Commit SHA:          None
Commit Date:         None
Commit Branch:       None
cargo Target Triple: x86_64-unknown-linux-musl
cargo Profile:       release
cargo Features:      base64,client,default,futures_core,futures_sink,hot_reload,native_tls,noise,notify,server,snowstorm,tokio_native_tls,tokio_tungstenite,tokio_util,websocket_native_tls
  • CPU architecture: x86
  • rustc version: not sure, most probably 1.78 (official docker image, compiled 18 days ago)

zzzorgo avatar Jun 06 '24 16:06 zzzorgo