Changes

Jump to: navigation, search

Lab 8 Warnings / Debrief

4,856 bytes added, 10:56, 8 August 2015
no edit summary
The term '''DORA''' best describes how DHCP Works:
<br><br>
{|cellpadding="2" width="60%" border="1" cellspacing="0"
|- valign="top"
|width="90%" |The client sends a '''message of acceptance to the server'''. In turn, the client receives from the server a '''packet of information''' containing the lease duration and other configuration information
|}
<br><br>
 
 
== Setting-up / Running a DHCP Sever (dhcpd) ==
[[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!''' ]]
<u>'''Obtaining dhcp Package'''</u>
 
 
In order to setup a '''dhcp''' server, you may be required to install the package on your server. The program called dhcpd is a daemon which runs the dchp server in the background waiting to accept requests from potential clients (eg. mobile computers, etc). In our case, we will install and configure ''dhcpd'' on our '''centos3''' VM.
 
<u>Useful commands</u>
 
:*<b><code><span style="color:#3366CC;font-size:1.2em;">rpm -q dhcp</span></code></b> (checks to see if dhcp package is setup on server. If not installed, can issue command: <b><code><span style="color:#3366CC;font-size:1.2em;">yum install dhcp</span></code></b>)
:*<b><code><span style="color:#3366CC;font-size:1.2em;">dhclient</span></code></b> (usefull command to initiate a new dhcp connection to dhcp server)
 
 
Once dhcp package has been installed on your system, you will need to create the '''dhcpd.conf''' file to setup the configuration of your dhcp server.
Sometimes it is easier to copy a <u>sample</u> dhcp.conf file to destination: '''/etc/dhcp/dhcpd.conf''',and then edit the configurations to meet your own specifications.
 
<u>Useful commands</u>
:*<b><code><span style="color:#3366CC;font-size:1.2em;">rpm -qla dhcp</span></code></b> (obtain a listing of files to search for sample dhcpd.conf file to copy to: '''/etc/dhcp/dhcpd.conf''')
 
 
<u>'''Layout of the dhcpd.conf file'''</u>
 
 
The dhcpd.conf file consists of at least a couple of major sections:
:*'''Parameters''' (network options, actions to take, etc)
:*'''Declarations''' (actions and options only applied within a particular <u>subnet</u>)
 
Here is a link to a good explanation of how dhcpd.conf works: [ '''[https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-dhcp-configuring-server.html Configuring a DHCP Server]''' ]
 
 
<u>'''Running the DHCP Server'''</u>
 
 
After configuring the DHCP server, you need to either start the service (first time) or restart the service in order for your configuration changes to take effect.
 
<u>Useful commands</u>
 
:*<b><code><span style="color:#3366CC;font-size:1.2em;">service dhcpd start</span></code></b> (start dhcpd service for the first time)
:*<b><code><span style="color:#3366CC;font-size:1.2em;">service dhcpd restart</span></code></b> (restart dhcpd service for changes to take effect)
:*<b><code><span style="color:#3366CC;font-size:1.2em;">chkconfig dhcpd on</span></code></b> (enable dhcpd service on server boot-up)
:*<b><code><span style="color:#3366CC;font-size:1.2em;">tail -f /var/log/messages</span></code></b> (utility to confirm dhcp connections as they appear in real-time)
 
 
Note: If there are any errors in the dhcpd.conf file, then that service will not start correctly.
 
<u>Common Errors in dhcpd.conf file</u>
 
:*Syntax Errors
:*Failure to end statements with semi-colon character (;)
:*Forgetting to include braces ( { } ) in subnet declarations
 
 
<u>'''Common Files When Auditing DHCP Connections'''</u>
 
There are files that are created as a result of a DHCP connection. These files are useful to verify that a connection via DCHP was created, and provides details regarding this connection (eg. confirming dhcpd.conf modifications).
 
On the DCHP <u>Server</u>:
 
*'''tail -f /var/log/messages''' DHCP server log file showing a lease occurring (eg. '''dora''')
*'''/var/lib/dhcpd/dhcpd.leases''' DHCP server lease file
 
On the <u>Client Server</u> that connected via DCHP:
 
*'''/var/lib/dhclient''' directory where the <u>dhclient</u> stores its record of leases
<u>Common Errors in dhcpd.conf file:</u>
:*Syntax Errors
 
:*Failure to end statements with semi-colon character (;)
 
:*Forgetting to include braces ( { } ) in subnet declarations
== Preparing for Lab Sign-Off ==
== Lab 8 Debrief ==
<u>'''Preparing for Quizzes'''</u>
# What protocol and port does dhcp use?
# What file is used to configure dhcpd?
# Can a dhcp server also be a dhcp client?
# What is the difference between max-lease-time and default-lease-time?
# What unit of measurement does default-lease-time require?
# What dhcp option is used for configuring a default gateway?
# What is the parameter range in the DHCP server configuration file used for?
# What is the purpose of a dhcp relay agent?
# Why might a dhcp relay agent be required?
[[Category:OPS235]]
[[Category:OPS235 Labs]]
13,420
edits

Navigation menu