Skip to content

Unable to test connections from Windows or WSL/Ubuntu using this_addr & remote_addr as configured. #2058

@kustomzone

Description

@kustomzone

Even though Freenet's default Gateway WebSocket port has been changed to 7509, the localhost port used for connections is still excluded, as well as the remote address is unavailable for testing.

this_addr: 0.0.0.0:51745 <-- still within the excluded range on Windows. (see range 51714–51813 below)
remote_addr: 5.9.111.215:31337 <-- not available.

Windows excluded range:

netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

 (Start Port) (End Port), ...

│    49677  49776, 49877  49976, 50000  50059, 50060  50159, 50260  50359, 50460  50559,    │
│    50560  50659, 50660  50759, 50760  50859, 50974  51073, 51074  51173, 51514  51613,    │
│    51614  51713, 51714  51813, 51814  51913, 51914  52013                                 │  <---

Windows TCP remote connection failure:

Test-NetConnection -ComputerName 5.9.111.215 -Port 31337
WARNING: TCP connect to (5.9.111.215 : 31337) failed

ComputerName           : 5.9.111.215
RemoteAddress          : 5.9.111.215
RemotePort             : 31337
InterfaceAlias         : Wi-Fi
SourceAddress          : 192.168.43.241
PingSucceeded          : True
PingReplyDetails (RTT) : 560 ms
TcpTestSucceeded       : False

WSL / Ubuntu remote TCP connection failure:

 nc -zv 5.9.111.215 31337
nc: connect to 5.9.111.215 port 31337 (tcp) failed: Connection refused

 telnet 5.9.111.215 31337
Trying 5.9.111.215...
telnet: Unable to connect to remote host: Resource temporarily unavailable

MAIN ISSUE

The Gateway now connects with the new default port, but it's very hard to test when the remote address seems always unavailable, and the localhost port used to connect to the remote address still falls within an excluded range on Windows, as can be seen in this repeated sequence.

2025-11-06T10:53:00.054534Z  INFO freenet::transport::connection_handler: attempting to establish connection, remote_addr: 5.9.111.215:31337
    at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/freenet-0.1.36/src/transport/connection_handler.rs:542

  2025-11-06T10:59:55.490008Z ERROR freenet::transport::connection_handler: failed to establish connection after multiple attempts, max timeout reached, this_addr: 0.0.0.0:51745, remote_addr: 5.9.111.215:31337
    at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/freenet-0.1.36/src/transport/connection_handler.rs:947

  2025-11-06T10:59:55.491064Z ERROR freenet::transport::connection_handler: Failed to establish connection, error: failed while establishing connection, reason: max connection attempts reached, remote_addr: 5.9.111.215:31337
    at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/freenet-0.1.36/src/transport/connection_handler.rs:497

  2025-11-06T10:59:55.491890Z  INFO freenet::node::network_bridge::p2p_protoc: Connection failed: TransportError(ConnectionEstablishmentFailure { cause: "max connection attempts reached" }), peer_id: v6MWKgqHiBMNcGtG
    at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/freenet-0.1.36/src/node/network_bridge/p2p_protoc.rs:1163
    in freenet::node::network_bridge::p2p_protoc::network_event_listener with peer: v6MWKgqHYDhu4SKr

  2025-11-06T10:59:55.492785Z ERROR freenet::operations::connect: Failed while attempting connection to gateway, gateway: v6MWKgqHiBMNcGtG (@ 0.923911415153386), error: failed connect
    at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/freenet-0.1.36/src/operations/connect.rs:785

  2025-11-06T10:59:56.495312Z  INFO freenet::operations::connect: Below bootstrap threshold (0 < 4), attempting to connect to 1 gateways
    at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/freenet-0.1.36/src/operations/connect.rs:761

  2025-11-06T10:59:56.496143Z  INFO freenet::operations::connect: Attempting connection to gateway, gateway: v6MWKgqHiBMNcGtG (@ 0.923911415153386)
    at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/freenet-0.1.36/src/operations/connect.rs:773

  2025-11-06T10:59:56.496798Z  INFO freenet::operations::connect: Attempting network join, gateway.peer: v6MWKgqHiBMNcGtG
    at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/freenet-0.1.36/src/operations/connect.rs:848
    in freenet::operations::connect::join_ring_request with peer: v6MWKgqHYDhu4SKr

  2025-11-06T10:59:56.497465Z  INFO freenet::operations::connect: Connecting to gateway, tx: 01K9CD5EEGGT0XRFVX733EJSG0, gateway: v6MWKgqHiBMNcGtG (@ 0.923911415153386)
    at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/freenet-0.1.36/src/operations/connect.rs:911
    in freenet::operations::connect::join_ring_request with peer: v6MWKgqHYDhu4SKr

  2025-11-06T10:59:56.498307Z  INFO freenet::node::network_bridge::p2p_protoc: Connecting to peer, tx: 01K9CD5EEGGT0XRFVX733EJSG0, remote: v6MWKgqHiBMNcGtG
    at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/freenet-0.1.36/src/node/network_bridge/p2p_protoc.rs:1004
    in freenet::node::network_bridge::p2p_protoc::network_event_listener with peer: v6MWKgqHYDhu4SKr

  2025-11-06T10:59:56.499064Z  INFO freenet::transport::connection_handler: attempting to establish connection, remote_addr: 5.9.111.215:31337
    at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/freenet-0.1.36/src/transport/connection_handler.rs:542

"The repeated connection failures you're observing could indeed be related to the port being in an excluded range on Windows, possibly including while testing on WSL / Ubuntu"

Windows Port Exclusion
- Port 51745 falls within the range 51714–51813, which is part of an excluded port range on Windows.

WSL / Ubuntu and Port Exclusion
- WSL1/2 uses a translation layer for network communication between Windows and the Linux subsystem.
- While WSL does not directly use the same port exclusion rules as Windows (since it operates in its own network namespace), it can still be affected by them indirectly if traffic is routed through Windows' network stack or when using localhost (0.0.0.0) for communication, especially if you are interacting with a Windows-hosted service on that port.

.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-networkingArea: Networking, ring protocol, peer discoveryE-mediumExperience needed to fix/implement: Medium / intermediateP-mediumMedium priorityT-bugType: Something is broken

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions