Reply
Highlighted
Established Member
Posts: 1,181
Registered: ‎05-28-2016
Kudos: 579
Solutions: 47

Making synology NAS upnp port Mapping more Reliable

[ Edited ]

I hope folks with synology NAS find this useful.

 

I have a synology NAS, it's upnp implementation is terrible (external connectivity wizard) because they decided:

1) the upnp engine should not respond to router announcements

2) the upnp engine assumes once a port mapping has been made it won't be erased by the router

 

this is in direct conflic with upnp spec which means if you reboot your router (USG, Asus, whatever) the synology won't reopen the mapping or refresh it for days.  It is possible to change refresh - but there is a better way - enable natpmp (note if you have upnp enabled on your USG then nat-pmp is already enabled).

 

It seems synology built natpmp int0 their units but never turned it on - here is how.

 

  1. ensure you already cofigure your synoogy with the router wizard in non password mode
  2. enable SSH access to the synology
  3. login with an SSH client
  4. navigate to  /etc/portfoward
  5. use sudo vi router.conf to edit the file 
  6. change the following lines in the file:
    1. support_change_port=yes
    2. support_router_upnp=yes
    3. support_router_natpmp=yes
    4. router_type=natpmp
  7. leave all other lines as-in

I hope this helps someone - it makes using the external connectivity wizard in the synology pretty much bullet proof.

(note synology firmware updates may revert this - not always but sometimes)

 

Bonus tip if you don't like that and want to stick with upnp you can change the refresh by creating a file in the  /etc/portforward folder called pfd.config with the contents reclaim="60" where rthe number IIRC is the time in seconds (but if that turns out to be minutes do sue me) - this was a change synology support once made on my box for me

I am not an expert and don't play one on TV.
Don't forget RTFM https://www.ubnt.com/downloads/guides/UniFi/UniFi_Controller_V5_UG.pdf it really is impressive documentation.
New Member
Posts: 3
Registered: ‎05-30-2017

Re: Making synology upnp port Mapping more Reliable

[ Edited ]

Good information but how do you SSH into the router? Please provide that information. Do I use a Mac or PC to SSH into the router.  Do you use Telnet or some other software? I didn't know you could SSH into the Synology router.  

 

What do you mean by "ensure you already cofigure your synology with the router wizard in non password mode".  Please explain this? I have an admin password setup on the router. 

 

Again, please explain in detail the steps to SSH into the Synology router. You provide some instructions but you have to start at Step 1 which is how to SSH into the router. 

SuperUser
Posts: 9,439
Registered: ‎01-10-2012
Kudos: 5862
Solutions: 385

Re: Making synology upnp port Mapping more Reliable

[ Edited ]

Or better, you just skip UPNP and all it's associated vulnerabilities and just map things out once and move on.


Still, nice job tracking it down.  I wonder why they don't just do the same.

When you receive a solution to your question/issue, don't forget to mark your thread as solved and to give kudo's to the people who have helped you out!

Having wifi problems? Take a look here first: https://help.ubnt.com/hc/en-us/articles/221029967-UniFi-Debugging-Intermittent-Connectivity-Issues-on-your-UAP
Senior Member
Posts: 2,936
Registered: ‎04-26-2016
Kudos: 1121
Solutions: 303

Re: Making synology upnp port Mapping more Reliable

I have several Synology devices and I never used UPnP. It's much easier to just setup the portforwards that are needed, and those are very well documented.

New Member
Posts: 3
Registered: ‎05-30-2017

Re: Making synology upnp port Mapping more Reliable

The reason for my interest in this topic.  I  have the 2600ac. I use Back to My Mac to access my Mac at home. Both computers are on a wired connection. BTMM is very slow and there is a lot of delays. Most of the time, I give up because it is painfully slow. BTMM uses NAT-PMP and UPnP for it to successfully work and this allows my Mac to automatically forward the ports it requires for connectivity. I do have NAT and UPnP enabled but I am not sure if I have to manually enter any ports. I am not sure what port numbers are needed to be added so BTMM can work without any delays or slowness.  I am aware of LogMe In, Teamviewer, and others. I don't want to pay for service that can do the same thing as BTMM. 

 

This is why I am interested in getting NAT-PMP enabled or configure port forwarding to work. 

Senior Member
Posts: 2,936
Registered: ‎04-26-2016
Kudos: 1121
Solutions: 303

Re: Making synology upnp port Mapping more Reliable

I think you are confusing things here.

 

The original post is talking about a Synology NAS and changing settings in an Ubiquiti router.

This is not related to the Synology router, that runs a completely different OS.

 

I think you could better ask this on the Synology forum. The support there is pretty good too.

New Member
Posts: 3
Registered: ‎05-30-2017

Re: Making synology upnp port Mapping more Reliable

[ Edited ]

Thanks for pointing that out.  That makes sense.  I am reading the OP and I thought he was talking about a Synology ROUTER. 

Reply