How to configuration DHCP server on linux (CentOS)



1-Check the required package (dhcp)

#rpm -qa|grep dhcp

if do not find it, install
# rpm -ivh /media/CentOS_5.3_Final/CentOS/dhcp-3.0.5-18.el5.i386.rpm

2- Copy file and put in the right location and name as below

# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf

Overwrite if you are confirmed-> y

3-Edit file

#vi /etc/dhcpd.conf

================

##############Must the same as your server subnet
subnet 192.168.1.0 netmask 255.255.255.0 {

# --- default gateway
         option routers                  192.168.1.111;
         option subnet-mask              255.255.255.0;
#option nis-domain               "domain.org";
        option domain-name              "sample.edu.jp";
        option domain-name-servers      192.168.1.112;
        option time-offset   -18000; # Eastern Standard Time
#option ntp-servers   192.168.1.1;

##############Must the same as your server subnet

range dynamic-bootp 192.168.1.100 192.168.1.122;
        default-lease-time 21600;  ## In Second
        max-lease-time 43200;
}
============================================
save and exit

4-restart service named dhcpd

# service dhcpd restart

Shutting down dhcpd:            [  OK  ]
Starting dhcpd:                 [  OK  ]

5-To enable dhcp server work after next reboot

# chkconfig  --level 35 dhcpd on

6- Stop Firewall setting

# service iptables stop

Comments

Popular posts from this blog

5 easy ways to earn money online from home For student

All Command for Linux

How to enable screen sharing on Mac OSX