Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote forwards fail when net.ipv6.conf.lo.disable_ipv6 sysctl is 1 #660

Open
coandco opened this issue Oct 2, 2024 · 0 comments
Open

Comments

@coandco
Copy link
Contributor

coandco commented Oct 2, 2024

I've been trying to run an EternalTerminal server on my machine and had gotten everything working, except remote port forwards would always fail with a cryptic error message:

$ et myhost -r 51022:22
Error initializing connection: Error binding port 51022: 99 Cannot assign requested address

$

I did some digging and found this in the server logfiles:

[INFO 2024-10-02 20:49:57,661 140286496671424 TcpSocketHandler.cpp:224] Listening on 127.0.0.1:51022/2/1/6

[WARNING 2024-10-02 20:49:57,661 140286496671424 TcpSocketHandler.cpp:204] Error binding 10/1/6: 99 Cannot assign requested address

So, it looked like it was able to successfully bind to IPv4 localhost, but was failing on IPv6 (the 10 in 10/1/6 refers to the AF_INET6 constant).

After doing a bunch of digging and experimentation, I tracked it down to the net.ipv6.conf.lo.disable_ipv6 sysctl, which I had set to 1 on my system because I'd had some issues with ipv6 in the past. As far as I can tell, what was happening was that EternalTerminal was looking up all addresses associated with localhost, coming up with both 127.0.0.1 and ::1, and trying to listen on each interface despite ipv6 being disabled, leading to the above error message. Setting net.ipv6.conf.lo.disable_ipv6 to 0 on the etserver system allowed it to succeed and successfully forward the remote port.

It might be worthwhile to detect when it's unable to bind to IPv6 and simply work with IPv4, rather than bailing entirely with a cryptic error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant