LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-23-2006, 05:24 AM   #1
nunuschi
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Rep: Reputation: 0
Exclamation URGENT: dhcp-options


I try to create my own dhcp options ( dhcp-options) in my server and send it to my client
It seems to work fine because I find my option in the dhcpd.leases file on my client. But, could we get the options contained in the dhcpd.leases in variables.
I don't want to play with the dhcpd.leases file.
When I try to recover the dhcp options with dhclient.scripts, it gives me only default options

Could you help me please?
 
Old 08-23-2006, 05:28 AM   #2
odcheck
Member
 
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 31
Take a look at your /etc/dhcp.conf
use #man dhcp-options
Or take a look at a How To on tldp.org
You mean options like router and so on?
***example****
ddns-update-style interim;
ignore client-updates;

subnet 192.168.1.0 netmask 255.255.255.0 {

# --- default gateway
option routers 192.168.1.2;
option subnet-mask 255.255.255.0;

# option nis-domain "domain.org";
# option domain-name "domain.org";
option domain-name-servers 192.168.1.2;

option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;

range dynamic-bootp 192.168.1.50 192.168.1.80;
default-lease-time 21600;
max-lease-time 43200;

# # we want the nameserver to appear at a fixed address
# host ns {
# next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
# }
}
 
Old 08-23-2006, 05:40 AM   #3
nunuschi
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Smile

Thanks to help me.
I just want to know how I can use my custome DHCP options defined on my server and client.
For example, How can I put custom options in system variables?
(the only way I found for the moment is to read the dhcpd.leases file
 
Old 08-23-2006, 05:58 AM   #4
odcheck
Member
 
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 31
I think that I don't really understand what you mean with "...custome DHCP options defined on my server and client"
Do you mean so that some clients need to have some special options?
Which system variables do you want to setup?
 
Old 08-23-2006, 07:42 AM   #5
nunuschi
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Original Poster
Rep: Reputation: 0
I created a "custom" dhcp option in my dhcp-options:
option sql-default-connection-name code 194 = text;
option sql-default-connection-name "PRODZA";

This option could be used by the client for my application?
But how can I use (interrogate or retrieve) this option in a script?

I know that the option is well configure because I find it in dhcp-leases file.

Thx
 
Old 08-23-2006, 01:56 PM   #6
nunuschi
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Any other idea?

Thanks in advance
 
Old 08-23-2006, 03:12 PM   #7
nunuschi
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Original Poster
Rep: Reputation: 0
In fact, all I want is retrieve and use the information sent by my dhcp server and use some of this information for a custom program. Is there a command that can interrogate the information send by my dhcp server?
 
Old 08-24-2006, 01:23 AM   #8
odcheck
Member
 
Registered: Aug 2006
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 978

Rep: Reputation: 31
Now I am on it ;-) Interesting question?
Maybe something for the programmers forum. Something like with cat and grep in a file and then read it out of there and deliver your requested informations to your special application. Did you ever tried the command netstat with -nlptu as option?
Sorry that I can't give you more helpful informations yet...

:-)
 
Old 08-24-2006, 08:44 AM   #9
nunuschi
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Original Poster
Rep: Reputation: 0
thanks a lot for your help. I hope that someone will help me
 
Old 08-24-2006, 01:55 PM   #10
nunuschi
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Exclamation

Could someone help me?

thx in advance
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dhcp options nunuschi Linux - Networking 1 08-23-2006 07:33 AM
Retrieving DHCP options tommyr1216 Linux - Networking 0 02-08-2006 12:50 PM
question about dhcp options Notwerk Linux - Networking 5 12-24-2005 03:24 PM
Custom DHCP Options Llawnroc Linux - Networking 1 09-08-2003 12:47 AM
DHCP vendor-encapsulated-options substring bwilliam79 Linux - Networking 1 10-29-2002 10:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration