Configure DHCP Server Step-by-Step config Guide 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.

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

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.

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)

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

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”

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.

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.

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.

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

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 ~]#

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 ~]#

9) Allow DHCP service on firewall.

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

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

Src: http://ittroubleshooter.in/configure-dhcp-server-step-step-config-guide-using-webmin/

Share

2 thoughts on “Configure DHCP Server Step-by-Step config Guide Using Webmin”

  1. This is great and I also have proceed similar process however it was done over ubuntu-18.04 (64-bit Desktop). I have been using the internet through a public IP (196.207.123.xx) configured on a desktop.

    I want to use Webmin likewise ClearOS ie I wish to configure router (with IP 192.168.1.1), for generating LAN IPs whose range has set up 192.168.1.2 to 162.168.1.254 and create subnet for DHCP Server through webmin. I am planning an architecture shown here: https://www.youtube.com/watch?v=22XLM5uO2XI and covered all steps shown in above video series. I connected a laptop to router it assign me local ip 192.168.1.2. When I ping to public 196.207.123.xx through my laptop it is showing data packets but when I ping to google.com or other outside network it does not work for me.

    I do have screenshots of configured webmin, router etc but I did not find option here to share with you. Please suggest if you may help me out, for connecting my router generated IP based laptop to outside world.

    Reply
    • Since you are able to ping to IP, but unable to domain, it means, there is something wrong with the DNS configurations. Most probably your DNS is not properly configured in your DHCP settings.

      Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.