[Dnsmasq-discuss] BOOTP/TFTP config

Simon Kelley simon at thekelleys.org.uk
Wed Apr 25 11:54:15 BST 2007


David Goodenough wrote:
> On Friday 20 April 2007 19:06, Simon Kelley wrote:
>> David Goodenough wrote:
>>> I am trying to use dnsmasq (on Debian) to do BOOTP and TFTP in order to
>>> netboot some Microtik RB112 boards.  But I am having some problems.
>>>
>>> I have the board on the other end of a USB ethernet adapter, quite
>>> separate from the rest of my network to keep things simple.
>>>
>>> I have configured the usb ethernet adapter to have an address of
>>> 192.168.6.254.
>>>
>>> In a local file I have a stripped down dnsmasq.conf which reads:-
>>>
>>> # Configuration file for dnsmasq to boot rb100
>>> #
>>>
>>> interface=usb-rb1xx
>>> dhcp-boot=vmlinux
>>> dhcp-host=00:05:42:08:*.*,192.168.6.1
>>> enable-tftp
>>> tftp-root=/var/lib/tftpd/rb1xx
>>>
>>> I then start dnsmasq with the following command:-
>>>
>>> sudo dnsmasq -C dnsmasq.rb100 -d
>>>
>>> But it never replies to the BOOTP request.
>>>
>>> Anyone got any ideas as to how to get this running?
>> You need to give a DHCP range, even if you only want explicitly
>> allocated addresses. The presence of the dhcp-range flag enables the
>> DHCP server for a particular subnet.
>>
>> Add
>>
>> dhcp-range=192.168.6.0,static
>>
>> and it will fly....
>>
>>
>> Cheers,
>>
>>
>> Simon.
>>
>>> David
>>>
> I tried that, and it still does not work.  Firstly I found that the
> ethernet address I was looking at was wrong, so I fixed that.  Now
> my dnsmasq.conf file looks like this:-
> 
> interface=usb-rb1xx
> dhcp-range=192.168.6.0,static
> dhcp-boot=vmlinux
>  
                            ^
Remove this: It's not needed and there's a remove possibility that it's
confusing things.

You just need

dhcp-host=00:0c:42:08:*:*,192.168.6.1


> enable-tftp
> tftp-root=/var/lib/tftpboot/rb1xx/
> 
> Inside wireshark monitoring the usb-rb1xx interface (which is configured
> to have address 192.168.6.254) I get lots of lines all of which are the same
> and wireshark displays as:-
> 
> No.     Time        Source                Destination           Protocol Info
>       1 0.000000    0.0.0.0               255.255.255.255       BOOTP    Boot 
> Request from 00:0c:42:08:80:eb (Routerbo_08:80:eb)
> 
> Frame 1 (342 bytes on wire, 342 bytes captured)
> Ethernet II, Src: Routerbo_08:80:eb (00:0c:42:08:80:eb), Dst: Broadcast 
> (ff:ff:ff:ff:ff:ff)
> Internet Protocol, Src: 0.0.0.0 (0.0.0.0), Dst: 255.255.255.255 
> (255.255.255.255)
> User Datagram Protocol, Src Port: bootpc (68), Dst Port: bootps (67)
> Bootstrap Protocol
>     Message type: Boot Request (1)
>     Hardware type: Ethernet
>     Hardware address length: 6
>     Hops: 0
>     Transaction ID: 0xccab0300
>     Seconds elapsed: 0
>     Bootp flags: 0x0000 (Unicast)
>         0... .... .... .... = Broadcast flag: Unicast
>         .000 0000 0000 0000 = Reserved flags: 0x0000
>     Client IP address: 0.0.0.0 (0.0.0.0)
>     Your (client) IP address: 0.0.0.0 (0.0.0.0)
>     Next server IP address: 0.0.0.0 (0.0.0.0)
>     Relay agent IP address: 0.0.0.0 (0.0.0.0)
>     Client MAC address: Routerbo_08:80:eb (00:0c:42:08:80:eb)
>     Server host name not given
>     Boot file name not given
>     Magic cookie: (OK)
>     Option: (t=60,l=9) Vendor class identifier = "Mikroboot"
>         Option: (60) Vendor class identifier
>         Length: 9
>         Value: 4D696B726F626F6F74
>     End Option
>     Padding
> 
> But silence comes the stern reply, these lines are all that appear.
> 

The packet you are grabbing is a standard BOOTP broadcast from the
client. There's three obvious possibilities why you are not seeing a
reply: either dnsmasq is not getting the packet (iptables/firewall
rules), it can't reply because of a configuration problem, or it's
replying but the packet is being intercepted by iptables on the way out.

Except in the first case dnsmasq will have logged something, so the next
stage is to consult your logfiles (or run dnsmasq -d so that you see log
output on the terminal)

If you see something like

BOOTP(usb-rb1xx) 192.168.6.1 00:0c:42:08:80:eb

then dnsmasq is doing the right thing and sending a reply

if you see something like

BOOTP(usb-rb1xx) 00:0c:42:08:80:eb <error message>

then there's a config problem, and the message should be a big hint.

HTH

Simon.





More information about the Dnsmasq-discuss mailing list