Changes

Jump to: navigation, search

OPS235 Lab 8 - CentOS7 - VMware

1 byte added, 14:48, 25 May 2016
no edit summary
|{{Admon/note|VM Backups and Yum Updates|Before proceeding with this lab make certain that you have backed-up from lab7, and then perform a '''yum update''' on all machines (including your VMs)|}}
|}
# Perform this section in your '''centos3centos4''' VM.<br><br>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 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.<br><br>
# To check that you have <b>dhclient</b> installed, enter the command:
#:: <b><code><span style="color:#3366CC;font-size:1.2em;">rpm -q dhclient</span></code></b>
[[Image:dhcp-config.png|thumb|right|500px|The '''dhcpd.config''' file allows the Linux system administrator to customize the DCHP server. Generally in this file are '''global settings''' (options that apply throughout entire network) and '''subnet declarations''' (options that apply only to that subnet). Whenever changes are made to this file, the '''DCHP service needs to be restarted''' to allow new settings to take effect.<br><br>'''NOTE: Any errors in this file (such as typos or missing semi-colons) can cause the DHCP server not to restart!''' ]]
# Remain in your '''centos3centos4''' VM for this section.
# Click on the following link to access the online manual page for the following DHCP items to gain an understanding: <ul><li>[http://linux.die.net/man/8/dhcpd dhcpd]</li><li>[https://www.freebsd.org/cgi/man.cgi?query=dhcpd.conf&sektion=5&apropos=0&manpath=FreeBSD+9.0-RELEASE+and+Ports dhcpd.conf]</li><li>[http://linux.die.net/man/5/dhcp-options dhcpd-options]</li><li>[http://linux.die.net/man/5/dhcpd.leases dhcpd.leases]<br><br></li></ul>
# Study the sample '''dhcpd.conf''' file to see examples of how these options are used.
# Remain in your '''centos3centos4''' VM for this section.
# Edit '''/etc/dhcp/dhcpd.conf''' for a second time.
# View this file for existing subnet declarations. Note the syntax and the directive for '''range''' and the option for '''routers''' (gateway).
# Now, add a new subnet delcaration for your virtual network:<br><br>The network address is: '''192.168.235.0/255.255.255.0'''<br>range of host addresses should be from: '''51 to 60'''<br>default gateway (routers) for the virtual network is: '''192.168.235.1'''<br><br>
# Save your editing session, and exit the text editor.
<ol><li value="6">Open another terminal window (ssh into centos3 centos4 from the centos host as user root) and issue the following command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">tail -f /var/log/messages</span></code></b><br><br>(This will show you the last lines of '''/var/log/messages''' continue to display new lines as they are added to the log.)<br><br></li>
<li>In your original terminal prompt attempt to start the '''dhcpd''' service.</li>
<li>You should see new lines being added to the messages file.</li>
|}
# Use your '''centos2centos3''' and '''centos3centos4''' VMs for this section.# On your '''centos3centos4''' terminal window (via ssh from your c7host centos1 machine) make sure that the command<br><b>tail -f /var/log/messages</b> is running.# On your '''centos2centos3''' VM, change the configuration of '''eth0''' (or your interface name) to receive dynamic address configuration (i.e. via graphical application, for IVP4 tab, change ''Address'' from '''Manual''' to '''DHCP''', and '''Apply''' settings)<br>([http://zenit.senecac.on.ca/wiki/index.php/OPS235_Lab_6_-_CentOS7#Part_2:_Configuring_VM_Network_Setup_Graphically_.28system-config-network.29 Refer to Lab6, Investigation1, Part2]).<br><br>Note: if you are configuring via command line, make certain to restart the network for centos2centos3.# Logout and restart your '''centos2centos3''' VM.# Observe the messages that get logged from the tail -f command as your centos2 centos3 VM starts. You should see output similar to the following:<br><br>::<span style="font-family:courier;">Mar 24 13:28:24 centos3 centos4 dhcpd: DHCPDISCOVER from 52:54:00:61:00:e7 via eth2</span>::<span style="font-family:courier;">Mar 24 13:28:25 centos3 centos4 dhcpd: DHCPOFFER on 192.168.235.51 to 52:54:00:61:00:e7 via eth2</span>::<span style="font-family:courier;">Mar 24 13:28:25 centos3 centos4 dhcpd: DHCPREQUEST for 192.168.235.51 (192.168.235.13) from 52:54:00:61:00:e7 via eth2</span>::<span style="font-family:courier;">Mar 24 13:28:25 centos3 centos4 dhcpd: DHCPACK on 192.168.235.51 to 52:54:00:61:00:e7 via eth2<br><br></span>
<ol>
<li value="6">On '''centos2centos3''', confirm the IP address assignment using <b><code><span style="color:#3366CC;font-size:1.2em;">ifconfig</span></code></b></li>
<li>Has the IP Address changed? If so, how has the IP Address been assigned according to the '''dhcpd.conf''' file settings?</li>
</ol>
|}
# Remain in your '''centos2centos3''' and '''centos3centos4''' VMs for this section.# If your '''centos3centos4''' DHCP server successfully issued the proper IP address configuration values to '''centos2centos3''', check the file called:<br>'''/var/lib/dhcpd/dhcpd.leases''' in your <u>'''centos3centos4''' VM</u>. You should the similar contents:<br><br>
::<span style="font-family:courier;"> lease 192.168.235.51 {</span>
::<span style="font-family:courier;"> starts 5 2015/07/10 17:57:34;</span>
::<span style="font-family:courier;"> rewind binding state free;</span>
::<span style="font-family:courier;"> hardware ethernet 52:54:00:0e:7d:a4;</span>
::<span style="font-family:courier;"> client-hostname "centos2centos3";</span>
::<span style="font-family:courier;"> }</span>
<ol><li value="3">On the client '''centos2centos3''' check the contents of the <b>/var/lib/dhclient</b> directory. The files in this directory is where the dhclient stores its record of leases.<br><br> '''NOTE:''' If there are no files, then in a shell as root in your centos2 centos3 VM issue the command: <b><code><span style="color:#3366CC;font-size:1.2em;">dhclient eth0</span></code></b><br>Then check to see if there is file containing lease information in that directory.<br><br></li>
</ol>
|}
# Remain in your '''centos2centos3''' and '''cento3''' VMs for this section.# Make certain that you are located in your '''centos3centos4''' virtual machine.# Create a host declaration for '''centos2centos3'''. Make sure you record the correct <code>hardware ethernet</code> setting that corresponds to the MAC address of the interface in '''centos2centos3'''.
# Give it the fixed-address '''192.168.235.42'''<br><br>'''Note:''' 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.<br><br>
<ol><li value="5">Start your service and test the address assignment by releasing your current address on '''centos2centos3''' and then requesting a new address. Use the following commands on '''centos2centos3''':</li>
</ol>
::: <b><code><span style="color:#3366CC;font-size:1.2em;">ifdown eth1</span></code></b>
'''Arrange proof of the following on the screen:'''
<ol><li><span style="color:green;font-size:1.5em;">&#x2713;</span> '''centos2centos3''' VM:<blockquote><ul><li>'''ifconfig eth0''' shows IP address '''192.168.235.42'''</li><li>DHCP client lease file</li></ul></blockquote><li><span style="color:green;font-size:1.5em;">&#x2713;</span> '''centos3centos4''' VM:<blockquote><ul><li>DHCP server log file showing a lease occuring</li><li>DHCP server configuration file showing subnet and host declaration</li><li>DHCP server lease file</li></ul></blockquote></li><li><span style="color:green;font-size:1.5em;">&#x2713;</span> '''Lab8''' log-book filled out.</li></ol>
= Practice For Quizzes, Tests, Midterm &amp; Final Exam =
13,420
edits

Navigation menu