DHCP Option 120

Good morning, world.

I need to add an option 120 line to my dhcpd.conf. Trouble is, I’m getting ‘Option not supported’ when I crank up the service.
The syntax I tried was

option-120 123.132.132.123

Just thought of something - and that’s before coffee - is this option only supported at a host level and not at the top of the conf file?

Is it syntax? I tried sip-servers, sipserver, sipservers, SIP-server, option-120 as above etc etc etc. Alas to no avail.

I’m on OpenSuse 10.3 AMD 64. The machine is facing roughly due west. Thank you, thank you.

sparkie

Hi Folks,

I’m still struggling with this one. If anyone has any knowledge or insights on support for option 120 in the dhcp server on OpenSuse 10.3, I’d be most grateful to hear from you. Also, would this option be at host entry level or conf level?

Client is threatening to pull the plug and I am royally stuck!

Thanks

sparkie

You could try defining a new string like:
option option-120 code 120 = string;
in the global part of the config.

Haven’t played around with creating custom responses to dhcp clients lately.

This should be working, but don’t have a similar configuration handy.

I did snip this from Google’s cache, hope it helps;

On Mon, Nov 20, 2006 at 02:23:40PM +0100, Rune Kock wrote:
> A DHCP-server will only send those options that the client asks for.
> So maybe your client doesn’t ask for option 120?

Ah, that’ll be it :slight_smile:

OK, so I changed the client’s /etc/dhclient.conf as follows:

send host-name “wibble”;
option sip-server-address code 120 = { unsigned integer 8, ip-address };
request subnet-mask, broadcast-address, time-offset, routers, domain-name,
domain-name-servers, host-name, nis-domain, nis-servers, ntp-servers,
sip-server-address;

and dnsmasq still has:

dhcp-option=120,1,192.168.1.1

Now, here’s the end of the response I get back as seen by tcpdump:

    0x0140:  036c 616e 0c06 7769 6262 6c65 7808 ffff  .lan..wibblex...
    0x0150:  ffff c0a8 0101 ff                        .......

So there’s option 120 (0x78), but for some reason the value ‘1’ has been
encoded as ff ff ff ff, when I need it to be 01.

I tried changing to

dhcp-option=120,1b,192.168.1.1

but then the response I got back was no good as the whole lot was intepreted
as an ASCII string:

    0x0140:  036c 616e 0c06 7769 6262 6c65 780e 3162  .lan..wibblex.1b
    0x0150:  2c31 3932 2e31 3638 2e31 2e31 ff         ,192.168.1.1.

Ah, but it seems I was misunderstanding the man page. OK, this seems to do
the trick:

dhcp-option=120,01:C0:A8:01:01

Thanks for pointing me in the right direction.

It would be nice if I could mix’n’match integers and IP addresses though,
because then I could have

dhcp-option=120,1,0.0.0.0

which would substitute the “correct” IP address automatically.

Regards,

Brian.

This should be working, but don’t have a configuration handy.

I did snip this from Google’s cache, hoping it helps trigger your brain in the right direction!

On Mon, Nov 20, 2006 at 02:23:40PM +0100, Rune Kock wrote:
> A DHCP-server will only send those options that the client asks for.
> So maybe your client doesn’t ask for option 120?

Ah, that’ll be it :slight_smile:

OK, so I changed the client’s /etc/dhclient.conf as follows:

send host-name “wibble”;
option sip-server-address code 120 = { unsigned integer 8, ip-address };
request subnet-mask, broadcast-address, time-offset, routers, domain-name,
domain-name-servers, host-name, nis-domain, nis-servers, ntp-servers,
sip-server-address;

and dnsmasq still has:

dhcp-option=120,1,192.168.1.1

Now, here’s the end of the response I get back as seen by tcpdump:

    0x0140:  036c 616e 0c06 7769 6262 6c65 7808 ffff  .lan..wibblex...
    0x0150:  ffff c0a8 0101 ff                        .......

So there’s option 120 (0x78), but for some reason the value ‘1’ has been
encoded as ff ff ff ff, when I need it to be 01.

I tried changing to

dhcp-option=120,1b,192.168.1.1

but then the response I got back was no good as the whole lot was intepreted
as an ASCII string:

    0x0140:  036c 616e 0c06 7769 6262 6c65 780e 3162  .lan..wibblex.1b
    0x0150:  2c31 3932 2e31 3638 2e31 2e31 ff         ,192.168.1.1.

Ah, but it seems I was misunderstanding the man page. OK, this seems to do
the trick:

dhcp-option=120,01:C0:A8:01:01

Thanks for pointing me in the right direction.

It would be nice if I could mix’n’match integers and IP addresses though,
because then I could have

dhcp-option=120,1,0.0.0.0

which would substitute the “correct” IP address automatically.

Regards,

Brian.

I dug around a little, the syntax you’re using looks more like dnsmasq options than dhcpd.conf.

I found a page that discusses dhcpd.conf options, and how to set them for new option numbers (evidently #120 hasn’t been ‘built-in’ yet)

This is the man page:

5:dhcp-options - Linux Man Pages Manual Documentation for Linux / Solaris / UNIX / BSD

There it discusses how to set up new options and provide parameters for them. (almost said options for options!)

looks like your desired syntax would be:

option new-name code new-code = ip-address ;

Thus:

option sip-server code 120 = ip-address;
option sip-server = 123.123.123.123;

The first line defines a name and what type of parameters it takes, the second line does the actual set up of that option.

The write up in the link is decent, just takes a moment to get head wrapped around it… and now I think my head is all pointy and bumpy from that one. Never looked at dhcp options that hard in the past.

Take Care,

Lornix
lornix@lornix.com

Thanks for replies on this one. I’ll play around with the option declaration syntax and report back.

sparkie

I also have to set a option 120 on my dhcp server; in fact I have set this option on my server, having found the info previously talked here very usefull;
but another I have another issue now; My dhcp client doesn’t request for a 120 option, and my server does not respond with such thing; I know it is possible to make my server respond with option 120 even if it is not requested, so I wonder how to do this ???
Thank you!

I doubt that will be much use, even if possible. If a client doesn’t request it, it’s not going to process it anyway.