Setup DHCP Server in Linux

Its easy to setup DHCP server in Linux with full control over the IP's and what IP's are assigned to client hosts. We would be using DHCP package via YUM for this setup. DHCP is used for dynamic assinging of IP addresses for the clients in a network. First of all we would install the dhcp package.

# yum -y install dhcp

Now we need top edit the dhcpd.conf file with the appropriate networks and subnets.

Edit dhcpd.conf

# vi /etc/dhcp/dhcpd.conf 
ddns-update-style none;
ignore client-updates;
subnet netmask {
# --- default gateway
        option routers        ; (Gateway IP)
        option subnet-mask    ;
        option domain-name              "pps.local";
        option domain-name-servers; (DNS Server IP)
        range dynamic-bootp; -- Range of IP's for the Network
        default-lease-time 3600;
        max-lease-time 7200;
        allow booting; (this is if you are using PXE boot)
        allow bootp; (this is if you are using PXE boot)
        next-server;(this is if you are using PXE boot)
        filename "pxelinux.0"; (Only used if you are using PXE boot)

Save and quit the file.

Restart the dhcpd service

# service dhcpd restart

Make sure DHCP service is enabled at runtime

# chkconfig dhcpd on

If you encounter any errors during the process, let us know via Contact Us and will get it resolved promptly.

Linux Related Articles . . .

To generate a SHA256 certficate in linux all you need to do is run this openssl command and you will...
This a very useful One liner command to insert IP and hostname into /etc/hosts file and is particularly useful when...
Its possible to use awk in Alias command. I did that by simply just modifying some parenthesis and there you...
Its possible to run a script via Alias command. All you need is to modify the .bashrc and then source...
This article will guide you on creating a custom Self-signed SSL Certificate in no time. For creating one you would...