HOw to add suboptions for option 122 in dhcp server

Ray Phillips r.phillips at jkmrc.com
Fri Mar 23 07:23:24 UTC 2007


Keeping in mind that I know very little about option 122 at present, 
having just quickly scanned rfc3495 ...

>2. Is there a option 122 calculator or calculator to convert ip 10.0.0.2 to
>04:0a:00:00:02

04 is the sub-option length, not part of the IP address.  10.0.0.2 
corresponds to the last four pairs of hex digits in that string.  One 
way to convert it is:

% echo '10.0.0.2' | awk -F\. '{printf("%02x:%02x:%02x:%02x\n",$1,$2,$3,$4)}'
0a:00:00:02
%


Ray


More information about the dhcp-users mailing list