Please forgive me if my doubt is too basic. I have read the good article on the Wiki about [Firewalls and Port Forwarding] (https://github.com/syncthing/syncthing/wiki/Firewalls-and-Port-Forwards), and as I looked at my firewall logs, I stumbled across doubts.
Please correct me if I’m wrong:
<listenAddress> = address:port where a node receives TCP connections from other nodes (default: 0.0.0.0:22000). The port must be opened at the router, either through UPnP or port forwarding
<localAnnouncePort> = IPv4 UDP port used by a node to announce itself on the LAN, and also where it receives announcements from other nodes (default: 21025)
<localAnnounceMCAddr> = IPv6 broadcast address and UDP port used by a node to announce itself on the LAN; a node also receives IPv6 announcements from other nodes on this UDP port (default: [ff32::5222]:21026)
My current setup is simple: here at home, an Android phone and a Xubuntu desktop, and at my mother’s, a Xubuntu desktop. Local discovery on all 3 nodes, global discovery only on the desktops.
Initially, I had these ports opened at the firewall on my desktop: TCP/22000, UDP/21025. But then I noticed that the firewall log was flooded with messages like:
Apr 14 13:54:02 monk kernel: [27351.234292] [UFW BLOCK] IN=eth0 OUT= MAC=33:33:00:00:52:22:90:68:c3:ba:d3:7a:86:dd SRC=fe80:0000:0000:0000:9268:c3ff:feba:d37a DST=ff32:0000:0000:0000:0000:0000:0000:5222 LEN=104 TC=0 HOPLIMIT=1 FLOWLBL=0 PROTO=UDP SPT=21026 DPT=21026 LEN=64
which I suppose is my phone (IPv6 address fe80:9268:c3ff:feba:d37a) announcing itself locally. So I also opened UDP/21026 on my desktop.
But trying to understand the function of each port, I closed UDP/21025 and UDP/21026, and observed the firewall logs: there was traffic only to UDP/21026 (no traffic to UDP/21025). But even with both ports closed at the desktop, phone and desktop still connected and synced, which puzzled me.
- What is the purpose then of port
<localAnnouncePort>(UDP/21025), if I don’t see any traffic through it ?
- The port in
<localAnnounceMCAddr>(UDP/21026) must really also be opened, if my phone and desktop managed to sync even though it was closed at the desktop ?