How to configure DHCP Server in Red Hat Linux ?

Discussion regarding the installation and configuration of Linux distributions.

How to configure DHCP Server in Red Hat Linux ?

Postby gardenair » Sat Apr 17, 2010 8:38 am

AOA,

I want to create a dedicated DHCP server in Red Hat Linux for a small office with a private range from 192.168.1.10 to 192.168.1.20

Kindly can u tell me the steps by which I may implement DHCP server.

thanks
garden
gardenair
Havaldaar
 
Posts: 106
Joined: Tue Dec 28, 2004 10:07 pm

Postby lambda » Sun Apr 18, 2010 4:19 am

Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
lambda
Major General
 
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Website: http://www.hungry.com/~fn/
Location: Lahore

Postby mudasir » Mon Apr 19, 2010 11:14 am

AOA,

Dear its very simple. Just install DHCP Server, then copy the below conf to /etc/dhcpd.conf ans simply restart service (service dhcpd restart)

Code: Select all

# Some features, google them
always-reply-rfc1048 true;
ignore client-updates;
authoritative;
ddns-update-style interim;
dynamic-bootp-lease-length 43200;
max-lease-time 43200;
default-lease-time 21600;

#To use All subnets available for DHCP.
subnet 0.0.0.0 netmask 0.0.0.0 {

# IP of main default gateway
option routers 192.168.1.1;

# Subnetmask to be given to clients
option subnet-mask 255.255.255.0;

#Domain info
option nis-domain "crystalnetworks.org";
option domain-name "crystalnetworks.org";

#DNS Servers to be provided to clients.
option domain-name-servers 208.67.222.222,208.67.220.220;

#Lease Time
option time-offset -18000;

#Range of IP's that is to be leased
range dynamic-bootp 192.168.1.10 192.168.1.20;

authoritative;
#IP of WINS Server if any other wise leave it commented
#option netbios-name-servers 192.168.1.10;
#option netbios-node-type 2;

}

Change some settings as per your requirement.
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
mudasir
Captain
 
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Website: http://www.crystalnetworks.org
Location: Dubai

Postby gardenair » Mon Apr 19, 2010 11:22 am

thanks fo the reply. well when I type on the following it show the result as

[root@pc1~]#rpm -qa dhcp
[root@pc1~]#

It just show me the prompt.I think the dhcp is not installed .Please let me guide that how may I install DHCP in the machine ?
Last edited by gardenair on Mon Apr 19, 2010 12:28 pm, edited 1 time in total.
gardenair
Havaldaar
 
Posts: 106
Joined: Tue Dec 28, 2004 10:07 pm

Postby mudasir » Mon Apr 19, 2010 11:31 am

Which distro are you using
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
mudasir
Captain
 
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Website: http://www.crystalnetworks.org
Location: Dubai

Postby gardenair » Mon Apr 19, 2010 12:29 pm

Red Hat Linux 4 AS
gardenair
Havaldaar
 
Posts: 106
Joined: Tue Dec 28, 2004 10:07 pm

Postby mudasir » Mon Apr 19, 2010 1:52 pm

Use the Installation medium to install DHCP Server RPM then copy the config above.
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
mudasir
Captain
 
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Website: http://www.crystalnetworks.org
Location: Dubai

Postby gardenair » Mon Apr 19, 2010 2:13 pm

thanks for the help. Well I want to know a basic question that for making a DHCP server in Linux does it require DNS server to resolve computer names.

Just for example. I have 10 computers (Windows xp and Fedora 7 ) in a my lab and all are connected through a workgroup envioroment with a IP Scheme 192.168.1. There is no gateway as well.

For assigning automatic IP addresses from Red Hat Linux Server does it need DNS and default gateway to work ?

2--- what changes should I apply in the DHCP configuration file which u have sent .Kindly if u make a little bit change for my own seanario should be too much gratefull.
gardenair
Havaldaar
 
Posts: 106
Joined: Tue Dec 28, 2004 10:07 pm

Postby mudasir » Mon Apr 19, 2010 6:26 pm

Dear,

Its not necessary to give Default Gateway, but i am not sure about DNS as i have not tried this, but you can always test it out.
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
mudasir
Captain
 
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Website: http://www.crystalnetworks.org
Location: Dubai

Postby gardenair » Wed Apr 21, 2010 11:34 am

well I have installed dhcp for test purpose. I have copy and past the dhcp configuration file in /etc/dhcpd.cong file

There is no router,no DNS and no default gate way. I want want that my clinet machine which is windows xp should automatically assign IP address. For that purpose how to make remarks like


IP of main default gateway
option routers 192.168.1.1;


should I use ; or rem to disable that line .
gardenair
Havaldaar
 
Posts: 106
Joined: Tue Dec 28, 2004 10:07 pm

Postby mudasir » Wed Apr 21, 2010 1:14 pm

Dear i am not clear what do you want. Please clearly state what you need.
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
mudasir
Captain
 
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Website: http://www.crystalnetworks.org
Location: Dubai

Postby gardenair » Mon Apr 26, 2010 10:22 am

thanks for your help. Well Sir..I have successfully configure my DHCP server. Following is my configuration file.Which has minimum requirement.


Code: Select all

#   ddns-update-style@interm;
#   ignore@client-updates;

   subnet@192.168.1.0@netmask 255.255.255.0 {
   range@192.168.1.100@192.168.1.105;

   option@time-offset      -18000; #Eastern Standard Time
   default-lease-time@21600;
   max-lease-time@43200;

   host wks-2 {   //You can also assign specific IP addresses    based on the clients             //MAC address
      hardware ethernet 08:00:2b:4c:59:23;
     fixed-address 192.168.1.100;
   }
}
gardenair
Havaldaar
 
Posts: 106
Joined: Tue Dec 28, 2004 10:07 pm


Return to “%s” Installation

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron