- Dnsmasq – Install
- Dnsmasq – Configure DHCP Server
Enable integrated DHCP function in Dnsmasq and Configure DHCP Server.
Mục Lục
[1] Configure Dnsmasq.
[root@soncq ~]# vi /etc/dnsmasq.conf
# line 146: add (range of IP address to lease and term of lease)
dhcp-range=10.0.0.200,10.0.0.250,12h
# line 316: add (define default gateway)
dhcp-option=option:router,10.0.0.1
# line 325: add (define NTP, DNS, server and subnetmask)
dhcp-option=option:ntp-server,10.0.0.10
dhcp-option=option:dns-server,10.0.0.10
dhcp-option=option:netmask,255.255.255.0
[root@soncq ~]# systemctl restart dnsmasq
[2] If Firewalld is running, allow DHCP service. DHCP server uses 67/UDP.
[root@soncq ~]# firewall-cmd --add-service=dhcp --permanent
success
[root@soncq ~]# firewall-cmd --reload
success
[3] It’s OK all, Configure DHCP client on client computer and verify it works normally.