Professional Documents
Culture Documents
REPORT
ON
DHCP
SERVER
AND
MAIL
SERVER
1
ACKNOWLEDGEMENT
for his
INDEX
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
Overview of dhcp...........................................................................................................5
Central dhcp server design............................................................................................5
Definition of dhcp server on the web..............................................................................6
What is dhcp .................................................................................................................6
How does dhcp works(dora process).............................................................................8
Ip address allocation......................................................................................................10
Basic configuration.........................................................................................................10
Setting fixed address.....................................................................................................13
Setting daemon option...................................................................................................13
Starting dhcp .................................................................................................................13
Testing the server...........................................................................................................14
Why dhcp reservation.....................................................................................................17
Mac binding....................................................................................................................17
Overview and history of mail server................................................................................20
Default sendmail installation............................................................................................21
Common sendmail configuration.....................................................................................23
Mail user agent.................................................................................................................25
Mail transport agent..........................................................................................................25
Mail delivery agent............................................................................................................27
DHCP
SERVER
Overview
Every device that successfully communicates on the global Internet must be configured with a set of
properly assigned networking parameters. These parameters have historically been manually set
either by the individual using the device or by technical support staff who travel from one device
location to the next. An increasingly popular and efficient means of configuring devices that UGA
campus units (e.g., departments) have deployed is through the Dynamic Host Configuration Protocol
(DHCP). DHCP relies on a database of networking parameters that are delivered to a device, with
unique information (such as IP address) supplied as a function of its network interface card (nic)
address. Although DHCP services managed at the unit level have served the University well up to this
point, there are compelling reasons why a central DHCP service is critical to the successful
deployment of campus networking today.
DHCP Task Force (DHCPTF) was created in March 2000 and charged with the following tasks:
Evaluate the major DHCP offerings (both commercial and open source) with respect to the
developed specifications
Identify (but not resolve) DHCP management issues such as vendor support, staffing
requirements for managing central servers, and training for technical support staff.
The DHCPTF provided recommendations to the Campus IT Forum, and ultimately the IT Policy Board
and Provost for endorsement as institutional policy by the end of the 2000
Central DHCP Server Design
The central DHCP service consists of three main components: (1) a user-friendly Web front-end to
give appropriately authorized personnel (authenticating through their UGA MyID) the ability to update
DHCP networking parameters, (2) a MySQL database back-end containing authoritative DHCP
information, and (3) two redundant Internet Software Consortium (ISC) Version 3 DHCP servers
whose configuration files are created from the MySQL database.
The MySQL database contains tables of information documenting all of the units on campus, the
individuals responsible for updating DHCP information for their units, and networked device
information. At present, the device information includes the following fields:
Departmental Affiliation
Building Location
Room Location
DHCP Exclusion Flag (to exclude devices, e.g., servers, from DHCP assignment)
The Dynamic Host Configuration Protocol (DHCP) is a computer networking protocol used by
hosts (DHCP clients) to retrieve IP address assignments and other configuration information.
A service provided by a device on the network that assigns network addresses to other
devices, such as your telephone and computer. This avoids having to go to each and every
device to manually assign an addresses to it
What is DHCP?
Dynamic Host Configuration Protocol (DHCP) is a network protocol that enables a server to
automatically assign an IP address to a computer from a defined range of numbers (i.e., a scope)
configured for a given network.
connection at a particular location. It's especially useful in education and other environments where
users change frequently. Using very short leases, DHCP can dynamically reconfigure networks in
which there are more computers than there are available IP addresses. The protocol also supports
static addresses for computers that need a permanent IP address, such as Web servers.
DHCP is an extension of an earlier network IP management protocol, Bootstrap Protocol (BOOTP).
DHCP is a more advanced protocol, but both configuration management protocols are commonly
used and DHCP can handle BOOTP client requests. Some organizations use both protocols, but
understanding how and when to use them in the same organization is important. Some operating
systems, including Windows NT/2000, come with DHCP servers. A DHCP or BOOTP client is a
program that is located in (and perhaps downloaded to) each computer so that it can be configured
The Dynamic Host Configuration Protocol (DHCP) is an excellent technique for managing changes in
the network configuration parameters (such as IP address, network mask, default gateway, etc.) of
Internet connected devices. DHCP uses a server containing a database of parameters that key off the
network interface card (NIC) address of the connected device. A DHCP client program running on the
device requests these parameters which are delivered by the DHCP server based on the requesting
device's NIC address
When a computer is connected to a DHCP-enabled network, it will send out a broadcast. This
broadcast, known as DHCPDISCOVER, will be sent out in hopes of finding the DHCP server.
Optionally, the client will request that the last known IP information the client used on the network be
used. (Based on the settings of the DHCP server, this request may be fulfilled or denied.)
DHCP Offers
The DHCP will then receive a lease request from the client. This lease determines how long the client
can expect to use the IP information it will obtain from the server. A DHCP message referred to as
DHCPOFFER is sent back from the server to the client. This message contains the lease duration, IP
address, subnet mask, the clients MAC address, and the IP address of the DHCP server that issued
the message.
DCHP Requests
Upon a successful transaction of information, the client must then tell the DHCP server that the
information was indeed received and accepted. A broadcast is initiated with the DHCP servers IP
address. This will tell other possible DHCP servers that they shouldnt issue IP information to the
client, since the client already obtained the necessary information. This will help free up IP addresses
for other computers, as only one lease can be obtained per network interface card.
DHCP Acknowledgement
DHCP acknowledgement is the final phase in the information exchange between server and client. In
this phase the server obtains the DHCPREQUEST message from the client, and sends back a
DHCPACK message. This packet of information includes the lease duration, as well as any
configuration information the client may have requested. At this point the process is complete, and the
client will configure its IP information accordingly.
IP Address Allocation
The DHCP protocol provides three methods of IP address allocation:
manual allocation, where the allocation is based on a table with MAC address - IP address pairs manually filled by the server
admin. Only requesting clients with a MAC address listed in this table get the IP address according to the table.
automatic allocation, where a free IP address of a range given by the admin is permanently assigned to a requesting client.
dynamic allocation, the only method which provides dynamic reuse of IP addresses. A network administrator assigns a range of
IP addresses to DHCP, and each client computer on the LAN has its TCP/IP software configured to request an IP address from
the DHCP server when that client computer's network interface card starts up. The request-and-grant process uses a lease
concept with a controllable time period. This eases the network installation procedure on the client computer side considerably.
Some DHCP server implementations can update the DNS name associated with the client hosts to reflect the new IP
address by way of the DNS update protocol which was established with RFC 2136
Dynamic Host Configuration Protocol (DHCP) is defined in RFC2131 and is basically an automated
means of managing and assigning Internet IP addresses to client workstations on the network. This
protocol saves the system administrator much time having to manually configure each host
workstation manually, and to maintain large databases storing IP assignment details. When any of the
network settings change (like allocating a new default gateway or new DNS server), then the details
10
can be configured at the DHCP server as opposed to manually changing the settings of many client
systems.
This chapter will provide the means to configure the DHCPd package to provide IP assignment to
your internal network. The DHCP server is installed on most Linux distributions, and is also available
from the Internet Systems Consortium site.
Basic Configuration
The main DHCP configuration file should be located at /etc/dhcpd.conf, however it is sometimes
missing. This is a configuration safeguard to stop users from accidentally starting a DHCP server
without fully configuring its details. Having any unplanned DHCP servers operating on a network can
result in major network problems. Therefore the administrator must create the configuration before
implementing its services, a physical task to reduce error (some distributions may have the file
available).
[bash]# vi /etc/dhcpd.conf
The following configuration file is an example for a typical home / small office network.
#
# DHCP Server Config File
#
ddns-update-style none;
ignore client-updates;
lease-file-name "/var/lib/dhcpd/dhcpd.leases";
authoritative;
option domain-name
"example.com";
default-lease-time
86400; # 24 hours
max-lease-time
172800; # 48 hours
192.168.1.1;
option subnet-mask
255.255.255.0;
option broadcast-address
192.168.1.255;
option domain-name-servers
option ntp-servers
192.168.1.1;
192.168.1.1;
11
option netbios-name-servers
option netbios-node-type
192.168.1.1;
8;
A DHCP server can be configured with more than one range (subnet) of IP addresses. The
parameters specified above the "subnet" declaration are global parameters which are applied to all
subnet declarations, while the parameters inside each subnet override the global parameters.
The parameters specified in the above sample file are explained below. For more detailed information
about the configuration options available, type "man dhcpd.conf" or "man dhcp-options" at the
command prompt.
Parameter
Definition
ddns-update-style
ignore client-updates
lease-file-name
authoritative
option domain-name
option domain-nameservers
default-lease-time
max-lease-time
option routers
option subnet-mask
option broadcastaddress
option ntp-servers
option netbios-nameserver
12
option netbios-nodetype
Range
The DHCP server can be quite tricky to configure and normally does not provide any error messages
when it fails to start as a service. Ensure your configuration file is formatted similar to the example
above, and that semicolons complete all the parameter lines.
If the network on which the DHCP server is broadcasting does not have a WINS server, then the
netbios-name-server and netbios-node-type options should be removed.
Setting Fixed Addresses
There may be a time when it is necessary for a workstation to be assigned a fixed address, this can
host wkstn1 {
hardware ethernet 00:0d:62:d7:a0:12;
fixed-address 192.168.1.5;
}
be easily achieved by setting the following details in the bottom of the /etc/dhcpd.conf file.
Setting fixed addresses saves the operator time by avoiding the manual adjustments needed at each
workstation. Be sure to remove the fixed address when it is no longer required, this is particularly
important on larger networks where IP allocation needs careful management.
Setting Daemon Options
The DHCP daemon can be configured with command line options by using the /etc/sysconfig/dhcpd
file. For security, DHCP can be bound to an interface so the allocation of addresses are only available
to the private internal network.
[bash]# vi /etc/sysconfig/dhcpd
Setting this option provides queries and assignment only through this interface.
# Command line options here
DHCPDARGS=eth1
13
Starting DHCP
There was no initial DHCP configuration file when we started to set up the server. Now that the file
has been created and the configurations are defined, it would be a good time to make a backup of the
file.
[bash]# cp /etc/dhcpd.conf /etc/dhcpd.conf.original
When the server provides a leased IP address to a client, the details of the transaction are stored in
the dhcpd.leases file. In some distributions this file has not been provided and may need to be created
before the server will function. The following command prepares the dhcpd.leases file for use.
[bash]# touch /var/lib/dhcpd/dhcpd.leases
The server is now fully configured and its time to determine the runlevels and start the service.
[bash]# chkconfig --level 2345 dhcpd on
[bash]# /etc/init.d/dhcpd restart
You should always check the runlevels after they have been adjusted to confirm they will function as
required.
[bash]# chkconfig --list dhcpd
Once the service has been started the system log should be checked to see if there are any errors.
Most important is the security options we viewed earlier, which was to make sure the daemon was
bound to the internal interface. The following example shows a binding to eth0.
[bash]# grep dhcpd /var/log/messages
14
By viewing the system log after renewing a DHCP client's lease, the transaction between client and
server can be viewed. The following transaction records the fixed address 192.168.1.5 that was
covered earlier being assigned to the reserved MAC address.
[bash]# grep dhcpd /var/log/messages
15
If your Linux client is using the pump dhcpclient, then the following commands can be used to release,
obtain, or view the status of the client.
[bash]# pump -i eth0
[bash]# pump -i eth0 --release
[bash]# pump -i eth0 --status
Windows Client
Testing a Windows based DHCP client is best done from a command prompt in the DOS shell, as
more information is returned to the user than the standard graphical tools.
To release and renew your windows based IP address, follow these examples (expected results are
provided).
C:\>ipconfig /release
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 0.0.0.0
Subnet Mask . . . . . . . . . . . : 0.0.0.0
Default Gateway . . . . . . . . . :
C:\>ipconfig /renew
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : example.com
IP Address. . . . . . . . . . . . : 192.168.1.5
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
16
The following command will provide more detailed information about the leased IP address and
associated network resources.
C:\>ipconfig /all
WHY DHCP RESERVATION?
1. Assigning IP address dynamically has some problem that every time a client system boots, it
is not sure that it will get the same IP so it will be uneasy task for other system to find the
particular system.
2. To solve the above problem we can do mac-address binding of IPs . Just give its entry in the
fixed adderess position.
What is the IPv4 MAC address (aka the hardware or physical address) of my network adapter?
Every network adapter has a Media Access Control address (usually shortened to MAC address). A
MAC address is a six-byte identifying number permanently embedded in the firmware of the adapter,
and is readable by the network and the operating system of the device on which the adapter is
installed. All modems and Ethernet cards have a MAC address. The address must follow the
standards set by the Institute of Electrical and Electronics Engineers (IEEE), which sets computer
networking standards. The IPv4 address is a six-pair set of hexadecimal numbers, for example, a1c2-e3-44-5f-6d.
The purpose of the MAC address is to uniquely identify every node on a network; nodes include
workstations and devices like printers. Every adapter has a unique MAC address. Even two identical
models from the same manufacturer will have distinct MAC addresses.
host wkstn1 {
hardware ethernet 00:0d:62:d7:a0:12;
fixed-address 192.168.1.5;
}
By default, Windows randomly assigns an IP address. Typically in Linux and Mac OS X, the IPv6
protocol uses the MAC address of a network node to generate its IPv6 IP address. This is
accomplished by expanding the 48-bit MAC address into a 64-bit portion of an 128-bit IPv6 IP
17
address. This represents a change from the practice of IPv4, where the MAC address was entirely
distinct from the IP address.
18
MAIL
SERVER
19
The birth of electronic mail (email) occurred in the early 1960s. The mailbox was a file
in a user's home directory that was readable only by that user. Primitive mail applications appended
new text messages to the bottom of the
file, making the user wade through the constantly growing file to find any particular
message. This system was only capable of sending messages to users on the same system.
The first network transfer of an electronic mail message file took place in 1971 when
a computer engineer named Ray Tomlinson sent a test message between two machines via
ARPANET the precursor to the Internet. Communication via email soon became very popular,
comprising 75 percent of ARPANET's traffic in less than two years.
Today, email systems based on standardized network protocols have evolved into
some of the most widely used services on the Internet. Red Hat Enterprise Linux offers many
advanced applications to serve and access email.
20
21
Use the included makefile in /etc/mail (make all -C /etc/mail) to create a new
/etc/mail/sendmail.cf configuration file. All other generated files in /etc/mail (db files) will be
regenerated if needed. The old makemap commands are still usable. The make command will
automatically be used by service sendmail start | restart | reload if the make package is
installed.
Alternatively you may use the included m4 macro processor to create a new
/etc/mail/sendmail.cf.
Various Sendmail configuration files are installed in the /etc/mail/ directory including:
access Specifies which systems can use Sendmail for outbound email.
22
Several of the configuration files in /etc/mail/, such as access, domaintable, mailertable and
virtusertable, must actually store their information in database files before Sendmail can use any
configuration changes. To include any changes made to these configurations in their database files,
run the command
where <name> is replaced with the name of the configuration file to convert.
For example, to have all emails addressed to the example.com domain delivered to <bob@otherexample.com>, add the following line to the virtusertable file:
@example.com
bob@other-example.com
23
Caution
Before changing the sendmail.cf file, it is a good idea to create a backup copy.
24
/etc/mail/sendmail.mc file, and either change the address specified in the Addr= option of the
DAEMON_OPTIONS directive from 127.0.0.1 to the IP address of an active network device or
comment out the DAEMON_OPTIONS directive all together by placing dnl at the beginning of the line.
When finished, regenerate /etc/mail/sendmail.cf by executing the following command:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
The default configuration which ships with Red Hat Enterprise Linux works for most SMTPonly sites. However, it does not work for UUCP (UNIX to UNIX Copy) sites. If using UUCP mail
transfers, the /etc/mail/sendmail.mc file must be reconfigured and a new /etc/mail/sendmail.cf must be
generated.
25
Consult the /usr/share/sendmail-cf/README file before editing any files in the directories under the
/usr/share/sendmail-cf directory, as they can affect the future configuration of /etc/mail/sendmail.cf
files.
Mail User Agents
There are scores of mail programs available under Red Hat Enterprise Linux.
There are full-featured, graphical email client programs, such as Ximian Evolution, as well as textbased email programs such as mutt.
The remainder of this section focuses on securing communication between the client
and server.
26
Red Hat Enterprise Linux includes two primary MTAs, Sendmail and Postfix.
Sendmail is configured as the default MTA, although it is easy to switch the default MTA to Postfix
A Mail Transport Agent (MTA) is essential for sending email. A Mail User
Agent (MUA) such as Evolution, Thunderbird, and Mutt, is used to read and compose email. When a
user sends an email from an MUA, the message is handed off to the MTA, which sends the message
through a series of MTAs until it reaches its destination.
Even if a user does not plan to send email from the system, some automated
tasks or system programs might use the /bin/mail command to send email containing log messages to
the root user of the local system.
Red Hat Enterprise Linux 5 provides three MTAs: Sendmail, Postfix, and
Exim. If all three are installed, sendmail is the default MTA. The Mail Transport Agent Switcher allows
for the selection of either sendmail, postfix, or exim as the default MTA for the system.
The system-switch-mail RPM package must be installed to use the textbased version of the Mail Transport Agent Switcher program. If you want to use the graphical version,
the system-switch-mail-gnome package must also be installed.
To start the Mail Transport Agent Switcher, select System (the main menu on the
panel) => Administration =>
Mail Transport Agent Switcher, or type the command system-switch-mail at a
shell prompt (for example, in an XTerm or
GNOME terminal).
27
Red Hat Enterprise Linux includes two primary MDAs, Procmail and mail.
Both of the applications are considered LDAs and both move email from the MTA's spool file into the
user's mailbox. However, Procmail provides a robust filtering system.
28
This section details only Procmail. For information on the mail command, consult its man page.
Procmail delivers and filters email as it is placed in the mail spool file of the localhost. It is powerful,
gentle on system resources, and widely used. Procmail can play a critical role in delivering email to be
read by email client applications.
Procmail can be invoked in several different ways. Whenever an MTA places an email into the mail
spool file, Procmail is launched. Procmail then filters and files the email for the MUA and quits.
Alternatively, the MUA can be configured to execute Procmail any time a message is received so that
messages are moved into their correct mailboxes. By default, the presence of /etc/procmailrc or of
a .procmailrc file (also called an rc file) in the user's home directory invokes Procmail whenever an
MTA receives a new message.
Whether Procmail acts upon an email message depends upon whether the
message matches a specified set of conditions or recipes in the rc file. If a message matches a
recipe, then the email is placed in a specified file, is deleted, or is otherwise processed.
When Procmail starts, it reads the email message and separates the body from the header
information. Next, Procmail looks for /etc/procmailrc and rc files in the /etc/procmailrcs directory for
default, system-wide, Procmail environmental variables and recipes. Procmail then searches for a
.procmailrc file in the user's home directory. Many users also create additional rc files for Procmail that
are referred to within the .procmailrc file in their home directory.
By default, no system-wide rc files exist in the /etc/ directory and no .procmailrc files exist in any
user's home directory. Therefore, to use Procmail, each user must construct a .procmailrc file with
specific environment variables and rules
29
BIBLIOGRAPHY
Arpanet-20
bootp-7
broadcast address-11
daemon-13
ddns-update-style-12
dhcp exclusion flag-6
dhcpack-7
dhcp-acknowledgement-7
dhcp-discovery-7
dhcp-offer-7
dhcp-request-7
dhcptf-5
discover packet-6
domain name server-11
hardware Ethernet-13
ietf-7
ignore client update-12
ip address-5
it policy board-5
lease-file-name-12
M4 package-24
mac-address-17
mailbox-20
man dhcp conf-11
max lease time-12
30
31
REFERENCES
1
2
3
4
5
6
7
8
32
33