[Dnsmasq-discuss] Restricting dhcp-range to certain MAC prefixes?

Simon Kelley simon at thekelleys.org.uk
Mon Jun 25 17:18:17 BST 2007


Dermot Bradley wrote:
>> test13 is in the same place as test12. It adds the address-named
>> path-component only if it exists in the filesystem, so you can have
>> default files in <tftp-prefix> along with a set of unique directories.
> 
> Thanks, I've built & installed test13. However I'm now having some TFTP
> problems when I test booting Aastra handsets - when they try to download
> the firmware file off dnsmasq's TFTP server there are errors:
> 
> Jun 25 15:03:09 testbox dnsmasq[11265]: TFTP sent
> /var/lib/tftpboot/9133i.st to 192.168.1.5
> Jun 25 15:03:09 testbox dnsmasq[11265]: TFTP error 0 Undefined error
> code received from 192.168.1.5
> Jun 25 15:03:09 testbox dnsmasq[11265]: TFTP failed sending
> /var/lib/tftpboot/9133i.st to 192.168.1.5
> Jun 25 15:03:14 testbox dnsmasq[11265]: TFTP sent
> /var/lib/tftpboot/9133i.st to 192.168.1.5
> Jun 25 15:03:14 testbox dnsmasq[11265]: TFTP error 0 Undefined error
> code received from 192.168.1.5
> Jun 25 15:03:14 testbox dnsmasq[11265]: TFTP failed sending
> /var/lib/tftpboot/9133i.st to 192.168.1.5
> Jun 25 15:03:15 testbox dnsmasq[11265]: TFTP sent
> /var/lib/tftpboot/9133i.st to 192.168.1.5
> Jun 25 15:03:47 testbox dnsmasq[11265]: TFTP failed sending
> /var/lib/tftpboot/9133i.st to 192.168.1.5
> 
> I did a tcpdump and had a look in Wireshark - this shows that the 1st
> and 2nd 512byte blocks are sent and ACKed fine but then when the 3rd
> block is sent the Aastra returns:
> 
>   Opcode: Error Code (5)
>   Error code: Not defined (0)
>   Error message: Undefined error code
> 
> Then the Aastra re-requests the file from the start and the same thing
> happens again at the 3rd block.
> 
> However once I switch to tftpd-hpa (which I've been using up till now)
> the Aastra successfully retrieves the file.

Just to check, is this a test13 problem, or does it happen with 2.39 too?

Please could you save the the Wireshark packet dumps (both tftpd-hpa and
 dnsmasq) to files and send them to me off-list?

Also, try setting

tftp-no-blocksize

which might work around problems in the client.
> 
>> There's not way to make dnsmasq authoritative for only some hosts.
> 
> The other problem that I'm now seeing is that when I boot (phone)
> devices that use DHCP they're getting IP allocated by the Windows box on
> the network here - in the past Dnsmasq always responded fast enough to
> get in their first, it seems since I added all the MAC checking etc to
> the dnsmasq.conf file Dnsmasq is now taking longer to offer an address
> than Windows (indeed a tcpdump showed Dnsmasq taking several seconds to
> ping the IP before offering it).
> 
> Is there any way I can reliable have Dnsmasq co-exist with another DHCP
> server where Dnsmasq will only allocate to certain MAC addresses and get
> those allocations performed before Windows has a chance?

The delay is whilst dnsmasq uses ICMP ping as a last-ditch check that
the address it's about to allocate is not in use. You can disable that
test using

no-ping

which might speed things up enough. Of course the best thing would be to
configure Window's DHCP server to ignore the relevent MAC addresses. I
have no idea how to do that.

Cheers,

Simon.




More information about the Dnsmasq-discuss mailing list