Static Lease - DHCP Clients - Lease Expiration

Post new topic   Reply to topic    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.)
Author Message
FlaParrotHead
DD-WRT User


Joined: 04 Nov 2020
Posts: 80

PostPosted: Sun Oct 09, 2022 15:00    Post subject: Static Lease - DHCP Clients - Lease Expiration Reply with quote
When I define static leases with no expiration, why are they showing up in the status/lan/dhcp client list with expiration times? Am I missing something or will these addresses not expire? Thanks.
_________________
Linksys WRT3200ACM
VersionDD-WRT v3.0-r50500 std (10/13/22)
Kernel VersionLinux 4.9.330 #3466 SMP Thu Oct 13 02:01:23 +07 2022 armv7l
Linksys RE9000 Extender (WiFi attached)
OpenVPN with PBR: ExpressVPN
Devices: Sonos, Apple, QNAP, Laserjet other
Sponsor
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Sun Oct 09, 2022 15:35    Post subject: Reply with quote
You can ignore that. If you didn't se a time i.e. left it blank it wont expire. minor visual glitch in UI since the default is 1400, it shows default, does not affect the normal working operation.

Could be fixed but... whos got time for this.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
WENED
DD-WRT Guru


Joined: 30 May 2017
Posts: 582
Location: Rural Manitoba

PostPosted: Sun Oct 09, 2022 15:53    Post subject: Reply with quote
I use 99 static leases on my 3200 and have so for years. When I configure this, which I do from a file or individually change I never put anything in the expiry column (blank). All the leases show up if they are accessed with "static" in the expiry date when I look at lan status.

Just leave the expiry column blank and this should solve your problem.

_________________
Starlink & DSL -> TPLink TL-R470T+
->
WRT3200acm Master WDS 5GHz 80Mhz CH 100 (+6) r55460
Ath1 2.4Ghz Disabled
99 Static Leases
ExpressVPN

WRT3200acm r55460 WDS Station 5Ghz
Ath1 AP N/G Mixed Channel 11 HT40

WRT1900Ac V1 5Ghz r55460 WDS Station
(Defective, no 2.4Ghz but 5Ghz works great)

WRT1900AC V1 5Ghz AC 80Mhz WDS Station r55460
2.4Ghz AP Ch1 HT20 Mixed

WRT1900ACS SPARE r54914
WRT1900AC SPARE r54914
WRT1900AC V1 5Ghz AC 80Mhz WDS-AP r55460
2.4Ghz AP Ch1 HT20 Mixed

WRT54G DD-WRT v3.0-r37305 micro AP CH 6 Mixed - Not in use

3200 Master -> LAN -> 1900ACS -> WDS 5Ghz -> 1900 V1
3200 Master -> WDS -> 3200 Slave & 1900V1
FlaParrotHead
DD-WRT User


Joined: 04 Nov 2020
Posts: 80

PostPosted: Sun Oct 09, 2022 18:51    Post subject: Reply with quote
the-joker wrote:
You can ignore that. If you didn't se a time i.e. left it blank it wont expire. minor visual glitch in UI since the default is 1400, it shows default, does not affect the normal working operation.

Could be fixed but... whos got time for this.


No issue.

What I also discovered was that if the static address is outside of the DHCP range, then they report correctly as static…. Perfect!

UPDATED: Well, maybe I spoke too soon. Initially those with static address higher than the DHCP range were showing as static in the LAN client list, now some are showing the 90day countdown… weird.

_________________
Linksys WRT3200ACM
VersionDD-WRT v3.0-r50500 std (10/13/22)
Kernel VersionLinux 4.9.330 #3466 SMP Thu Oct 13 02:01:23 +07 2022 armv7l
Linksys RE9000 Extender (WiFi attached)
OpenVPN with PBR: ExpressVPN
Devices: Sonos, Apple, QNAP, Laserjet other
FlaParrotHead
DD-WRT User


Joined: 04 Nov 2020
Posts: 80

PostPosted: Sun Oct 09, 2022 19:41    Post subject: Best practices for static hosts Reply with quote
So a question …

Is there a reason why some devices, wired or wireless, do not take/accept the static address and are still using DHCP addresses?

Other than using the Static setup in the Services Tab, is is possible to assign static addrsss using Dnsmasq and maybe the
dhcp-host command - in order to maintain lists in a file easier?

_________________
Linksys WRT3200ACM
VersionDD-WRT v3.0-r50500 std (10/13/22)
Kernel VersionLinux 4.9.330 #3466 SMP Thu Oct 13 02:01:23 +07 2022 armv7l
Linksys RE9000 Extender (WiFi attached)
OpenVPN with PBR: ExpressVPN
Devices: Sonos, Apple, QNAP, Laserjet other
FlaParrotHead
DD-WRT User


Joined: 04 Nov 2020
Posts: 80

PostPosted: Sun Oct 09, 2022 21:46    Post subject: Locked up my router ,.. backups are a wonderful thin Reply with quote
So I tried a series of updated dnsmasq commands that locked me out and shut down internet … finally resorted from backup.

