Friday, October 8, 2010

DHCP configuration on RHEL 5.x (Linux)

Before we begin with the steps to config a dhcp server.. we need to determine or decide on what class of ip we need for our network and also the ip for your server too... then set that ip for your computer (which is to become a dhcp server for your network)

 setting ip address for your would be dhcp server

  1. neat-tui
  2. Set ip address (eg: 10.0.0.1)
  3. Set its netmask (eg: 255.0.0.0 if the ip of machine is as given above)
  4. You donot need to set gateway as its going to be a server
  5. Restart your network service (service network restart)
  6. If you want you can confirm your new ip address before you begin with the steps below...
  7. If you are done with all that then you can begin with the steps given below for configuring your dhcp server

Steps for configuring DHCP on your RHEL (Red Hat Enterprise Linux) Ver. 5.x

  1. Yum -y install dhcp*
     
  2. cp /usr/share/dco/dhcp-*/dhcpd.conf.sample /etc/dhcpd.conf 

    (or)

    cat /usr/share/dco/dhcp-*/dhcpd.conf.sample > /etc/dhcpd.conf

    NOTE:
    * = version of dhcp on your computer (eg: dchp-3.0.5)


     
  3. /etc/init.d/dhcpd start  (or) service dhcpd start

     
  4. chkconfig dhcpd on

     
  5. vim /etc/dhcpd.conf

    edit lines in the above file as follows

    • Give network address in subnet 10.0.0.0 netmask 255.0.0.0;
       
    • mention the range of ip we require ie. range dynamic-bootup 10.0.0.1 10.0.0.253
       
    • Save and quit the file with :wq

    Restart dhcp service and its deamon dhcpd to "on"

    ie. /etc/init.d/dhcpd restart (or) service dhcpd restart

    (&)

    chkconfig dhcpd on

    That's its you are thru.....

    Now you can set another system in dhcp mode to obtain an ip address from its server and restart its "network" service and check its ip address with "ifconfig" to see if your dhcp server is running well......

    and you will see it is.... & that you have done configuring your computer to a running dhcp server..











No comments: