[Dnsmasq-discuss] How to configure routing via DHCP?
simon at thekelleys.org.uk
Tue Feb 7 11:31:17 GMT 2006
Dirk Schenkewitz wrote:
>>If you really want to set up static routes and use option 33 then you'll
>>need to do some configuration of your dhcp client: we're covered this
>>ground before, and the relevant information is here:
> Aha. Thanks for that link. Hmmm... Ok, I see. Thank you!
Just for completeness, it's worth noting that option 33 is obsolete and
deprecated. The reason is that it has no way to send a netmask. This was
fine in the days before CIDR, where the netmask could be derived from
the address, but it doesn't work with CIDR.
Option 33 has been replaced with option 121, which is defined in RFC
3442. This gives a way to encode the netmask within the DHCP option
data. For the next release of dnsmasq, I've added support for this
encoding, so it will be possible to do
I'm not sure if the ISC have added corresponding decode support in
dhclient. If not, there is some amazing shell code to do it here:
>>>- Does anybody know a link to a good documentation of the DHCP options
>>>(preferably with examples!)?
>>The canonical list (well, apart from new ones defined after it was
>>published) is RFC 2132: http://www.faqs.org/rfcs/rfc2132.html
> I had found that one (and overlooked that "The default route (0.0.0.0)
> is an illegal destination for a static route"). But I found it is not clear
> about how exactly these entries should be specified. Maybe because it
> specifies the format of the "transmitted packet" of that option. Perhaps how
> to specify it depends on the DHCP client.
It does depend on the client. In dnsmasq, you can always specify exactly
the bits you want in the transmitted packet, but using "hex and colons".
but for most things its easier to use one of the supported shortcuts.
text: dhcp-option=34,"some text"
(list of) IP addresses: dhcp-option=56,220.127.116.11,18.104.22.168
decimal number: dhcp-option=76,1
>>>That is, other than dnsmasq.conf, which is IMHO very good (for me, a few
>>>short examples work better than a detailed & complicated (or too short)
>>>description), but dnsmasq.conf does not mention option 33. :P
It does mention option 3 in the list of options-provided-bt default.
I'll add a "uncomentable line" to show how that can be overridden. I'll
also add an example for option 121
More information about the Dnsmasq-discuss