Sunday, April 3, 2016

DHCP Server Configuration

1. Configure static IP Address for the DHCP server

vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
NETWORK=192.168.0.0
NETMASK=255.255.255.0
IPADDR=192.168.0.150

2. Install DHCP
yum -y install dhcp

3. chkconfig dhcpd on

4. vi /etc/sysconfig/dhcpd
DHCPDARGS=eth0

5. cp /usr/share/doc/dhcp-*/dhcpd.conf.sample /etc/dhcp/dhcpd.conf

6. vi /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
authoritative;
log-facility local7;

option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.150;
option domain-name-servers 192.168.0.1;
option domain-name "mainak.com";

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.54 192.168.0.60;
}

7. service dhcpd start

No comments: