Bug #14676
open
Listening Port option in the Tailscale configurator is not respected
Added by David G about 1 year ago.
Updated 6 months ago.
Description
The tailscaled process starts and listens on a random port, instead of the one specified. This causes things like direct tunnels between tailscale node to not work (WAN rule), thus causing all traffic to be relayed when the other device is behind double NAT or other hard NAT types. If I go and see what port is actually being used and adjust me WAN rule, suddenly direct connections are all established.
How to reproduce:
1. Set a listening port
2. Start the tailscale service
3. View what the actual port is being listened on by executing "sockstat -l"
Files
Tested on 2.7.0 and 23.05.1 , Tailscale 0.1.4
Can not reproduce, if I change listen port it always changed appropriate the settings
![](/attachments/download/5256/clipboard-202308101325-uwqzq.png)
![](/attachments/download/5260/clipboard-202308101331-bq7cl.png)
I'm not able to replicate this report myself.
Christian McDonald wrote in #note-2:
I'm not able to replicate this report myself.
Here are some screenshots of the issue happening on my end. I will try to reinstall the package and see what happens.
![](/attachments/download/5262/Screenshot%202023-08-10%20094756.png)
![](/attachments/download/5263/Screenshot%202023-08-10%20094710.png)
David G wrote in #note-3:
Christian McDonald wrote in #note-2:
I'm not able to replicate this report myself.
Here are some screenshots of the issue happening on my end. I will try to reinstall the package and see what happens.
![](/attachments/download/5262/Screenshot%202023-08-10%20094756.png)
![](/attachments/download/5263/Screenshot%202023-08-10%20094710.png)
After reinstalling the package, the service started back up, however, now it's listening on different random ports.
![](/attachments/download/5264/Screenshot%202023-08-10%20100819.png)
I bet something else is already listening on 11111, forcing tailscaled to choose another port to bind.
- Status changed from New to Not a Bug
Christian McDonald wrote in #note-5:
I bet something else is already listening on 11111, forcing tailscaled to choose another port to bind.
I just tried another port, but also confirmed nothing is listening on it before setting it. I also completely killed the tailscaled process and started it back up. The next thing I tried was a log out and clean, but that also did not do anything. The port is still random. Anything else I can try?
David G wrote in #note-7:
Christian McDonald wrote in #note-5:
I bet something else is already listening on 11111, forcing tailscaled to choose another port to bind.
I just tried another port, but also confirmed nothing is listening on it before setting it. I also completely killed the tailscaled process and started it back up. The next thing I tried was a log out and clean, but that also did not do anything. The port is still random. Anything else I can try?
Alright, I found the issue. If I don't use a custom control server and use tailscales, the issue does not occur and the port setting is respected. As soon as I specify my own control server, the port is randomized. Please confirm if this is reproducible on your end.
- Status changed from Not a Bug to Confirmed
The same behaviour on
23.09.1-RELEASE (amd64)
built on Tue Jan 30 15:33:00 MST 2024
FreeBSD 14.0-CURRENT
If use custom server te listen ports are randomized
Also available in: Atom
PDF