I removed all static links and added a series like this… for many devices. When I save and applied the changes … all access even from other devices went haywire.


dhcp-host= MAC address,Dads iPad,192.168.42.210

What did I hose up?

_________________
Linksys WRT3200ACM
VersionDD-WRT v3.0-r50500 std (10/13/22)
Kernel VersionLinux 4.9.330 #3466 SMP Thu Oct 13 02:01:23 +07 2022 armv7l
Linksys RE9000 Extender (WiFi attached)
OpenVPN with PBR: ExpressVPN
Devices: Sonos, Apple, QNAP, Laserjet other
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2030

PostPosted: Sun Oct 09, 2022 22:22    Post subject: Reply with quote
Spaces not allowed Dads ipad

dhcp-host=00:FF:FF:00:00:01,6200v2,192.168.1.103,infinite

_________________
Forum Guide Lines (with helpful pointers about how to research your router, where and what firmware to download, where and how to post and many other helpful tips!)
How to get help the right way

Before asking for help - Read the forum guidelines AND Upgrade DD-WRT!
Adblock by eibgrad + Blocklist Collection
FlaParrotHead
DD-WRT User


Joined: 04 Nov 2020
Posts: 80

PostPosted: Sun Oct 09, 2022 22:41    Post subject: Reply with quote
bushant wrote:
Spaces not allowed Dads ipad

dhcp-host=00:FF:FF:00:00:01,6200v2,192.168.1.103,infinite


Thanks! Can something like that (multiple hosts) cause the image to totally hose up?

Thanks again!

_________________
Linksys WRT3200ACM
VersionDD-WRT v3.0-r50500 std (10/13/22)
Kernel VersionLinux 4.9.330 #3466 SMP Thu Oct 13 02:01:23 +07 2022 armv7l
Linksys RE9000 Extender (WiFi attached)
OpenVPN with PBR: ExpressVPN
Devices: Sonos, Apple, QNAP, Laserjet other
FlaParrotHead
DD-WRT User


Joined: 04 Nov 2020
Posts: 80

PostPosted: Sun Oct 09, 2022 23:07    Post subject: I’m doing something wrong Reply with quote
OK masters … I’m doing something wrong and maybe am missing something obvious.

It seems anything I try with dnsmasq to assign host name AND IP Address hoses up my config.

I am playing with single entries until I know they are good.

dhcp-host=MACaddress,Dads-Pad,192.168.42.210

Tried both save/apply setting as well as reboot and so far the iPad either picks up an old static access (from deleted static setting) or just doesn’t get access.

It also seems to kill the Internet access to my wired laptop.

_________________
Linksys WRT3200ACM
VersionDD-WRT v3.0-r50500 std (10/13/22)
Kernel VersionLinux 4.9.330 #3466 SMP Thu Oct 13 02:01:23 +07 2022 armv7l
Linksys RE9000 Extender (WiFi attached)
OpenVPN with PBR: ExpressVPN
Devices: Sonos, Apple, QNAP, Laserjet other
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Mon Oct 10, 2022 6:27    Post subject: Reply with quote
Most of us set static DNSMasq leases in the DNSMasq Additional Options (*not* in the DHCP Server setup on the same page).

Official order:
dhcp-host=40:C0:29:33:AA:3F,192.168.0.59,PC-myself,1440m

Instead of the lease time in minutes you can set: infinite

Important is that the name can only have ciphers, letters, a hyphen and an underscore, otherwise DNSMasq will freak out

Static leases must be inside a subnet and outside the DHCP range.

Note if you use the Static lease boxes on the GUI, the GUI actually does exactly the same and you can check the end result (also to see if there are left overs from earlier experimenting) with:
cat /tmp/dnsmasq.conf

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2927
Location: Germany

PostPosted: Mon Oct 10, 2022 7:01    Post subject: Reply with quote
I have configured 20 devices via "services > static leases" and it works fine for me, as it does for WENED.

However, you also have to know how DHCP works.

