Advertisement

02.11.2008 at 10:45PM PST, ID: 23155329
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Add Option 125 into dhclient.conf
Tags: Internet Systems Consortium, Inc., dhclient, DHCP
Hi, experts:
I download the DHCP client source code from "http://www.isc.org/index.pl?/sw/dhcp/".
I want to use DHCP Option 125 to get vendor-specific information.  ( Device < = = > Gateway )
A DHCP request is sent from the Device that contains the Device Identity to the Gateway. So the Gateway can get the Device Identity.
A DHCP response is sent from the Gateway that contains the Gateway Identity to the Device. So the Device can get the Gateway Identity.
I want to get the Gateway Identity and save it into file. So I can read this information at other application. I have already asked this question in  DHCP Forum, but I still don't get the help.
What should I do?
Could anyone give me a sample configuration showing use of options 124/125?
Thank you.
Start your free trial to view this solution
Question Stats
Zone: Networking
Question Asked By: TKD
Solution Provided By: Nopius
Participating Experts: 1
Solution Grade: A
Views: 46
Translate:
Loading Advertisement...
02.12.2008 at 07:10AM PST, ID: 20875394

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 07:27AM PST, ID: 20875594

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 06:20PM PST, ID: 20881146

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 06:35PM PST, ID: 20881215

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 06:52PM PST, ID: 20881282

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 06:56PM PST, ID: 20881300

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 07:38PM PST, ID: 20881459

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 07:44PM PST, ID: 20881479

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 08:25PM PST, ID: 20881639

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 08:30PM PST, ID: 20881653

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 08:47PM PST, ID: 20881711

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 10:31PM PST, ID: 20882119

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 10:59PM PST, ID: 20882223

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 11:03PM PST, ID: 20882240

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.12.2008 at 11:24PM PST, ID: 20882300

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.14.2008 at 06:49PM PST, ID: 20899032

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.14.2008 at 07:43PM PST, ID: 20899226

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.15.2008 at 12:05AM PST, ID: 20900060

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.15.2008 at 01:07AM PST, ID: 20900244

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.18.2008 at 12:53AM PST, ID: 20918453

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.18.2008 at 01:44AM PST, ID: 20918688

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
02.12.2008 at 07:10AM PST, ID: 20875394

Rank: Guru

man dhclient-script
man dhclient-options

OK. Let's say on _server_ site you are using ISC DHCPd and define some option like:

option space local;
option local.gw-id code 101 = string

subnet 172.16.1.0 netmask 255.255.255.0 {
  range 172.16.1.110 172.16.1.120;
  option routers 172.16.1.100;
  vendor-option-space local;
  option local.gw-id "FreeBSD";
}


1) On _client_ side create /etc/dhclient.conf:
[cut]
option space local;
option local.gw-id code 101 = string;
option local-encapsulation code 124 = encapsulate local;

request local.gw-id;
[cut]

2) /etc/dhclient-up-hooks:
[cut]
enc > /tmp/variables.txt
[cut]

3) chmod +x /etc/dhclient-up-hooks

4) Release IP (run from local console): dhclient -r
5) Obtain IP: dhclient eth0
6) View /tmp/variables.txt
Among other options you will see:

new_vendor_encapsulated_options=65:7:46:72:65:65:42:53:44
 
OK, that's format from RFC: http://www.networksorcery.com/enp/rfc/rfc3925.txt

65 = 101 - vendor Id
7 - data length
46:72:65:65:42:53:44 - ASCII HEX "FreeBSD"

Read the above manuals - everything is there.
 
02.12.2008 at 07:27AM PST, ID: 20875594

Rank: Guru

Oops, thing go even better when you define correct /etc/dhclient.conf
With the above server config and this dhclient.conf:

option space local;
option local.gw-id code 101 = string;
vendor option space local;
request local.gw-id;


I've got this variables:
old_subnet_mask=255.255.255.0
new_vendor_encapsulated_options=65:7:46:72:65:65:42:53:44
old_domain_name_servers=212.122.1.2 212.122.1.201
old_broadcast_address=172.16.1.255
old_expiry=1202829379
new_subnet_mask=255.255.255.0
new_ip_address=172.16.1.117
new_network_number=172.16.1.0
new_local_gw_id=FreeBSD
old_dhcp_rebinding_time=525
old_dhcp_message_type=5
new_expiry=1202829982
new_dhcp_lease_time=600
new_dhcp_server_identifier=172.16.1.100
new_dhcp_renewal_time=300
LANG=ru_RU.UTF-8
new_routers=172.16.1.100
new_domain_name_servers=212.122.1.2 212.122.1.201
old_dhcp_server_identifier=172.16.1.100
new_dhcp_message_type=5
old_ip_address=172.16.1.117
old_vendor_encapsulated_options=65:7:46:72:65:65:42:53:44
old_dhcp_renewal_time=300
old_dhcp_lease_time=600
new_dhcp_rebinding_time=525
new_broadcast_address=172.16.1.255
old_network_number=172.16.1.0
old_routers=172.16.1.100

