Lab04 DHCP - rosepheobieshea/SYS-255-Tech-Journal GitHub Wiki
Useful Commands for Windows
ipconfig /release
- releases the current dhcp lease
ipconfig /renew
- renews dhcp lease
ipconfig /all
- displays lots of wonderful information including the obtain and expiry date for dhcp lease.
Installing and configuring DHCP on Rocky Linux
- Install DHCP services
dnf install dhcp-server
- Configure with config file at
/etc/dhcp/dhcpd.conf
Config file should look like this:
subnet 10.0.5.0 netmask 255.255.255.0 {
option routers 10.0.5.2;
option subnet-mask 255.255.255.0;
option domain-name “rose.local”;
option domain-name-servers 10.0.5.5;
range 10.0.5.100 10.0.5.150;
default-lease-time 3600;
max-lease-time 14400;
}
Note: Lease times are measured in seconds. Also if you set them to the same value the service will not like it and not listen to you.
- Starting the service
systemctl start dhcpd
- Enable service to run at startup
systemctl enable dhcpd
- Configure firewall to allow DHCP service
firewall-cmd --add-service=dhcp --permanent
firewall-cmd --reload