Thursday, June 2, 2016

Configure DHCP in Linux


First Go to the rpm directory where dhcp rpm is stored

# rpm -ivh dhcp-version-number.rpm

# vim /etc/dhcpd.conf

and then paste the following lines in that file

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.50 192.168.1.100;
option domain-name-servers 192.168.1.1;
option domain-name "yourdomain.com";
option netbios-name-servers 192.168.1.1;
option routers 192.168.1.1; #Default Gateway Address
option broadcast-address 192.168.1.255;
default-lease-time 2678400;
max-lease-time 2878400;
}

#To fix an IP Address

host computername {
hardware ethernet 00:50:da:65:07:74;
fixed-address 192.168.1.51;
}

save and exit the file

# service dhcpd start
# service dhcpd status
if "service is running" message appears then you have successfully configured the Dhcp Server. Now enable the clients to get IP from dhcp server by typing command
# setup
Then select Network configuration
and Select your LAN Card
Check the dhcp option by pressing spacebar and then quit and restart the network service

# service network restart

to permanently ON the dhcp service at startup, type command

# chkconfig --level 35 dhcpd on

Feel free for any further queries

Regards
Muhammad Farrukh`

No comments:

Post a Comment