Wednesday, March 23, 2022

Set up DHCP Server Using Dnsmasq

 in This Tutorial you will Learn " How To Set up a DHCP Server Using Dnsmasq On Rocky Linux 8.5 "

Dnsmasq is a lightweight DNS, TFTP and DHCP server.
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.
_________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      |    IP -192.168.1.20        |     Hostname - www.primaryhost.com
_________________________________________________________________________________________
cat /etc/system-release ; sestatus ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf -y install dnsmasq
gedit /etc/dnsmasq.conf &>/dev/null
dhcp-range=192.168.0.50,192.168.0.150,12h  [ line 158 ]
# line 332: add entries for Gateway, NTP, DNS, Subnetmask
dhcp-option=option:router,192.168.0.1
dhcp-option=option:ntp-server,192.168.0.20
dhcp-option=option:dns-server,192.168.0.20
dhcp-option=option:netmask,255.255.255.0
systemctl restart dnsmasq
firewall-cmd --add-service=dhcp --permanent ; firewall-cmd --reload
________________________________________________________________________________________
Configure DHCP Client -
cat /etc/system-release ; sestatus ; hostname -I
dnf -y install dhcp-client
nmcli connection modify ens33 ipv4.method auto
nmcli connection down ens33; nmcli connection up ens33
________________________________________________________________________________________


No comments:

Post a Comment