Changes

Jump to: navigation, search

OPS235 Lab 8 - CentOS6

153 bytes removed, 12:18, 27 November 2019
no edit summary
{{Admon/caution|Draft LabTHIS IS AN OLD VERSION OF THE LAB|'''This lab has NOT been released for regular distributionis an archived version. When the lab is ready to be released, Do not use this caution banner will disappearin your OPS235 course.'''}}
= Setting Up, Using & Maintaining a DHCP Server =
{{Admon/important | Backup your VMs before proceeding | If you did not do it at the end of Lab 7, stop all of your VMs and backup your VM disk images.}}
{{Admon/note |ISC DHCP packages Overview | The version of DHCP server that comes with CentOS is maintained and distributed by the Internet Software Consortium (http://www.isc.org). The source package that you can download from ISC includes not only the DHCP server, but also a DHCP client and a DHCP relay agent. CentOS, Fedora separates it into two RPM packages: the DHCP client package and the DHCP server package. The DHCP client package is installed by default by the workstation installation.}}
=== Investigation 1: How do you install the DHCP Server? ===
=== Investigation 2: What configuration options and directives need to be set in dhcpd.conf?===
{{Admon/note | Use your fedora3 centos3 VM | Complete the following steps on your fedora3 centos3 VM.}}
'''Answer the Investigation 2 observations / questions in your lab log book.'''
 
=== Investigation 3: How do I configure dhcpd settings to be applied to all subnets?===
{{Admon/note | Use your fedora3 centos3 VM | Complete the following steps on your fedora3 centos3 VM.}}
# Edit <code>/etc/dhcp/dhcpd.conf</code> and examine the top section of the file.
'''Answer the Investigation 3 observations / questions in your lab log book.'''
 
=== Investigation 4: How do I configure dhcpd to provide IP configuration to my virtual network?===
{{Admon/note | Use your fedora3 centos3 VM | Complete the following steps on your fedora3 centos3 VM.}}
# Edit <code>/etc/dhcp/dhcpd.conf</code> for a second time, and add a new subnet delcaration for your virtual network
# Also add a default gateway for the virtual network of '''192.168.235.1'''
# Save your editing session, and exit the text editor.
{{Admon/note | Recall Secure SSH Connection Method from Lab7 | Do not forget that you [http://zenit.senecac.on.ca/wiki/index.php/OPS235_Lab_7#Investigation_7:_How_do_you_make_sshd_more_secure. made ssh more secure] in the previous lab. Therefore, you will need to use the same command in lab7 to securely connect to your VM.}}
<ol><li value="5">Open another terminal window (ssh into fedora3 centos3 from fedora the centos host as user root) and issue the following command:
::: <code>tail -f /var/log/messages</code>
<li>This will show you the last 10 lines of <code>/var/log/messages</code> continue to display new lines as they are added to the log.</li>
'''Answer the Investigation 4 observations / questions in your lab log book.'''
 
=== Investigation 5: How do I test my dhcpd service on my virtual network?===
{{Admon/note | Use your fedora2 centos2 and fedora3 centos3 VMs | Complete the following steps on your fedora2 centos2 and fedora3 VM'scentos3 VMs.}}
# On a fedora3 centos3 terminal window make sure that the command <code>tail -f /var/log/messages</code> is running.# On your fedora2 centos2 VM, change the configuration of '''eth1eth0''' (or your interface name) to receive dynamic address configuration.
# Save your changes and restart the <code>NetworkManager</code> service.
# Observe the messages that get logged. You should see output similar to the following:
<pre >
Mar 24 13:28:24 fedora3 centos3 dhcpd: DHCPDISCOVER from 52:54:00:61:00:e7 via eth2Mar 24 13:28:25 fedora3 centos3 dhcpd: DHCPOFFER on 192.168.235.51 to 52:54:00:61:00:e7 via eth2Mar 24 13:28:25 fedora3 centos3 dhcpd: DHCPREQUEST for 192.168.235.51 (192.168.235.13) from 52:54:00:61:00:e7 via eth2Mar 24 13:28:25 fedora3 centos3 dhcpd: DHCPACK on 192.168.235.51 to 52:54:00:61:00:e7 via eth2
</pre>
{{Admon/note | Identifying DHCP Lease Transaction Information | These messages record the DHCP lease transaction that consists of 4 broadcast packets, DISCOVER, OFFER, REQUEST and ACKNOWLEDGE. Try researching on the internet how this transaction differs from a DHCP lease renewal.}}
<ol><li value="5">On fedora2centos2, confirm the IP address assignment using <code>ifconfig</code></li>
</ol>
'''Answer the Investigation 5 observations / questions in your lab log book.'''
 
 
== Obtaining Lease Information &amp; Lease Permanent IP Address ==
=== Investigation 6: Where does the dhcp server store a record of leased addresses?===
{{Admon/note | Use your fedora2 centos2 and fedora3 centos3 VMs | Complete the following steps on your fedora2 centos2 and fedora3 VM'scentos3 VMs.}}
# If your fedora3 centos3 DHCP server successfully issued the proper IP address configuration values to fedora2centos2, check the file called <code>/var/lib/dhcpd/dhcpd.leases</code>
# You should see contents similar to:
<pre>
</pre>
{{Admon/note | Purpose of <code>dhcpd.leases</code> File | dhcpd records address leases in this file. If the service is restarted it reads in the file to know which addresses are currently leased and for how long.}}
<ol><li value="3">On the client fedora2 centos2 check the contents of the <code>/var/lib/dhclient</code> directory. The files in this directory is where the dhclient stores its record of leases.</li>
</ol>
=== Investigation 7: How can I lease the same address every time? ===
{{Admon/note | Use your fedora2 centos2 and fedora3 centos3 VMs | Complete the following steps on your fedora2 centos2 and fedora3 VM'scentos3 VMs.}}
{{Admon/note | Reserving IP Addresses with DHCP | Even though DHCP gives out IP address dynamically, it also has the ability to reserve an IP address for a certain computer. In this sense it's almost as if the client computer has a static IP even though it uses DHCP to get it. This is useful if you want to be able to put entries in your /etc/hosts file and not have to worry about the entry becoming invalid over time. In Linux we refer to this as supplying a fixed address to a host. Microsoft calls it a reservation.}}
# Make certain that you are located in your fedora3 centos3 virtual machine.# Create a host declaration for fedora2centos2. Make sure you record the correct <code>hardware ethernet</code> setting that corresponds to the MAC address of the interface in fedora2centos2.
# Give it the fixed-address 192.168.235.12
{{Admon/tip | Avoiding IP Address Conflicts | When supplying fixed-address it is important that the address assigned is exclusive of any ranges that have been declared. Otherwise it may be possible for 2 different hosts to receive the same address.}}
<ol><li value="3">Start your service and test the address assignment by releasing your current address on fedora2 centos2 and then requesting a new address. Use the following commands on fedora2centos2:</li>
</ol>
::: <code>ifdown eth1</code>

Navigation menu