Lab 4.0: DHCP Server
Summary
The main objective was to create a DHCP server in our CentOS machines. This went relatively straightforward. The only problem I had was I got really confused with the max-lease-time and default-lease-time documentation because I forgot about the man command and I had to look through the online documentation.
Steps
The first item related to DHCP is the
option domain-name example.com
. DHCP needs the domain name so it's easier for the DHCP server to know and allocate to different machines on the network.The second item is how DHCP uses 2 ports because this is to prevent another protocol to clog the port as well so the flow of DHCP is smooth.
The third item is lease times and max lease times. a lease time is needed so a computer that is disconnected from the network doesn't just take up an IP for the rest of the time. the default lease time is just the time the computer can go with the original ping to the system and the max lease time is how long an active computer cna go before being kicked off.
Commands
CentOS
yum
= yum is the default package manager for CentOSsudo yum install dhcp
= this was to install the DHCP server we needed for the lab
sudo -i
= puts the current user into superuser as well this command needs the current users passwordvi
= vim text editorto write in vim press
i
to quit vim hit
esc
then typ:wq
to write and quitvi /etc/dhcp/dhcpd.conf
= goes to dhcpd.conf file using vim
systemctl
= sytem control programsystemctl start dhcpd
= will start the process dhcpdsystemctl status dhcpd
= will show the status of dhcpdsystemctl enable dhcpd
= will make dhcpd start at boot
firewall-cmd --list-all
= shows all the firewall optionsfirewall-cmd --add-service=dhcp --permanent
= will make a permanent change so dhcp is allowed through the firewallfirewall-cmd --reload
= will refresh the firewall
sudo cat /var/log/messages | grep wks01-paul
= will show the dhcpd logs of connections for wks01-paul
Windows
ssh
= by using ssh "hostname" in the POWERSHELL, not PowerShell ISE!! you can ssh into a clientipconfig
= shows basic network adapters and their propertiesipconfig /all
= shows all network adapters and their propertiesipconfig /release
= will release current dhcpipconfig /renew
= new renew dhcp
Last updated