miniupnp / miniupnp

UPnP IGD implementation
http://miniupnp.free.fr/
BSD 3-Clause "New" or "Revised" License
1.46k stars 455 forks source link

Deletion of upnp leases? #197

Closed scyto closed 8 years ago

scyto commented 8 years ago

Hi, i am user not a coder but hope you can help. I use the merlin firmware for asus routers that now included miniupnpd 2.0. I have a synology running DSM6 that opens upnp ports on the router. The registrations don't seem to stay open correctly (though they may still be in the list on the router).

Synology support looked at my issue and they claim the router clears the ports every 3 to 5 minutes (last year they claimed an older router firmware cleared it once an hour). Can you confirm this is normal behaviors (BTW no other upnp service in my network is having the same issue as such i am guessing synology is at fault)

My assumption is synology are not registering correctly - what should i tell them they need to fix? Can you confirm what the behavior of miniupnpd is wrt clearing down registrations?

miniupnp commented 8 years ago

miniupnpd CAN clear unused port mappings if it is configured to do so. By default it is disabled.

See the configuration options clean_ruleset_threshold / clean_ruleset_interval https://github.com/miniupnp/miniupnp/blob/master/miniupnpd/miniupnpd.conf

This is very likely a configuration issue

scyto commented 8 years ago

Thanks, for the pointer. I looked on the router and the following is set - i think the culprit here is the minlifetime param (some parameters deleted for readability) this is the only thing activating after 2 mins. The synology upnp mapping (not natpmp) seem to be infinite lease though so i am unclear why the min lifetime seems to apply (unless synology are wrong and it is after 10 mins the mappings go..)

i will work with Merlin to see what, if anything, he wants to do about this. I will also see if can get synology to change their registration behaviour.

enable_upnp=yes enable_natpmp=yes secure_mode=yes upnp_nat_postrouting_chain=PUPNP upnp_forward_chain=FUPNP upnp_nat_chain=VUPNP notify_interval=60 system_uptime=yes friendly_name=RT-AC68R model_number=380.59 clean_ruleset_interval=600 clean_ruleset_threshold=20 min_lifetime=120 max_lifetime=86400

miniupnp commented 8 years ago

clean_ruleset_interval=600 clean_ruleset_threshold=20

how much port mappings do you use on your router ? just set clean_ruleset_threshold a few units more.

or disable the feature entirely

it is also possible that the synology set a liftetime on the port mapping. If the input is misinterpreted by miniupnpd, that could lead to the minimum lifetime being set (2 minutes).

Regards,

Thomas

Le 16/05/2016 00:55, scyto a écrit :

Thanks, for the pointer. I looked on the router and the following is set - i think the culprit here is the minlifetime param (some parameters deleted for readability) this is the only thing activating after 2 mins. The synology upnp mapping (not natpmp) seem to be infinite lease though so i am unclear why the min lifetime seems to apply (unless synology are wrong and it is after 10 mins the mappings go..)

i will work with Merlin to see what, if anything, he wants to do about this. I will also see if can get synology to change their registration behaviour.

enable_upnp=yes enable_natpmp=yes secure_mode=yes upnp_nat_postrouting_chain=PUPNP upnp_forward_chain=FUPNP upnp_nat_chain=VUPNP notify_interval=60 system_uptime=yes friendly_name=RT-AC68R model_number=380.59 serial=d8:50:e6:58:78:70 lease_file=/tmp/upnp.leases clean_ruleset_interval=600 clean_ruleset_threshold=20 min_lifetime=120 max_lifetime=86400

— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/miniupnp/miniupnp/issues/197#issuecomment-219316473