Welcome, Guest. Please login or register.

Author Topic: Possible DHCP error  (Read 3441 times)

Qinn

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Possible DHCP error
« on: March 02, 2016, 09:14:04 AM »
Hi Andy thanks for the great work creating a fork!

I just upgraded from generic-pc-1.8.2b78 to generic-pc-1.10.2b97(i386) and noticed that dhcp was failing. The log gave the following error:

dnsmasq[86]: Failed to start up
dnsmasq[86]: bad dhcp-range at line 11 of -var-etc-dnsmasq-dhcpd.conf

(offtopic: strange but when I use a slash forward instead of an - this post here in the forum won't save and I get an error...)

I downloaded the dhcpd.conf using the exec.php and had a look at line 11

dhcp-range=set:opt2,192.168.5.10,192.168.5.20,static

The word static seemed out of place. When I removed the checkmark at Deny unknown clients (Opt2 Services: DHCP server) in the GUI, the error (after a reboot) was gone and DHCP worked fine.

Then I downloaded the dhcpd.conf again and the word static was gone, so my preliminary conclusion is that they might be related.

I hope it's not a bug and it's just my configuration, if not I hope this post helps  ;)

Best Qinn


« Last Edit: March 02, 2016, 11:14:21 AM by Qinn »

andywhite

  • Administrator
  • Full Member
  • *****
  • Posts: 119
  • Karma: +0/-0
    • View Profile
Re: Possible DHCP error
« Reply #1 on: March 02, 2016, 12:25:02 PM »
Thanks for the report, I'll take a look .

ISC dhcpd was replaced with dnsmasq recently, and thats where this bug came from i'm sure.  should be a quick fix

Qinn

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Possible DHCP error
« Reply #2 on: March 02, 2016, 04:23:45 PM »
Thanks for the quick reply!
Not to be bugging you ;) its just a minor cosmetic bug, but in the status.php there is a "cat / var/ etc / dhcpd.conf: No such file or directory" (of course without the spaces ;) )
This just confused me a bit, as at first I overlooked the error log which does mention the right path / var / etc / dnsmasq / dhcpd.conf (see my first post)
« Last Edit: March 02, 2016, 04:52:36 PM by Qinn »

andywhite

  • Administrator
  • Full Member
  • *****
  • Posts: 119
  • Karma: +0/-0
    • View Profile
Re: Possible DHCP error
« Reply #3 on: March 02, 2016, 06:18:54 PM »
thanks, I look at the status.php see what needs to change.

i took a quick look, this is a bug in dnsmasq, that syntax is correct upto version 2.65 of dnsmasq, but 2.66 introduced a change that is behind this error.

I think we can work around it by adding the subnet mask at the end like this

Code: [Select]
dhcp-range=set:opt2,192.168.5.10,192.168.5.20,static,255.255.255.0
the 'static' parameter , is the mode of operation for the range, i.e. only issue static addresses.  I'll try look later see if that workaround will address the problem.


Qinn

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Possible DHCP error
« Reply #4 on: March 02, 2016, 07:04:16 PM »
Looks promising,thanks for the hard work Andy!
« Last Edit: March 02, 2016, 07:45:01 PM by Qinn »

andywhite

  • Administrator
  • Full Member
  • *****
  • Posts: 119
  • Karma: +0/-0
    • View Profile
Re: Possible DHCP error
« Reply #5 on: March 03, 2016, 09:51:35 AM »
I'm hoping this is fixed in b98 , if you can test please...

Qinn

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Possible DHCP error
« Reply #6 on: March 03, 2016, 01:31:20 PM »
In  generic-pc-1.10.2b97(i386) I added the checkmark at Deny unknown clients and instantly the DHCP error occured in the log. I then uploaded firmware  generic-pc-1.10.2b98(i386) and then the error was gone and ip addresses were assigned on mac address, so all looked well. I had a quick look at the status.php and everything looked fine "dhcp-range=set:opt2,192.168.5.10,192.168.5.20,static,255.255.255.0", the static is in there and the subnet mask is added. B.t.w. nice that you added dnsmasq to the statusline line instead of only dhcpd.conf.

I further tested generic-pc-1.10.2b98(i386)  by removing the mac address of a machine from the list of reservations. After I renewed the IP of this machine it got an IP address in the available range. So preliminary conclusion must be that the DHCP error is gone, but Deny unknown clients is not working. yet. If you want more testing let me know!
« Last Edit: March 03, 2016, 01:37:45 PM by Qinn »

andywhite

  • Administrator
  • Full Member
  • *****
  • Posts: 119
  • Karma: +0/-0
    • View Profile
Re: Possible DHCP error
« Reply #7 on: March 03, 2016, 02:11:31 PM »
damn, ok , I think i'll have to look at patching dnsmasq :( , I reported a bug, but I don't think I'll hear of a fix soon, so will have to look at fixing it ...

Thanks for testing !

Qinn

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Possible DHCP error
« Reply #8 on: March 03, 2016, 02:34:13 PM »
Thanks for the quick reply for now I will stay on generic-pc-1.8.2b78, but if you'll come up with something I will gladly test it.

Qinn

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Possible DHCP error
« Reply #9 on: March 04, 2016, 06:34:24 AM »
Just a wild guess looking at line #298 http://fossies.org/linux/dnsmasq/dnsmasq.conf.example, could a "#dhcp-ignore=tag:!known" maybe be an idea?

andywhite

  • Administrator
  • Full Member
  • *****
  • Posts: 119
  • Karma: +0/-0
    • View Profile
Re: Possible DHCP error
« Reply #10 on: March 04, 2016, 07:35:09 AM »
it turns out the MAN page is incorrect and that it accepting a config like what the MAN page suggests is a bug.

the correct format is not

Code: [Select]
dhcp-range=set:opt2,192.168.5.10,192.168.5.20,static
but

Code: [Select]
dhcp-range=set:opt2,192.168.5.10,static
new build out in a few mins

Qinn

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Possible DHCP error
« Reply #11 on: March 04, 2016, 08:34:12 AM »
Tested generic-pc-1.10.2b99 (i386) it works like a charm dhcp only responds to the reserved clients, sorry for my useless remark  :-[ about the #dhcp-ignore=tag:!known". So now I will move over to the 1.10 builds.

andywhite

  • Administrator
  • Full Member
  • *****
  • Posts: 119
  • Karma: +0/-0
    • View Profile
Re: Possible DHCP error
« Reply #12 on: March 04, 2016, 09:01:19 AM »
Great!  Onto the next bug :)


Qinn

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Possible DHCP error
« Reply #13 on: March 04, 2016, 09:04:43 AM »
OffTopic: I've noticed that with the 1.10 versions, in contrast to 1.8 versions, the IP's from the reservations are now in the Diagnostics: DHCP leases, which is rather nice.