miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

What causes port leases to expire?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Bugs
View previous topic :: View next topic  
Author Message
NickH



Joined: 10 Feb 2018
Posts: 26

PostPosted: Wed Sep 09, 2020 10:57 am    Post subject: What causes port leases to expire? Reply with quote

I have a port lease which would have last been used on Aug 25 or earlier when I changed the host's IP address but it still shows and I assume is stopping the new IP address from making the same port forwarding rule. How or when does miniupnpd expire leases?

For the moment I've had to manually remove the lease from /var/lib/miniupnpd/upnp.leases
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Sun Sep 20, 2020 1:33 pm    Post subject: Reply with quote

port Leases have a duration, that could be infinite, so it will never expire.

you should not manually remove leases, just use a UPnP IGD client to do that.
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
NickH



Joined: 10 Feb 2018
Posts: 26

PostPosted: Sun Sep 20, 2020 5:17 pm    Post subject: Reply with quote

I am afraid I don't fully understand the process. What sort of client are you talking about? Does it run on the same machine as miniupnpd or elsewhere?
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Tue Sep 22, 2020 10:22 pm    Post subject: Reply with quote

NickH wrote:
I am afraid I don't fully understand the process. What sort of client are you talking about? Does it run on the same machine as miniupnpd or elsewhere?

Usually elsewhere. MiniUPnPd is an UPnP Internet Gateway Device (aka IGD) implementation. In UPnP terminology, clients are called "control points" and are piece of software on other LAN hosts.
What are the control points you are using ?
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
NickH



Joined: 10 Feb 2018
Posts: 26

PostPosted: Wed Sep 23, 2020 10:50 am    Post subject: Reply with quote

Thanks for the explanation. In this case the control point is a ClearOS7 server running in a VM. I am playing around with it as a Sia host and I assume the Sia daemon has the UPnP IGD client in it.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Wed Sep 23, 2020 9:30 pm    Post subject: Reply with quote

NickH wrote:
Thanks for the explanation. In this case the control point is a ClearOS7 server running in a VM. I am playing around with it as a Sia host and I assume the Sia daemon has the UPnP IGD client in it.

If available, you can install miniupnpc on the ClearOS machine and use the upnpc command line tool
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
stacy09
Guest





PostPosted: Fri Oct 30, 2020 6:27 am    Post subject: Reply with quote

thank you
Back to top
NickH



Joined: 10 Feb 2018
Posts: 26

PostPosted: Fri Aug 13, 2021 10:52 am    Post subject: Reply with quote

I'm bumping this old topic as I still don't fully understand.

My set up is ClearOS7 gateway running miniupnpd and on the network behind it are various devices such as a PS4 and another bunch of ClearOS7 servers, one of which runs Sia (which uses uPnP).

If the PS4 is turned off, what causes its leases with miniupnpd to expire? Ditto the ClearOS servers running Sia?
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Wed Aug 18, 2021 8:54 am    Post subject: Reply with quote

Please use miniupnpc (or another client) on any host on your network to display which leases are active.
Code:

$ upnpc -l
upnpc : miniupnpc library test client, version 2.2.0.
 (c) 2005-2020 Thomas Bernard.
Go to http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
for more information.
List of UPNP devices found on the network :
 desc: http://192.168.11.254:5678/desc/root
 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found valid IGD : http://192.168.11.254:5678/control/wan_ip_connection
Local LAN ip address : 192.168.11.150
Connection Type : IP_Routed
Status : Connected, uptime=5411256s, LastConnectionError : ERROR_NONE
  Time started : Wed Jun 16 19:44:48 2021
MaxBitRateDown : 25000000 bps (25.0 Mbps)   MaxBitRateUp 1000000 bps (1.0 Mbps)
ExternalIPAddress = <xxxx>
 i protocol exPort->inAddr:inPort description remoteHost leaseTime
 0 TCP 51413->192.168.11.150:51413 'Transmission at 51413' '' 603760
 1 UDP 51413->192.168.11.150:51413 'Transmission at 51413' '' 603760
GetGenericPortMappingEntry() returned 713 (SpecifiedArrayIndexInvalid)

_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
NickH



Joined: 10 Feb 2018
Posts: 26

PostPosted: Wed Aug 18, 2021 10:49 am    Post subject: Reply with quote

I've tried miniupnpc 2.2.2 but it won't run:
Code:
[root@microserver miniupnpc-2.2.2]# upnpc -l
upnpc: error while loading shared libraries: libminiupnpc.so.17: cannot open shared object file: No such file or directory
But:
Code:
[root@microserver miniupnpc-2.2.2]# updatedb && locate libminiupnpc
/usr/lib/libminiupnpc.a
/usr/lib/libminiupnpc.so
/usr/lib/libminiupnpc.so.17
/usr/src/miniupnpc-2.2.2/libminiupnpc.a
/usr/src/miniupnpc-2.2.2/libminiupnpc.so


So I have tried the old precompiled Windows client:
Code:
C:\Users\Nick\Downloads\upnpc-exe-win32-20150918>upnpc-shared.exe -l
upnpc : miniupnpc library test client, version 1.9.
 (c) 2005-2014 Thomas Bernard.
Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
for more information.
List of UPNP devices found on the network :
 desc: http://172.17.2.1:41068/rootDesc.xml
 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found valid IGD : http://172.17.2.1:41068/ctl/IPConn
Local LAN ip address : 172.17.2.118
Connection Type : IP_Routed
Status : Connected, uptime=511662s, LastConnectionError : ERROR_NONE
  Time started : Thu Aug 12 13:35:50 2021
MaxBitRateDown : 50000000 bps (50.0 Mbps)   MaxBitRateUp 3000000 bps (3.0 Mbps)
ExternalIPAddress = 62.30.63.90
 i protocol exPort->inAddr:inPort description remoteHost leaseTime
 0 UDP  9305->172.17.2.112:9305  '172.17.2.112:9305 to 9305 (UDP)' '' 0
 1 UDP  9308->172.17.2.112:9308  '172.17.2.112:9308 to 9308 (UDP)' '' 0
GetGenericPortMappingEntry() returned 713 (SpecifiedArrayIndexInvalid)
My underlying issue, which this demonstrates, is that the lease time is blank and the lease never expires.

On the gateway I am running miniupnpd-2.1-12.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Wed Aug 18, 2021 11:38 am    Post subject: Reply with quote

use
Code:
upnpc -d
to remove a lease.

Leases without expiry time... do not expire.
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
NickH



Joined: 10 Feb 2018
Posts: 26

PostPosted: Wed Aug 18, 2021 11:44 am    Post subject: Reply with quote

Who sets the lease time? The client or miniupnpd server? In the DHCP model it is the server that sets the lease time. How does it work in UPNP?
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Wed Aug 18, 2021 11:47 am    Post subject: Reply with quote

NickH wrote:
Who sets the lease time? The client or miniupnpd server? In the DHCP model it is the server that sets the lease time. How does it work in UPNP?


The client sets the lease duration.
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
NickH



Joined: 10 Feb 2018
Posts: 26

PostPosted: Wed Aug 18, 2021 12:08 pm    Post subject: Reply with quote

So this would be a bug in the PS4 software?
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Wed Aug 18, 2021 3:20 pm    Post subject: Reply with quote

NickH wrote:
So this would be a bug in the PS4 software?

what bug ?
I guess the software doesn't set a limited duration time because it is meant that way
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Bugs All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.