Lab 04 ‐ DHCP - aaralik1/SYS-255 GitHub Wiki
In this lab, I came across many problems and I had to troubleshoot frequently. Due to Rocky Linux version 8.6 having new commands, I had a few instances where I deeply needed to search the web for the commands of it. First of all, I had the wrong Server Manager settings on for the Internet explorer Enhanced Security Configuration, so I couldn't download PuTTY for the longest time. However, I learned later that I needed to have the Administrators option turned off and the Users option turned on and then I was successfully able to download PuTTY. Next, I couldn't get "sudo yum install dhcp
" command to work on Rocky so I had to troubleshoot by searching up various commands and in the end, I ended up finding and using the command, "sudo dnf install dhcp-server
."
Moving on, I had to configure the DHCP server that I was setting up, so I used VIM in order to apply this. So I used the command, vi /etc/dhcp/dhcpd.conf
. One thing I would like to note is that in VIM, the command to edit will be i
which stands for insert. To save your work in VIM, you need to use the :w
and that stands for write. After that, to quit VIM, you should type :q
which stands for quit. One thing to note is that, if you ever start your code with a bracket, make sure to close it before saving it. Or the code itself won't be able to take action.
Next, the command sudo cat /var/log/messages | grep wks01-yourname
unfortunately wasn't being used in the new versions of Linux which means I had to troubleshoot and find another way to view the log messages. I ended up downloading rsyslog on my workstation. So, I did sudo dnf install rsyslog
. And then I did, sudo systemctl start rsyslog
followed by sudo systemctl enable rsyslog
. It is important to enable the things you download on Rocky, especiall after a reboot because the systems might be disabled. After that, I checked to see the status of it by typing the following command sudo systemctl status rsyslog
. When I saw that it was up and running, I did sudo journalctl rsyslog
to access the logs.
Furthermore, I needed to release my DHCP server so I did ipconfig /release
followed by ipconfig /renew
and the ipconfig /all
to make sure it worked. Then, we were given a task to change the default lease obtained and lease expires times. In order to do that, I had to ssh back into my dhcp server and then get root access by typing sudo -i
. After that, I did vi /etc/dhcp/dhcpd.conf
again and edited it from the top line by adding default-lease-time 3600;
and then in the next line max-lease-time 14400;
. One important thing to note is that the lease time has to be done in minutes.
Lastly, I did further dhcp research on DORA, how DHCP uses UDP protocol, and how DHCP is an extension of BOOTP.
First of all, DORA is an acronym for DHCP Discovery, Offer, Request, Ack. DHCP Discover This happens when there is a broadcast message to discover the available DHCP servers on the network. DHCP Offer This is when the DHCP server replies back to the client's discovery message. DHCP Request This is when the client accepts an offer received from the DHCP server. DHCP Acknowledgement The DHCP server acknowledges and confirms the client's request.
Next, DHCP uses UDP protocol. For example the DHCP server uses port 67 to listen for client requests and port 68 is used by the DHCP server to receive messages from the server. With UDP is much easier to send rapid message exchanges and it is more efficient so it allows the dynamic network environment to function smoother.
Lastly, BOOTP is another protocol that is used to assign IP addresses automatically. However, it mainly supports static IP addresses and it has been replaced with DHCP due to the fact that DHCP allows dynamic IP addressing and provides a better flow in network configuration when compared to BOOTP.