Posted: Mon Apr 04, 2016 16:08 Post subject: DNSmasq & STATIC leases LOCK the router (AC66U)
I suppose I found a problem in many ddwrt version with DNSmasq acting as local DHCP with STATIC leases
(version tested 26339, 28598, 28647, 29346 – router Asus AC66U )
All tests performed, have started with installing the 26339, and then flashing the other new fw (just one run for 26339 test itself)
Everything works after installation, and first configuration (DNS, Gateway, ntp, local ip, netmask, wireless ssid & password,…)
HOW to reproduce the problem
Just insert some static leasse (8, save & reboot:
1)The router dhcp works no more, neither gives my laptop a IP, nor i can connect to the router or internet
2)If I give a manual ip to my laptop, I can connect to the router and see in Status->Sysinfo that the DHCP i enabled but stopped (!!). I can connect to the router, but not “exit” to the internet. The wireless network stop working (!!)
How to try to FIX the problem:
Go to Setup->Basic->Use DNSMasq for DHCP (), disable and save it and restart it,
A) everything works again (wireless reappears, static lease, dhcp, internet ...)
B) Strangely in Status->Sysinfo DHCP is said to be running (server udcpd should run)
BUT in Status→LAN , the DHCP Status is “DHCP ServerDisabled”
I can reproduce this error with all tested fw: ( 26339, 28598, 28647, 29346).
It seems that I can make DHCP work well with only udhcpd, but not together with DNSmasq…..
Can I provide some file or command output, to check where the problem could be in the router ?
I attach two screen-shots of the working setup WITHOUT DNSmasq running.
In case this is useful, here's the contents of my config files
I think you need to have your first DNS set to your local router IP in order to use static IP this way. Your DNS addresses are pointed outside your local lan. I have done the same thing in build 29218 but my local gateway ip is also in the first DNS. But I am not positive it wont work that way, you may just loose the ablility to use the DNS name lookup.
I also have my "Use DNSmasq as DHCP" button checked. And I have my "DHCP Server" under Services set to Lan & Wlan, with a "Local Domain" entered
Following ddwrt wiki https://www.dd-wrt.com/wiki/index.php/DNSMasq_as_DHCP_server, the ddwrt may use TWO different dchp server: the udhcpd (part of busybox) and DNSMasq.
The two programs use two different config file.
From what I understand. The udhcpd could be stopped and let dnsqmas do also the dhcp job.
The data that you can input into Newtork-Setup→NetworkAddressServerSettings, are the one you find into the /tmp/udhcpd.conf , and are the one you could find in your laptop, after it will receive the informations from the DHCP server.
I kindly ask Brian if may be changed the behaviour of the menu:
Whend DNSmasq i enabled, the Status->LAN->Dynamic Host Configuration Protocol shows that DHCP is enabled and shows also that the server is DNSmasq.
Instead when DNSmasq is disabled (BUT udhcpd should work instead), the same above menu says the DHCP server is disabled.. but it's WRONG... simply the dhcp server working is the "old" udhcpd....
Dear JAMESMTL thanks for your kind reply.
Analyzing the traffic data with wireshark, it showed that having set the gateway address to the isp router, it resulted of having the majority of the dns request to be forwarded directly to the gateway INSTEAD to the Opendns server. Even if primary and secondary dns set to opendns.
Setting the gateway for the lan to the ddwrt router address itself, resulted in having ALL the dns query been correctly forwarded to OpenDNS
I found the static lease be saved in : udhcpd.statics and udhcpd.leases ; both are udchp server files, not dnsmasq files
Thanks for your kind answer.
I could try to put all the information together:
Static leases in ddwrt are stored in /tmp/udhcpd.statics
Udhpcd server, can assign dynamic ip and static ip for the network, without interacting with DNSmasq server.
Considering the RFC https://tools.ietf.org/html/rfc2132 , the dhcp protocol will never deal with the hostnames contained in the /tmp/udhcpd.statics : hostnames are informations not transfered not assigned by such protocol.
So this could explain why the invalid chars have no effect with it: udhcpd simply doesn’t use them.
When the DNSmasq is requested to act ALSO as a dhcp server, it will use such information also for resolving local hostname address; but the typo error in /tmp/udhcpd.statics will make it fail.
I changed the hostnames removing the invalid chars, and NOW it WORKS !
I would suggest some POSSIBLE TWO IMPROVEMENTS in the following tabs:
Service→Services→ DHCP server ->Static_lease
Status → LAN→ DHCP
In Service→Services→ DHCP server →Static_lease the hostname filed could filter the invalid chars before to accept them (isalpa() || isnum() || ‘-’)
In Status → LAN→ DHCP → DHCP Status , the mask should give information on which DHCP server is running.
If I enable DNSmasq as dhcp server, the mask update specifing that: “ DHCP Server =Enabled
When using ONLY udhcp (not DNSmasq for dhcp), the information is WRONG because it says the DHCP is disabled when clearly it is not... udhcp is running (it can be seen in System → Sysinfo); what is NOT running as dhcp server is DNSmasq.
For the same reason it will not show the active dhcp clients...
Even more strangely (!!), to let the mask display the “ DHCP Server =Enabled DHCP Daemon=DNSMasq” it is not necessary to clik on “apply settings”: it is enough to set the DNSmasq as dhcp serve, Save it, and voilà…. The Status → LAN→ DHCP → DHCP Status start showing that the DNSmasq is running (without applying….)
Posted: Mon Sep 05, 2016 11:02 Post subject: i have the same issue
i have the same issue
Router: Asus RT-AC87U
Firmware: DD-WRT v3.0-r30534 std (09/01/16)
Kernel: dont know
Reset: multiple with multiple erase nvrams
when setting static leases in the services tab it seems to break DHCP and nothing is able to connect
phones just get stuck on obtaining ip address
(i put about 30 blank ones in and then fill out what i want and label all the others with a fake mac and empty status for future proofing)
yet when i remove all static leases and apply settings. instantly my phone connects
as far as im aware i have no invalid Chars
i thought it was some sort of limit causing it as i done 5 then saved and it worked but by the time i had done the rest and rebooted it didnt.
i had to remove every last one before it started working again
ok i noticed after looking at all the static Ip's i had put in there i have a " RaspberryPi-B+ "
im assuming the " + " is whats breaking it?
all my blanks are " --EMPTY-- " reading that link it says
The original specification of hostnames in RFC 952, mandated that labels could not start with a digit or with a hyphen, and must not end with a hyphen. However, a subsequent specification (RFC 1123) permitted hostname labels to start with digits. No other symbols, punctuation characters, or white space are permitted.
but they seemed to work back in the day.
i will test and remove them too
I have this problem exactly.
no invalid characters in the hostnames.
But if I enable 'dnsmasq for dhcp' check box, the router status shows "DHCP enabled-stopped".
How was this finally resolved? I'm not clear, I don't think...
Are you sure.... about 98% chance you have an invalid character somewhere.
Seen this several times ....in a string of 50 staic leases it only takes the mistake of an o for 0 to break the whole thing or an l in place of a 1.
Remember MACs are hex vaules