extract and move Static Leases to a new router

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
drdedus
DD-WRT User


Joined: 31 Dec 2013
Posts: 171
Location: Greece

PostPosted: Mon Sep 28, 2020 16:16    Post subject: extract and move Static Leases to a new router Reply with quote
hello
i want to change router and i want to move all the Static Leases.
is there any commands for this?
thank you
Sponsor
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2036

PostPosted: Mon Sep 28, 2020 17:03    Post subject: Reply with quote
From CLI (SSH/Telnet) do:
Code:
cat /tmp/dnsmasq.conf


Copy them and paste them in
Additional Dnsmasq Options

_________________
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 (1.1M blocked) + Blocklist Collection

drdedus
DD-WRT User


Joined: 31 Dec 2013
Posts: 171
Location: Greece

PostPosted: Mon Sep 28, 2020 17:26    Post subject: Reply with quote
thank you.
do i copy paste everything it will appear or only the static leases ?


listen-address=127.0.0.1,192.168.4.1
resolv-file=/tmp/resolv.dnsmasq
strict-order
domain=home
dhcp-leasefile=/tmp/dnsmasq.leases
dhcp-lease-max=128
dhcp-option=br0,3,192.168.4.1
dhcp-authoritative
dhcp-range=br0,192.168.4.30,192.168.4.123,255.255.255.0,70m

and in the end...

bogus-priv
conf-file=/etc/rfc6761.conf
stop-dns-rebind
dhcp-option=252,"\n"
cache-size=1500
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2036

PostPosted: Mon Sep 28, 2020 17:34    Post subject: Reply with quote
Just the leases.
They could also be copied to a text file stored at /jffs and called from there in Additional Dnsmasq Options:
conf-file=/jffs/dnsmasq.custom

Format should be:
dhcp-host=D8:77:67:GG:EC:05,pc1,192.168.1.100,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 (1.1M blocked) + Blocklist Collection

drdedus
DD-WRT User


Joined: 31 Dec 2013
Posts: 171
Location: Greece

PostPosted: Mon Sep 28, 2020 18:36    Post subject: Reply with quote
thank you.
i will try it in the following days.
drdedus
DD-WRT User


Joined: 31 Dec 2013
Posts: 171
Location: Greece

PostPosted: Mon Oct 05, 2020 6:47    Post subject: Reply with quote
i tried in a 841n v12 tp-link with the latest version
i noticed that not always immediately the router showed the name for the static lease but it needed time or it was lost the name after a while.
The ip address it was always the correct.
it was working until i noticed really high cpu usage 3-8 so i deleted and i done it in the "normal" way one by one.
Now i have to check if i will get again high cpu usage again in the next days to understand if the problem was from that.
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Thu Oct 08, 2020 12:41    Post subject: Reply with quote
bushant wrote:
Just the leases.
They could also be copied to a text file stored at /jffs and called from there in Additional Dnsmasq Options:
conf-file=/jffs/dnsmasq.custom

Format should be:
dhcp-host=D8:77:67:GG:EC:05,pc1,192.168.1.100,infinite


I have hostnames and IPs in reverse order on the reserved leases file and it works like that, too. On two different routers. Even with two mac's (ethernet and WiFi) like this:
dhcp-host=B4:B6:86:xx:xx:xx,B4:6B:FC:yy:yy:yy,192.168.1.2,HP430G5,3600s

However, in my experience:
DNSMASQ WILL FAIL if there are leading zeroes in IP addresses (like 192.168.001.100), or characters other than letters, numbers and hyphens in a device name!
It will just totally fail.
SurprisedItWorks
DD-WRT Guru


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

PostPosted: Thu Oct 08, 2020 15:58    Post subject: Reply with quote
And you don't need all the fields. I use lines like these:

dhcp-host=xx:xx:xx:xx:xx:xx,YY.YY.YY.YY,OurAppleTV
dhcp-host=xx:xx:xx:xx:xx:xx,OurRoku


The last one is not a static lease, as no IP address is specified. It just gives a name to the device for ease of reading the syslog and the list of DHCP Clients on the status page.

Google the dnsmasq man page for details on what's allowable. It's surprisingly flexible.

_________________
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.
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2036

PostPosted: Thu Oct 08, 2020 17:07    Post subject: Reply with quote
I have a thread bookmarked where all these options
were explained by @eibgrad but alas Crying or Very sad
we have lost all that.

My format is exactly as it shows in dnsmasq.conf when you have
set them up using GUI therefore is undeniably correct and will work.

If OP c/p's from old setup this is what they will look like.
And I cannot imagine how this has anything to do with high cpu usage.

And when you save them to a text file you can never lose them Very Happy

I will bookmark this thread to replace the one that went junk.

_________________
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 (1.1M blocked) + Blocklist Collection



Last edited by bushant on Tue Oct 20, 2020 13:59; edited 1 time in total
drdedus
DD-WRT User


Joined: 31 Dec 2013
Posts: 171
Location: Greece

PostPosted: Thu Oct 08, 2020 18:05    Post subject: Reply with quote
probably the high cpu usage was from the firmware.
i tried to go some firmware back to 44340 that i have a really old TP-Link TL-WR743ND v1 and the 841n v12 bricked
(the TP-Link TL-WR743ND v1 works "great")
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions 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 can attach files in this forum
You can download files in this forum