The good news is:
new_local_gw_id=FreeBSD

Now vendor attribute is decapsulated and named with standard naming notation as described in 'man dhclient-script' section BOUND

 
02.12.2008 at 06:20PM PST, ID: 20881146
Hi, Nopius:
In my ubuntu linux, it doesn't have 'dhclient-up-hooks'. It contains:
/etc/dhcp3/dhclient-enter-hooks.d
   debug ntpdate
/etc/dhcp3/dhclient-exit-hooks.d
   debug
What should I do?
 
02.12.2008 at 06:35PM PST, ID: 20881215

Rank: Guru

create this file and make it executable
 
02.12.2008 at 06:52PM PST, ID: 20881282
I only know that the Gateway supports DHCP option 125. I don't know how it defines options.
In the following statements:
-------------------------------------------------------------------
option space local;
option local.gw-id code 101 = string;
option local-encapsulation code 124 = encapsulate local;
request local.gw-id;
-------------------------------------------------------------------
You define a space named 'local' and define a option name local.gw-id and its code is 101.
So when execute 'request local.gw-id;', it means request dhcop option 101, right???
And this 'local' space contains the option name 'local-encapsulation' and its code is 124. Right???
 
02.12.2008 at 06:56PM PST, ID: 20881300

Rank: Guru

Oops, I've started Ubuntu Live CD and it has a different /etc/ layout.

