Starting with Resilio Sync v2.7.1 listening port of Sync is hardcoded and enforced through package configuration files and cannot be changed through UI.
It can be changed though, manually, through three steps:
1. Stop Sync and connect to NAS by ssh. You can use Synology's guide:
How to login to DSM with root permission via SSH/Telnet
2. Once connected, navigate to /usr/local/resiliosync/var directory
check that listening_port in config is set with
Before editing the port, check if it's available on NAS for both protocols udp and tcp, put your chosen port instead of 21234 in the example
servicetool --conf-port-conflict-check --tcp 21234
servicetool --conf-port-conflict-check --udp 21234
Seeing IsConflict:false in reply means that the port is available and can be used. Seeing IsConflcit:true, means that you need to choose some other port and also check it for availability.
Edit two files - sync.conf and resiliosync.sc and put the new port there.
and in resiliosync.sc. Be sure to edit the port in "Resilio Sync File Transfer" section.
After that run command
/usr/syno/sbin/synopkghelper update resiliosync port-config
3. Start Sync and see that the port is changed in Sync settings.