LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 10-07-2011, 06:23 AM   #1
drManhattan
Member
 
Registered: Aug 2010
Location: Warsaw, Poland
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5-6,SLES10-11
Posts: 262

Rep: Reputation: 1
DHCP question


Hi

I have RHEL6 running and get IP from DHCP Server.
I only added BOOTPRO=dhcp to /etc/syconfig/network-scripts/ifcfg-eth0 file and everything works.
I only wanted to get IP, MASK, GATEWAY.

Why is this working even without instaling dhclient daemon ?

thx for help.
 
Old 10-07-2011, 06:40 AM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
dhclient will be called as part of the ifup-ethx script at boot time, or whenever the script is run. dhclient is used on the client machine, to ask the dhcp server for an IP address.

the daemon, dhcpd is run on the server, and answers the requests from dhclient.

dhclient is installed by default in every distro i have ever used, as its (in my experience) more common than setting a static address on the client machine.
 
Old 10-07-2011, 07:06 AM   #3
drManhattan
Member
 
Registered: Aug 2010
Location: Warsaw, Poland
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5-6,SLES10-11
Posts: 262

Original Poster
Rep: Reputation: 1
OK I understand now.

But how I can configure dhclient to query for particular infor from dhcpd server ?
I only have the following files installed.
Code:
[root@redhat6 ~]# rpm -ql dhclient-4.1.1-12.P1.el6_0.4.i686
/etc/NetworkManager
/etc/NetworkManager/dispatcher.d
/etc/NetworkManager/dispatcher.d/10-dhclient
/etc/dhcp
/etc/dhcp/dhclient.d
/sbin/dhclient
/sbin/dhclient-script
/usr/lib/pm-utils/sleep.d/56dhclient
/usr/share/doc/dhclient-4.1.1
/usr/share/doc/dhclient-4.1.1/README.dhclient.d
/usr/share/doc/dhclient-4.1.1/dhclient.conf.sample
/usr/share/doc/dhclient-4.1.1/dhclient6.conf.sample
/usr/share/man/man5/dhclient.conf.5.gz
/usr/share/man/man5/dhclient.leases.5.gz
/usr/share/man/man5/dhcp-eval.5.gz
/usr/share/man/man5/dhcp-options.5.gz
/usr/share/man/man8/dhclient-script.8.gz
/usr/share/man/man8/dhclient.8.gz
/var/lib/dhclient
Version of dhclient is :
Code:
[root@redhat6 ~]# rpm -qi dhclient-4.1.1-12.P1.el6_0.4.i686
Name        : dhclient                     Relocations: (not relocatable)
Version     : 4.1.1                             Vendor: Red Hat, Inc.
Release     : 12.P1.el6_0.4                 Build Date: Wed 06 Apr 2011 07:21:49 PM CEST
Install Date: Fri 15 Apr 2011 01:05:42 PM CEST      Build Host: x86-002.build.bos.redhat.com
Group       : System Environment/Base       Source RPM: dhcp-4.1.1-12.P1.el6_0.4.src.rpm
Size        : 648857                           License: ISC
Signature   : RSA/8, Thu 07 Apr 2011 09:13:23 AM CEST, Key ID 199e2f91fd431d51
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://isc.org/products/DHCP/
Summary     : Provides the dhclient ISC DHCP client daemon and dhclient-script
Description :
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
individual devices on an IP network to get their own network
configuration information (IP address, subnetmask, broadcast address,
etc.) from a DHCP server. The overall purpose of DHCP is to make it
easier to administer a large network.

To use DHCP on your network, install a DHCP service (or relay agent),
and on clients run a DHCP client daemon.  The dhclient package
provides the ISC DHCP client daemon.
I don't see any file which is responsible for behavior of dhclient binary file ?
Where I should configure dhclient ?

thx for help.

Last edited by drManhattan; 10-07-2011 at 07:08 AM.
 
Old 10-07-2011, 07:19 AM   #4
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
What do you want to configure?

The settings that dhclient receives, are set by the dhcpd.conf on the server.
 
Old 10-07-2011, 07:39 AM   #5
drManhattan
Member
 
Registered: Aug 2010
Location: Warsaw, Poland
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5-6,SLES10-11
Posts: 262

Original Poster
Rep: Reputation: 1
O would like to configure things below :
Code:
#
# Calomel.org  dhclient.conf  DHCP Client Configuration
#

