[Dnsmasq-discuss] How to configure routing via DHCP?
simon at thekelleys.org.uk
Wed Feb 8 16:32:29 GMT 2006
Dirk Schenkewitz wrote:
> That's great, Thank you very much! (For the info and for supporting it.)
> Hmm, AFAIU RFC3442 describes the "raw" packet information as:
> '121' Length-byte Destination-descriptor Router-address
> while "Destination-descriptor" consistst of the netmask width and the
> "important part" of the network address (it can be 1 to 5 bytes long) and the
> "Router-address" is always 4 bytes long, optionally followed by one or more
> blocks of
> Destination-descriptor Router-address
> while the "Length-byte" specifies the number of "Destination-descriptor
> Router-address"-blocks and is "1" if there is only one such block.
No. the length byte is the number of bytes following. This is true for
all DHCP options, and it's important, since it allows code to manipulate
the following data without knowing anything about it. If the length was
the number of routes, then knowledge of the exact format of the option
would have to be built into any code which touched it.
> AFAIU, the "192.168.1.0/24" part in your example means
> Network-Adress/Netmask-Length and the 188.8.131.52 is the gateway. Will it be
> possible to do
> with dnsmasq?
Yes: it's already possible to have a comma-separated of IP addresses as
an option, (lots of DHCP options have n IP addresses and length 4*n).
The new code just allows an IP address to include a / character and
encodes it suitably if it does.
>>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,184.108.40.206,220.127.116.11
>>decimal number: dhcp-option=76,1
> Hmm... the colon form of 121,192.168.1.0/24,18.104.22.168 would be
> and the colon form of 121,192.168.1.0/24,22.214.171.124,10.128.0.0/9,10.129.3.4 (if
> supported) would be
the length byte is wrong (see above), otherwise that's right.
> if I got it right... Looks like this requires some less-trivial parsing &
> converting on your side...
> (For faster reading: 18x=24d, C0x=192d, A8x=168d, Ax=10d, 80x=128d, 81x=129d
> provided that I didn't miscalculate anything.)
More information about the Dnsmasq-discuss