DHCP Server with CentOS 6.4 within VirtualBox

VitualBox Setup
CentOS as Server
Network Adapter 1(eth0) == Bridged Adater
Network Adapter 2(eth1) == Internal Network, Name: auth0, Promiscuous Mode: Allow All.
Screen Shot 2013-12-08 at 7.41.09 PM

Ubuntu as Client
Network Adapter 1(eth0) == Internal Network, Name: auth0, Promiscuous Mode: Allow All.
Screen Shot 2013-12-08 at 7.41.28 PM

DHCP server setup
yum -y install dhcp —> install DHCP packages

vim /etc/sysconfig/dhcpd
DHCPDARGS=eth1 —>add yr interface name for listen

cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf —> cppy sample dhcpd config

vim /etc/dhcp/dhcpd.conf —> to edit dhcpd config file (I delete it all and insert as below according to yr need)

ddns-update-style none;
authoritative;
log-facility local7;
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.20.255;
option routers 172.16.10.1;
option domain-name-servers 192.168.20.1;
option domain-name “centos”;
subnet 192.168.20.0 netmask 255.255.255.0 {
range 192.168.20.10 192.168.20.100;
}

service dhcpd restart —> restart DHCP server
Screen Shot 2013-12-08 at 7.36.57 PM

chkconfig dhcpd on —> make sure that will auto start

cat /var/lib/dhcpd/dhcpd.leases —> to check client connectScreen Shot 2013-12-08 at 7.35.43 PM
Screen Shot 2013-12-08 at 7.43.31 PM

Leave a comment