backoff-cutoff 2;
initial-interval 1;
link-timeout 10;
reboot 0;
retry 10;
select-timeout 0;
timeout 30;

interface "em0"
 {
  supersede host-name "spaceship";
  supersede domain-name "domain.home";
  prepend domain-name-servers 127.0.0.1;
  request subnet-mask,
          broadcast-address,
          routers,
          domain-name,
          domain-name-servers,
          host-name;
  require routers,
          subnet-mask,
          domain-name-servers;
 }
Is there some e.g. /etc/dhclient.conf file where I can set these options above ?
 
Old 10-07-2011, 07:42 AM   #6
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
/etc/dhcp/dhclient.conf
 
Old 10-07-2011, 07:57 AM   #7
drManhattan
Member
 
Registered: Aug 2010
Location: Warsaw, Poland
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5-6,SLES10-11
Posts: 262

Original Poster
Rep: Reputation: 1
Yes I found it that file dhclient.conf can be placed in 2 paths :
- /etc/dhcp/dhclient.conf
- /etc/dhclient.conf

I found it in file /etc/sysconfig/network-scripts/ifup-eth

But I have one more question.
I have hostname on my client placed in /etc/sysconfig/network
as below :
Code:
[root@redhat6 dhcp]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=redhat6
On DHCP Server I distribute in /etc/dhcp.conf :
Code:
option domain-name              "yakobe.pl";
When I type on the client `hostname -f`
Code:
[root@redhat6 dhcp]# hostname -f
yakobe.pl
Why I don't get FQDN ?

thx for help.
 
Old 10-07-2011, 08:17 AM   #8
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
Have you set a host declaration in dhcpd.conf for that host?
ie: a static lease?
 
Old 10-07-2011, 08:20 AM   #9
drManhattan
Member
 
Registered: Aug 2010
Location: Warsaw, Poland
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5-6,SLES10-11
Posts: 262

Original Poster
Rep: Reputation: 1
Here is /etc/dhcpd.conf file from my dhcp server :
Code:
[root@centos11 ~]# cat /etc/dhcpd.conf
#ddns-update-style interim;
ddns-update-style ad-hoc;
ignore client-updates;

subnet 192.168.56.0 netmask 255.255.255.0 {

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

#	option nis-domain		"domain.org";
	option domain-name		"yakobe.pl";
	option domain-name-servers	8.8.8.8,8.8.4.4;

	option time-offset		-18000;	# Eastern Standard Time
	option ntp-servers		192.168.56.127;
#	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.56.128 192.168.56.254;
	default-lease-time 21600;
	max-lease-time 43200;

	# we want the nameserver to appear at a fixed address
	#host centos11 {
		#next-server marvin.redhat.com;
#		hardware ethernet 08:00:27:EB:6B:30; 
#		fixed-address 192.168.56.197;
#	}
	host redhat6 {
		#next-server marvin.redhat.com;
		hardware ethernet 08:00:27:DA:81:EF;
		fixed-address 192.168.56.194;
		option host-name redhat6;
	}
	
	host redhat5 {
		fixed-address 192.168.56.195;
		hardware ethernet 08:00:27:3C:27:B0;
	}
	host solaris10 {
		fixed-address 192.168.56.100;
		hardware ethernet 8:0:27:25:f9:33;
	}
	host opensolaris {
		fixed-address 192.168.56.101;
		hardware ethernet 8:0:27:f2:44:d3;
	}
}
 
Old 10-07-2011, 08:35 AM   #10
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
Quote:
option host-name string;
This option specifies the name of the client. The name may or may not be qualified with the local domain name (it is preferable to use the domain-name option to specify the domain name). See RFC 1035 for character set restrictions. This option is only honored by dhclient-script(8) if the hostname for the client machine is not set.
http://linux.die.net/man/5/dhcpd-options

try removing the hostname in /etc/sysconfig/network, where does that sit us?
 
  


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 question dividingbyzero Linux - Networking 4 10-02-2008 09:30 PM
DHCP question wabob Slackware 2 05-02-2007 02:02 PM
DHCP Question depam Linux - Software 1 09-08-2006 11:46 PM
DHCP question leiw Linux - General 8 08-04-2006 08:26 PM
A DHCP question johnjoe Linux - Networking 1 07-21-2006 08:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 12:22 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