Configure DHCP Server Step-by-Step config Guide Using Webmin

Configure DHCP Server Using Webmin

Dynamic Host Configuration Protocol (DHCP) is a client/server protocol that automatically provides an Internet Protocol (IP) host with its IP address and other related configuration information such as the subnet mask and default gateway.

In our previous article, you have setup your DNS Server using Webmin, refer below link for more information.

Configure DNS Server Step-by-Step config Guide Using Webmin

dns_webmin_logo_ittroubleshooter-in-copy

In this article We will seen how to configure DHCP Server Using Webmin(web-based interface). Webmin tool offer to new system administrators to perform all system management task from via a web browser, Instead of using the command line console or terminal. You can also manage a system from the console or remotely.

My Network Setup:

DHCP  server ip address and hostname(RHEL7): 192.168.1.1 (server1)
Network name: IntranetDHCP
Network address: 192.168.1.0
Netmask: 255.255.255.0
Address range: 192.168.1.210 – 192.168.1.230  (Range of DHCP server gives 20 IPs)
Default lease time: 86400sec (24 hr.)
Maximum lease time:172800sec (48 hr.)
server name: server1
Default routers: 192.168.1.1
Broadcast address: 192.168.1.255
DNS servers: 192.168.1.10  8.8.8.8
192.168.1.10 -> DNS Server Local (our own DNS Server, within our network)
8.8.8.8 -> Google Public DNS

ittroubleshooter_introdhcp-copy

Step by Step configuration of DHCP Server Using Webmin

1) Setting up Webmin.

As previous, we have seen how to configure Webmin on Centos/RHEL7 systems, refer below link.

Setting up Webmin on Centos/RHEL7

2) Install the package for DHCP using Webmin.

After Log into Webmin, First we need to search “DHCP Server” and install the DHCP Server Packages, refer below screen shots.

ittroubleshooter_in_1

After search “DHCP Server”, Click on “Click here” option to downloaded the DHCP server Packages using YUM. If you are not configured the YUM server, refer the link.(Configure the Yum Server in Centos7/RHEL7/Fedora22)

ittroubleshooter_in_2

On Below screenshot, The DHCP Packages can be automatically installed by Webmin.

ittroubleshooter_in_3

Note: If you already installed the DHCP packages, then there is no need to perform above steps. Similarly you Go to Servers, and then click on “DHCP Server”.

3) Create a new subnet.

Now Go to Servers, then click on “DHCP Server” and Click on “Add a new subnet”.

ittroubleshooter_in_4

Enter the subnet description (In our case we are using IntranetDHCP). For the subnet you can provide the Network address, Netmask and Address range of DHCP Server. You can change the Default and Maximum lease time(In our case we are using 24 hr. and 48 hr. respectively) and Click “save” button, refer below screenshot.

ittroubleshooter_in_5

4) Edit DHCP Client options.

Click on “Edit client options”, It will apply to all subnets, shared networks, hosts and groups. refer below screen shot.

ittroubleshooter_in_6

On the next Step, You will add the Default routers, broadcast address and DNS Server and select “interim” option from Dynamic DNS update style. It will apply to subnet(i.e IntranetDHCP) which we have created above, refer below screenshot.

ittroubleshooter_in_7_new

Configuration of DHCP Server is over, now start the DHCP service.

ittroubleshooter_in_8

5) Check the status of DHCP service and make the service enable even after reboot of the server.

#systemctl status <service name> This command used for check the status of DHCP service.

[root@server1 ~]# systemctl status dhcpd
dhcpd.service - DHCPv4 Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/dhcpd.service; enabled)
   Active: active (running) since Fri 2016-12-30 04:49:34 EST; 10s ago
     Docs: man:dhcpd(8)
           man:dhcpd.conf(5)
 Main PID: 1270 (dhcpd)
   CGroup: /system.slice/dhcpd.service
           └─1270 /usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid

Dec 30 04:49:34 server1 systemd[1]: Started DHCPv4 Server Daemon.
Dec 30 04:49:35 server1 dhcpd[1270]: Internet Systems Consortium DHCP Server 4.2.5
Dec 30 04:49:35 server1 dhcpd[1270]: Copyright 2004-2013 Internet Systems Consortium.
Dec 30 04:49:35 server1 dhcpd[1270]: All rights reserved.
Dec 30 04:49:35 server1 dhcpd[1270]: For info, please visit https://www.isc.org/software/dhcp/
Dec 30 04:49:35 server1 dhcpd[1270]: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified i...ig file
Dec 30 04:49:36 server1 dhcpd[1270]: Wrote 2 leases to leases file.
Dec 30 04:49:36 server1 dhcpd[1270]: Listening on LPF/enp0s3/08:00:27:35:17:7c/192.168.1.0/24
Dec 30 04:49:36 server1 dhcpd[1270]: Sending on   LPF/enp0s3/08:00:27:35:17:7c/192.168.1.0/24
Dec 30 04:49:36 server1 dhcpd[1270]: Sending on   Socket/fallback/fallback-net
Hint: Some lines were ellipsized, use -l to show in full.
[root@server1 ~]#

ittroubleshooter_in_10

And # systemctl enable <service name> This command used for enable the service after reboot of the server.

[root@server1 ~]# systemctl enable dhcpd
ln -s '/usr/lib/systemd/system/dhcpd.service' '/etc/systemd/system/multi-user.target.wants/dhcpd.service'
[root@server1 ~]#

ittroubleshooter_in_9

9) Allow DHCP service on firewall.

[root@server1 ]# firewall-cmd --permanent --add-service=dhcp 
 success
[root@server1 ]# firewall-cmd --reload
 success
[root@server1 ]#

ittroubleshooter_in_11

Hope this post will help Linux/Unix beginners. Please share you feedback and Comments.!!!

 

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz