Managing static leases (again)

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
dasPaul
DD-WRT Novice


Joined: 28 Nov 2012
Posts: 17
Location: Dresden, Germany

PostPosted: Fri Jul 23, 2021 7:05    Post subject: Managing static leases (again) Reply with quote
Hi, I accidentally deleted all static leases that I entered in this annoying Web-GUI list.

I tried to delete/reorder the list via telnet an nvram commands which then resulted in an empty list.

Time to start anew list without using the annoying HTML list.

I saw some examples in the forum using the "Additional Dnsmasq Options" to set static leases. But parts of the screenshot where blacked out. Because I don't want to create another mess in my dnsmasq config I politely ask you for a clear example how to enter multiple static leases to that box. Smile

_________________
Riesige Gepanzerte Luftschiffe
Sponsor
dasPaul
DD-WRT Novice


Joined: 28 Nov 2012
Posts: 17
Location: Dresden, Germany

PostPosted: Fri Jul 23, 2021 9:28    Post subject: Reply with quote
Okay, looked for dnsmasq general config and found

Code:
dhcp-host=xx:xx:xx:xx:xx:xx,bunker,192.168.1.100


should be sufficient.

And it seems to work but there is my smartphone which seems to get an address defined in the dnsmasq default range between 192.168.1.100-149 although I explicitly set it static (smartphone,192.168.1.14):

cat /tmp/dnsmasq.conf:
Code:

interface=br0
resolv-file=/tmp/resolv.dnsmasq
strict-order
dhcp-leasefile=/tmp/dnsmasq.leases
dhcp-lease-max=50
dhcp-option=br0,3,192.168.1.1
dhcp-authoritative
dhcp-range=br0,192.168.1.100,192.168.1.149,255.255.255.0,1440m
bogus-priv
conf-file=/etc/rfc6761.conf
stop-dns-rebind
dhcp-option=252,"\n"
cache-size=1500
dhcp-host=xx:xx:xx:xx:xx:xx,ignore
dhcp-host=xx:xx:xx:xx:xx:xx,ignore
dhcp-boot=/syslinux.efi,Mimas,192.168.1.105
dhcp-host=xx:xx:xx:xx:xx:xx,tablet,192.168.1.11
dhcp-host=xx:xx:xx:xx:xx:xx,feinstaub,192.168.1.12
dhcp-host=xx:xx:xx:xx:xx:xx,drucker,192.168.1.13
dhcp-host=b4:f7:xx:xx:xx:xx,smartphone,192.168.1.14
dhcp-host=xx:xx:xx:xx:xx:xx,vu,192.168.1.15
dhcp-host=xx:xx:xx:xx:xx:xx,lampe,192.168.1.16
dhcp-host=xx:xx:xx:xx:xx:xx,duet,192.168.1.17


cat /tmp/dnsmasq.leases:
1627116251 b4:f7:xx:xx:xx:xx 192.168.1.135 smartphone xx:xx:xx:xx:xx:xx:xx
1627112856 xx:xx:xx:xx:xx:xx 192.168.1.11 tablet xx:xx:xx:xx:xx:xx:xx

any ideas why this happens?

_________________
Riesige Gepanzerte Luftschiffe
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12889
Location: Netherlands

PostPosted: Fri Jul 23, 2021 9:58    Post subject: Reply with quote
The general questions forum is not for asking for help (see the stickies in that forum, also see the forum guidelines)

To get the best out of DDWRT and the forum read the forum guidelines with helpful pointers:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087

Furthermore it is always helpful if you state router model and build number (again see forum guidelines)

I have transferred this to the appropriate forum Smile

About your question make sure the MAC address of the phone stays the same.
Modern phones randomize their MAC addresses, you can disable that in the phones settings.

Furthermore if a phone already has a MAC address it will keep that until you disable the connection or the lease expires.
However you did not set a lease time, I think it then defaults then to 1 hour.

For my setup I specify 1440 minutes so it will look like:
Quote:
dhcp-host=xx:xx:xx:xx:xx:xx,drucker,192.168.1.13,1440m

You can also specify infinite Smile

_________________
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
dasPaul
DD-WRT Novice


Joined: 28 Nov 2012
Posts: 17
Location: Dresden, Germany

PostPosted: Fri Jul 23, 2021 10:48    Post subject: Reply with quote
Thank you very much for your hints.

After I did the following:


    delete the lease in the web interface
    delete the AP in the smartphone and turn of wifi and phone
    reboot DDWRT
    turn on smartphone and wifi, reenter AP password



the smartphone got the correct ip address 192.168.1.14 assigned.

Just dis/enabling wifi on smartphone OR reboot the router was not enough. Maybe it was the combination of both that helped.

An option to disable random mac address is not available on my smartphone, even in advanced settings but I know that option on my tablet.

_________________
Riesige Gepanzerte Luftschiffe
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Sun Jul 25, 2021 19:26    Post subject: Reply with quote
egc wrote:
However you did not set a lease time, I think it then defaults then to 1 hour.

For my setup I specify 1440 minutes so it will look like:
Quote:
dhcp-host=xx:xx:xx:xx:xx:xx,drucker,192.168.1.13,1440m

You can also specify infinite Smile

For br0, it defaults to what you set in Basic Setup. For unbridged interfaces and other bridges, it defaults to the time you set for the corresponding DHCP server in the DHCPD section at the bottom of the Networking page.

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking 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