On Ubuntu dhclient is compiled with different options (I've tested on Fedora), also hooks are different... I should try it on Ubuntu now.
 
02.12.2008 at 07:38PM PST, ID: 20881459
I have a question what is meaning of 'enc' in 'enc > /tmp/variables.txt' statement.
 
02.12.2008 at 07:44PM PST, ID: 20881479
I need to try :
option option-125 code 125 = string;
option option-125
7d:23:00:00:0d:e9:
1e:
01:0b:49:49:49:38:32:30:36:32:33:
02:6:38:32:30:36:32:33:03:
03:41:44:56;
request option-125;
Right???
 
02.12.2008 at 08:25PM PST, ID: 20881639

Rank: Guru

> So when execute 'request local.gw-id;', it means request dhcop option 101, right???

My above dhclient.conf is incorrect.

> You define a space named 'local' and define a option name local.gw-id and its code is 101.

Yes.

> And this 'local' space contains the option name 'local-encapsulation' and its code is 124. Right???

No. Option with code 124 encapsulates inside it all options defined in a space 'local'. In my case the only defined is the option with code 101...

What about using 'vendor' option space, I was not correct also. It uses option 43 for encapsulation, but you need 124 and 125.

Also I have no any hardware, that supports option 125 or 124. So I'm using ISC DHCPd and follow generic rfc3925 rules for encapsulating option 125.

That's my last config, it doesn't perform correct decapsulation for vendor sub-options, but you may do it yourself in your script. May be dhclient _can_ perform such decapsulation, but I have no much time to deal with it. Even raw values may be used.

Ubuntu site:

/etc/dhcp3/dhclient.conf (only added or modified lines):

option option-124 code 124 = string;
option option-125 code 125 = string;

# Here we encode option 124 with fake vendor id = ff:ff and sub-option number 2 with the value of "Ubuntu" string, read RFC3925 for more info

send option-124 ff:ff:08:02:06:55:62:75:6E:74:75;

request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, host-name,
        netbios-name-servers, netbios-scope, option-125;

/etc/dhcp3/dhclient-enter-hooks.d/env file (create it):
--[cut]--
env  > /tmp/variables.txt
--[cut]--

now release your dhcp address and obtain it again and see in /tmp/variables.txt
Look for new_ prefixed vars. As for me, I have:

new_option_125=ff:ff:9:1:7:46:72:65:65:42:53:44

That's the way I have encapsulated vendor option with vendor if ff:ff suboption numer 1 stringvalue "FreeBSD".




Accepted Solution
 
02.12.2008 at 08:30PM PST, ID: 20881653

Rank: Guru

What about 'enc', Ive misspelled, should be 'env'...
All received options are received as shell variables.
 
02.12.2008 at 08:47PM PST, ID: 20881711
Ok~ I will try it!
 
02.12.2008 at 10:31PM PST, ID: 20882119
Hi,
----------------------
/etc/dhcp3/dhclient-enter-hooks.d/env file (create it):
env  > /tmp/variables.txt
----------------------
It means:
I need to create a file In /etc/dhcp3/dhclient-enter-hooks.d/ directory and write the content "env
> /tmp/variables.txt", what is the file name???
Another question is
How does the DHCP client know which file to execute???

 
02.12.2008 at 10:59PM PST, ID: 20882223

Rank: Guru

> I need to create a file In /etc/dhcp3/dhclient-enter-hooks.d/ directory and write the content "env
> /tmp/variables.txt", what is the file name???

Yes

> How does the DHCP client know which file to execute???

It's hard coded in dhclient-script to execute every file in that directory

 
02.12.2008 at 11:03PM PST, ID: 20882240
So, the name of file is optional. Thank you.
 
02.12.2008 at 11:24PM PST, ID: 20882300

Rank: Guru

Yes, it can have any name, they are executed in alphabetical order.
 
02.14.2008 at 06:49PM PST, ID: 20899032
Hi,
I add the following lines into /etc/dhcp3/dhclient.conf:
----------------------------------------------------------------------
option option-125 code 125 = string;
request subnet-mask, broadcast-address, ....., option-125;
----------------------------------------------------------------------
I also configure the /etc/network/interfaces
----------------------------------------------------------------------
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
----------------------------------------------------------------------
After restarting the network (/etc/init.d/networking restart):
I view the /tmp/variables.txt, but I DON'T find any variables about option 125.
Can I say that the Gateway don't support DHCP option 125???
How can I know which DHCP options the Gateway support???
Thank you.
 
02.14.2008 at 07:43PM PST, ID: 20899226

Rank: Guru

> After restarting the network (/etc/init.d/networking restart)

You also may run 'dhclient -r' to release IP, then 'dhclient eth0' to get IP.

> I view the /tmp/variables.txt, but I DON'T find any variables about option 125.
Can I say that the Gateway don't support DHCP option 125???

Yes. This option wasn't  sent to you even when you requested it. According to RFC server MUST try to send you requested option (of course it it has it for you).

If you don't believe /tmp/variables.txt run 'tcpdump -s 2000  -w /tmp/dhcp.dump port bootps or bootpc', then release and obtain IP, then stop tcpdump and post the dhcp.dump file here or analyze it yourself with 'wireshark'.

> How can I know which DHCP options the Gateway support???

1) Read the gateway's manual.
2) Search vendor forums.
3) Ask vendor support.
4) You may try to use options 43 and 60 for vendor class identifier, read http://www.faqs.org/rfcs/rfc2132.html


 
02.15.2008 at 12:05AM PST, ID: 20900060
Hi,
Thank you.
Could you tell me how you use ISC DHCPd and configure the configuration file???
I will let DHCPd support DHCP option 125 and use dhclient to send a option-125 request to DHCPd.
 
02.15.2008 at 01:07AM PST, ID: 20900244

Rank: Guru

> Could you tell me how you use ISC DHCPd and configure the configuration file???

Here is my working dhcpd.conf with option 125 enabled, just use at as template:

option domain-name-servers y.y.y.y, x.x.x.x;
option option-125 code 125 = string;
default-lease-time 600;
max-lease-time 7200;
authoritative;
ddns-update-style none;
log-facility local7;
subnet 172.16.1.0 netmask 255.255.255.0 {
  range 172.16.1.110 172.16.1.120;
  option routers 172.16.1.100;
  option option-125 FF:FF:09:01:07:46:72:65:65:42:53:44;
}
 
02.18.2008 at 12:53AM PST, ID: 20918453
The vendor says that if I just send option-125 request without any data, the Gateway won't response any thing. So it supports DHCP option 125, but it don't response to the request without any data.
I have a problem to study the DHCP option 125 in RFC 3925.
-----------------------------------
option-code  : OPTION_V-I_VENDOR_OPTS (125)
option-len total length of all following option data in octets.
...
-----------------------------------
What's the meanning of "in octets"???
Is the number should be specified in octal???  or what?
Thank you.
 
02.18.2008 at 01:44AM PST, ID: 20918688

Rank: Guru

octets are bytes.
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628