Re: dhcpcd and bootp.
Roy Marples
Sat Jan 17 00:35:26 2015
Hi Todd
On 16/01/2015 23:27, Blanchard, Todd wrote:
> From the the dhcpcd man page:
>
> “To enforce that *dhcpcd* only responds to DHCP servers and not BOOTP
> servers, you can *require* _dhcp_message_type_.”
>
> A test of the bootp server bootpd shows that the above does not
> work. Bootpd returns DHCP Message Type (53) – Offer. Perhaps this is
> a problem with bootpd?
>
> Nonetheless, I would like to separate DHCP and BOOTP from the client
> perspective.
>
> 1. To have dhcpcd accept an offer/ack only from a dhcp server, I can
> require option 51 (lease time). While this is perhaps not perfect, it
> works by rejecting the bootp offer because there is no lease time.
>
> 2. I am unable to make dhcpcd work **only** with a bootp server
> (ignore dhcp offers, but accept those from a bootp server). Any
> suggestions?
The problem is that the vendor area in the BOOTP protocol can contain
anything.
RFC1542 recommends it starts with 4 byte cookie (like DHCP in RFC2131)
so the rest of the content can be understood. However, there is no
mention on how the rest of the vendor area should look.
So, it's perfectly possible for a bootp server to send valid DHCP
options in the vendor area to confuse dhcpcd.
As such, 1) is entirely upto the user to try and find a non matching
option. I've updated the comment in the code you saw to this:
http://roy.marples.name/projects/dhcpcd/ci/e75e391234bd938660992d380e4bc8ca009b73ed?sbs=0
2) this is not presently supported and again for the reasons above isn't
an exact science to implement either.
So as this is a black art with no clear answer, maybe there is another
way to restrict this. So what is your use case?
Would blacklisting or whitelisting server ip addresses be of use as
dhcpcd supports this?
Thanks
Roy
Archive administrator: postmaster@marples.name