Syncthing won't let me configure a port other than default 22000

Hi. I’m trying to customize my syncthing configuration not using the default port 22000. After 5 hours doing some tests, I haven’t been able to configure the way I have in mind. Here is my problem:

Let’s say I want to use port 22001 instead of 22000 on computer (A). I have opened both ports (22000 and 22001) in my router pointing to my linux machine (A) with syncthing 0.14.9. No firewalls etc.

My other device for tests (B) is windows machine 30km away which router ports are not configured. I read that only one machine at one side is needed to be configured-open to be able to do a direct connection (seems true when testing, see:).

They sync without problem but by default they do it through a relay. It’s logical, by default both routers has ports closed.

If set them this way:

Machine (A) port 22000 open (confirmed OPEN as soon as I run syncthing service (checked using canyouseeme.org) Syncthing settings->Sync Protocol Listen Addresses->‘default’

root@raspberrypi:/home/pi/.config/syncthing# netstat -tulpn |grep syncthing
tcp6       0      0 :::9084                 :::*                    LISTEN      5756/syncthing
tcp6       0      0 :::22000                :::*                    LISTEN      5756/syncthing
udp        0      0 0.0.0.0:21027           0.0.0.0:*                           5756/syncthing
udp        0      0 0.0.0.0:33377           0.0.0.0:*                           5756/syncthing
udp6       0      0 :::39614                :::*                                5756/syncthing
udp6       0      0 :::21027                :::*                                5756/syncthing

(notice syncthing listening on port 22000)

Machine (B) ports unconfigured Syncthing settings->Sync Protocol Listen Addresses->‘default’

Correct behaviour. Direct connection between both machines. Not relay used. No red alert sign.

------------TRYING TO CHANGE DEFAULT PORT TO 22001 on (A). Machine (A) Syncthing settings->Sync Protocol Listen Addresses-> ':22001’ port 22001 open on router (seems closed after starting syncthing)

root@raspberrypi:/home/pi/.config/syncthing# netstat -tulpn |grep syncthing
tcp6       0      0 :::9084                 :::*                    LISTEN      5899/syncthing
udp        0      0 0.0.0.0:21027           0.0.0.0:*                           5899/syncthing
udp        0      0 0.0.0.0:58775           0.0.0.0:*                           5899/syncthing
udp6       0      0 :::59837                :::*                                5899/syncthing
udp6       0      0 :::21027                :::*                                5899/syncthing

(notice syncthing listening port dissapeared. Neither 22000 or 22001)

Machine (B) ports unconfigured Syncthing settings->Sync Protocol Listen Addresses->‘default’

Wrong behaivour. Connect using relay. Red exclamation alert sign. Why is not using port 22001?.

Is like syncthing don’t like the way I enter the ‘sync protocol listen address’ field. I tried: ’:22001’ also ‘0.0.0.0:22001’ and I think ‘[::]:22001’. The only thing that work and that make netstat reflect an open port is entering ‘default’ on that field, but I’m restricted to 22000 that way.

Am I doing something wrong with the syntax? (I tried editing config.xml too, no luck). What should I do to use my personallized ports?.

 Thanks for your help.

Try tcp://:22001

:open_mouth: :open_mouth: It worked!!!. I read many many posts about configuring syncthing parameters, and none mention that way. Is it a recent format for the last versions?.. just curious.

Thanks a lot Simpleton. Will keep testing things out.

You can find acceptable syntaxes in the docs here.

What is confusing is that, for some reason, the web GUI’s listen address syntax does not include the tcp:// prefix like sync protocol addresses do.

1 Like

Great thanks. I read in the docs the page talking about port forwarding, etc, but not this one. Maybe a link in the forwarding page to this one would help or probably better, one sample with the correct syntax there. A simple ‘tcp://0.0.0.0:22000’ would have saved me hours of checking things.

With the thing about the gui, you are right too. I have configured the web gui with my personal port, not 8384 since the first day, I have no problem with that because always saw it that format on forums etc (or used the default as a template, not remember) always without the tcp://, but with the sync protocol I found the same format which as said was invalid (and originally it says ‘default’ :(. Hope this message help others. Probably there are many people around behind a relay because of this.

Thanks again.

There ought to be a short instruction/example right there in the settings dialog, as it’s far from obvious what syntax to use there.

I’ve added a help link, that links to https://docs.syncthing.net/users/config.html#listen-addresses.

Not as good as having the usage be obvious from the beginning, but at least it’s possible to figure out how to do it…

1 Like

That’s perfect Jakob, thanks!.

1 Like

It helped me the other day, so thanks. The link is good enough IMHO

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.