1 A device requests a DHCP address
2 the lease expiration time is stored by the router in unix time format in /tmp/dnsmasq.leases (that's where the displayed times in the GUI come from)
3. when the time expires the device requests a new address

4. if the lease time is set to "infinite", the device does not request a new address and usually has to be restarted to get a new address.

5. if the lease time is set to the default value of 1440 then the devices will request a new address after 24h.

Anyway there can be inconsistencies in the GUI, when the router is restarted the data from /tmp/dnsmasq.leases is lost.
This means that devices configured with "infinite" are no longer displayed under DHCP clients (they also do not obtain new addresses).

also I configure my static leases always in the DHCP range - static DHCP aka DHCP reservation is also DHCP
and dnsmasq assigns the configured IP address only to the configured MAC address

only devices that I configure manually get addresses outside the DHCP range

experience shows that you don't do yourself a great favor if you configure many devices with infinite lease time.

As soon as you change something on the network, you have to restart dozens of devices manually.

In addition, as already mentioned, the devices are no longer displayed under "DHCP clients" after a router restart.

the described problem applies in any case for wired LAN devices (my WLAN devices all get 1440).
WENED
DD-WRT Guru


Joined: 30 May 2017
Posts: 582
Location: Rural Manitoba

PostPosted: Mon Oct 10, 2022 15:26    Post subject: Reply with quote
Excellent info from ho1Aetoo.

I might add that my configuration is that the first 100 addresses are where all my statics are located including the hosting router. My dhcp addresses begin at 192.168.0.100 and allow for 154 addresses.

One thing I have found is that to reduce problems associated as ho1Aetoo mentioned is to also ensure that all my devices are also coded to static. In some cases this can be issue as many use different mac addresses depending on whether they are on lan or wifi. Because I usually setup my cameras on lan and then put them on wifi I have to be careful that when I setup the statics I use the wifi mac. The best way to accomplish this has been that when I install a device on wifi I check to see what is the mac address, if dhcp has picked it up with a new address I can use this to set the static address correctly.

Although I use WDS in all my routers which allows for the actual mac address to get back to my primary router I have found that using other configurations (extenders) causes the mac address to be modified before getting back to the primary router. That is why I use the above procedure to ensure that I have the correct mac address.

Another problem that can arise is with Android devices, where if you do not set the device to show the true mac address it will present random mac addresses on wifi. This of course can defeat your static setup, but then again if you use the above procedure and ensure that the device is responding with it's true mac address you can never have random dhcp assignments.

Whenever I see a dhcp assignment being made I investigate as I am suspicious of an attack on my system. Because I always code every device in my system to my static list there should never be any dhcp assignments or at least non that I cannot verify, ie. friends or Neighbours to whom I have given my wifi signin information.

This setup has worked extremely well for years. If I have to rebuild from scratch, I load my statics from a file rather than attempt to manually enter all of them. So having 99 possible entries is not really messy and quite easy to maintain. The file I create for loading is derived from my backup file which I periodically update so that I always have an updated list.

So along with ho1Aetoo comments I hope this all helps.

_________________
Starlink & DSL -> TPLink TL-R470T+
->
WRT3200acm Master WDS 5GHz 80Mhz CH 100 (+6) r55460
Ath1 2.4Ghz Disabled
99 Static Leases
ExpressVPN

WRT3200acm r55460 WDS Station 5Ghz
Ath1 AP N/G Mixed Channel 11 HT40

WRT1900Ac V1 5Ghz r55460 WDS Station
(Defective, no 2.4Ghz but 5Ghz works great)

WRT1900AC V1 5Ghz AC 80Mhz WDS Station r55460
2.4Ghz AP Ch1 HT20 Mixed

WRT1900ACS SPARE r54914
WRT1900AC SPARE r54914
WRT1900AC V1 5Ghz AC 80Mhz WDS-AP r55460
2.4Ghz AP Ch1 HT20 Mixed

WRT54G DD-WRT v3.0-r37305 micro AP CH 6 Mixed - Not in use

3200 Master -> LAN -> 1900ACS -> WDS 5Ghz -> 1900 V1
3200 Master -> WDS -> 3200 Slave & 1900V1
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Mon Oct 10, 2022 17:51    Post subject: Reply with quote
ho1Aetoo is right, dependent on device needs to be restarted to get new leases, unless you can restart the networking stack, both Windows and Linux devices are able to do this fairly easy, Android needs a bit of fondling and root, pApple easily done laptops/Desktops unless it's a iCrone vobile demice, then open windows throw it out.
_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
FlaParrotHead
DD-WRT User


Joined: 04 Nov 2020
Posts: 80

PostPosted: Tue Oct 11, 2022 4:10    Post subject: Reply with quote
Thank you group for great information…. Slowly getting dnsmasq static definitions working as I hoped..
_________________
Linksys WRT3200ACM
VersionDD-WRT v3.0-r50500 std (10/13/22)
Kernel VersionLinux 4.9.330 #3466 SMP Thu Oct 13 02:01:23 +07 2022 armv7l
Linksys RE9000 Extender (WiFi attached)
OpenVPN with PBR: ExpressVPN
Devices: Sonos, Apple, QNAP, Laserjet other
FlaParrotHead
DD-WRT User


Joined: 04 Nov 2020
Posts: 80

PostPosted: Wed Oct 12, 2022 4:29    Post subject: Related: Active Client host Names Reply with quote
Maybe related, is there a reason (or logic) behind the hostnames in the active client table sometimes showing the actual host name (as defined in dnsmasq settings) and other times representing the name as just a “*” ?? Is there anyway to always see the hostnames in the active client table?

Thanks!

_________________
Linksys WRT3200ACM
VersionDD-WRT v3.0-r50500 std (10/13/22)
Kernel VersionLinux 4.9.330 #3466 SMP Thu Oct 13 02:01:23 +07 2022 armv7l
Linksys RE9000 Extender (WiFi attached)
OpenVPN with PBR: ExpressVPN
Devices: Sonos, Apple, QNAP, Laserjet other
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.) All times are GMT

Navigation

 
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
You cannot attach files in this forum
You cannot download files in this forum