Networking Forums

Networking Forums > Computer Networking > Linux Networking > dhcpd question

Reply
Thread Tools Display Modes

dhcpd question

 
 
ScottReeve
Guest
Posts: n/a

 
      04-17-2007, 12:23 AM

I want to hand out a user-defined option, 184.
In that option, I want to give out two ip addresses and a 6-byte field
(ip address and then "9*)

I looked at the man pages for dhcp-options and I added the two option
lines below.

It starts up fine without those two "options" lines - so it reads the
subnet and range fine.
(there is a 192.168.0/24 interface on eth1)


subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.10 192.168.0.30;
option o184 code 299 = string;
option o184 01:04:c0:a8:00:0a:02:04:c0:a8:00:0a:03:04:c0:a8:00 :0a:
04:06:c0:a8:00:38:09:aa;
}



When I comment out the first option line, it gives this error:
/etc/dhcpd.conf line 5: unknown option dhcp.o184
option o184 01:
^
Configuration file errors encountered -- exiting


When I comment out the second line, it gives this error:
/etc/dhcpd.conf line 4: option definitions may not be scoped.
option o184 code
^
Configuration file errors encountered -- exiting


I can't tell from the man pages which line I should be using, or
both. It looks like I just need the second line, but it also appears
that the man pages have a typo, i.e. shouldn't that second line have
"code 195" in it?


Here are the man pages:

DATA STRING

option new-name code new-code = string ;

An option whose type is a data string is essentially just a
collection
of bytes, and can be specified either as quoted text, like
the text
type, or as a list of hexadecimal contents seperated by
colons whose
values must be between 0 and FF. For example:

option sql-identification-token code 195 = string;
option sql-identification-token 17:23:19:a6:42:ea:99:7c:22;



Any suggestions would be appreciated.

 
Reply With Quote
 
 
 
 
Allen McIntosh
Guest
Posts: n/a

 
      04-17-2007, 03:55 AM
> subnet 192.168.0.0 netmask 255.255.255.0 {
> range 192.168.0.10 192.168.0.30;
> option o184 code 299 = string;
> option o184 01:04:c0:a8:00:0a:02:04:c0:a8:00:0a:03:04:c0:a8:00 :0a:
> 04:06:c0:a8:00:38:09:aa;
> }


> When I comment out the second line, it gives this error:
> /etc/dhcpd.conf line 4: option definitions may not be scoped.
> option o184 code
> ^


Based on a working example I have and the error message, I would suggest
moving first option statement out of the subnet block and into the
declarations at the start of the file.

Here's what worked for me (highly edited)

option fubar code 150 = ip-address ;

subnet 192.168.11.0 netmask 255.255.255.0 {
option fubar 192.168.11.1 ;
option domain-name-servers 192.168.11.1 ;
(other stuff omitted)
 
Reply With Quote
 
Terence
Guest
Posts: n/a

 
      04-17-2007, 04:04 AM
The meaning of "option definitions may not be scoped" means the
definition of the variable must be made in the global section - i.e.
outside of any host { } or any other section

I also notice the way you define option 184:

> option o184 code 299 = string;
> option o184 01:04:c0:a8:00:0a:02:04:c0:a8:00:--snip- ;


- the 'o184' which you wrote is a variable definition. This can be
whatever you want... 'o184' is fine, but note it is not the option
code itself, so you can equally call it option-184 if you wanted. For
some reason you wrote 299, that should be the 184.

You also need both lines - the first defines the variable itself, the
second defines the value to assign to the variable.

So basically, in the end, you want a dhcpd.conf file that contains,
for example:

option o184 code 184 = string;

subnet 192.168.0.0 netmask 0.0.0.0 {
option 0184 01:04:c0:a8:00:0a:02:04:c0:a8:00:0a:
03:04:c0:a8:00:0a:04:06:c0:a8:00:38:09:aa;
}

- obviously you can adapt accordingly to use the host, pool etc...
declarations too; but you should get the point.


Terence

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dhcpd pechoi@syr.edu Linux Networking 0 06-08-2006 03:15 PM
dhcpd Damir Galič Linux Networking 1 09-08-2005 02:31 AM
DHCPD broadcast question sorchu_bf@hotmail.com Linux Networking 2 05-31-2005 11:27 PM
dhcpd question for homemade linux router purple_stars Linux Networking 8 05-24-2005 12:33 AM
dhcpd Henk Salomons Linux Networking 6 02-11-2005 05:08 PM



1 2 3 4 5 6 7 8 9 10 11