You are on page 1of 42

2013

PROJECT on Linux Network


Administration & Configuration
PROJECT MEMBERS

SL. No. Name Branch & Roll No.

1. Md Inam CSE -10022


2. Pankaj chourshia IT -10171
3. Khileshwar Bhagat IT -10175
4. Rosy Tigga CSE-10037
5. Senha Trikey CSE-10043
Certificate

This is to certify that the project report entitled Network Administration and
Configuration in Linux submitted to University College Of Engineering & Technology
(VBU Hazaribag) in fulfillment of the final year project 2013 , is an original work carried out by
students of the group.

. Under the guidance of Asst. professor Ram Parkash

The matter embodied in this project is a genuine work done by the students and has been
submitted to this engineering college for the fulfillment of the project of course study.

Signature of the guide


Acknowledgement

At such an early stage of our career in COMPUTER SCIENCE Engineering and it‟s
applications we deem ourselves fortunate in having an opportunity to work in such project. A large
number of individuals had contributed directly in this project. We would like to thank the countless
number of people who have helped get this work out of door. While developing this project we had
to consult many people from different grounds of activity, which includes Linux Administrator,
Networking professional and many more.

First and foremost, we thank our project guide Faculty Name Asst. professor Ram
Parkash of UCET (VBU,Hazaribag), whose earnest suggestion, inspiration and involvement
paved the way for the successful completion of the project. We would like to offer our special
gratitude to them for sharing the ups and downs during the development and bearing inconvenience.
We also express our sincere gratitude to all the faculty members UCET VBU,Hazaribag for
their suggestions & enormous encouragement.
CONTENTS

Name Page No

1. Introduction
2. Platform and Tool
Information

3. Server
Configuration

a. Sendmail
Server

b. DNS Server

c. DHCP
server
1. Introduction
A server administrator or admin has the overall control of a server. This can
be in the context of a business organization, where often a server
administrator oversees the performance and condition of multiple servers
in the business, or it can be in the context of a single person running a game
server.
The admin for a server typically represents the owners and financiers of the
server. Alternatively, an owner can grant administrator rights to a regular
player (or clan member) on the server.
Anyone can also work as a Server Admin and be the brain of a company.
The Server Administrator's role is to design, install, administer, and
optimize company servers and related components to achieve high
performance of the various business applications supported by tuning the
servers as necessary. This includes ensuring the availability of client/server
applications, configuring all new implementations, and developing
processes and procedures for ongoing management of the server
environment. Where applicable, the Server Administrator will assist in
overseeing the physical security, integrity, and safety of the data
center/server farm.
The admin has power to configure the system using various tools available
or he/she can write scripts (may be shell script or other script written in any
scripting language). The servers generally used include http server (also
known as web server), DNS server, DHCP server, email server etc.
2. Platform and Tools Used

Host System

OS Name: Microsoft Windows 7 Home Premium


OS Version: 6.1.7600 N/A Build 7600
System Type: x86-based PC
Processor(s): 1 Processor(s) Installed.
[01]: Intel64 Family 6 Model 37 Stepping 2 Genuine Intel
~927 MHz
Total Physical Memory: 3,959 MB
Network Card(s): 4 NIC(s) Installed.
[01]: Realtek PCIe FE Family Controller
[02]: DW1501 Wireless-N WLAN Half-Mini Card
[03]: Broadcom Virtual Wireless Adapter
[04]: Virtual Box Host-Only Ethernet Adapter
Connection Name: Virtual Box Host-Only
Network
DHCP Enabled: No
IP address (es)
[01]: 192.168.56.1
[02]: fe80:: 491:b808:18d2:ab67

Hypervisor (Virtualization Software Used)

Oracle VM Virtual Box 4.1.2


Virtual Box is a cross-platform virtualization application. For one thing, it installs on your existing
Intel or AMD-based computers, whether they are running Windows, Mac, Linux or Solaris operating
systems. Secondly, it extends the capabilities of your existing computer so that it can run multiple
operating systems (inside multiple virtual machines) at the same time.

Guest Systems

 Virtual Machine #1
Name: Centos
OS: Linux
Version: 6.3
Network Adapter: Host Only Networking
Adapter IP address: 192.168.56.2
Send mail SERVER

Overview

Today, Electronic mail is part of the communication backbone, the core of


information dissemination within companies of all sizes. Everyone use e-mail,
from the mail room to the laboratories to the CEO‟s office. And if you„re in
charge of an organization„s mail server you„ll be notified when it stop working.

Introduction to SMTP and Send mail

Even with multimedia technologies and HTML encoding prevalent in e-mail


messages today, the technology behind message transfer hasn‟t changed
significantly since early 1980s. The framework for the Simple Mail Transfer
Protocol (SMTP) was initially described in RFC 821 in 1982. The protocol itself
was extended in 1993 (RFC 1425), yielding Extended Simple Mail transfer
Protocol, which provides more commands and new delivery modes.

The three parts to message transfer agent are Mail Transfer Agent (MTA), the
Mail Delivery Agent (MDA), and the Mail User Agent (MUA). The MTA ,
commonly referred as mail server (of which Send mail and postfix are
examples), actually handles distributing outgoing mail and listening for incoming
mail from the Internet.

Linux e-mail Implementation


Linux implements the e-mail model used by the Send mail or the postfix
Daemon. Send mail daemon is default MTA of RHEL and Fedora. Main
configuration files /etc/mail/Sendmail.cf. It listens on port 25 for SMTP
clients, processes mail queue periodically (/var/spool/mqueue) and delivers mail
for remote delivery using SMTP protocol and for local delivery to system
mailboxes (/var/spool/mail/userid).

Package Used:

Sendmail-8.13.8-8.el5

Server Configuration

The Basic process to edit configuration is shown in the diagram below:

1. Edit configuration file /etc/mail/Sendmail.mc.


2. Comment out line containing.
DAEMON_OPTIONS (`Port=smtp, Addr=127.0.0.1, Name=MTA') dnl
As
Dnl #DAEMON_OPTIONS (`Port=smtp, Addr=127.0.0.1, Name=MTA') dnl
3. Run m4 /etc/sendmail.mc > /etc/mail/sendmail.cf
4. Now, start the service.

# service sendmail restart

5. # useradd tanweer
Then to configure the pop3 (post office protocol ) .
6. # vi /etc/dovecot.conf

Edit in the dovecot file and mention.


# protocol = imap impas pop3 pop3s
Save and exit (: wq)
7. # service dovecot restart

8 .# chkconfig sendmail on

9 .# chkconfig dovecot on
10. # mutt

#mutt
Press m.
Type subject.
Type the message.
Save the message (By pressing [ESC] +:wq).
Press y to send message.
 Now use the chvt command to change the virtual
terminal.
# Chvt 2
.

DNS

Domain Name System

 The Internet maintains two principal namespace (the domain name


hierarchy) and the Internet protocol (IP) address spaces. The Domain Name
System maintains the domain name hierarchy and provides translation
services between it and the address spaces. Internet name servers and a
communication protocol implement the Domain Name System A DNS name
server is a server that stores the DNS records for a domain name, such as
address (A) records, name server (NS) records, and mail exchanger (MX)
records. A DNS name server responds with answers to queries against its
database. It is described in RFC 1034 and 1035,with a number of later RFCs
augmenting this description.The purpose of Domain Name System is to
create a system that allows lookups in a tree-like database.These lookups are
mostly finding an IP address that belongs to a node (a hostname) in the
Domain Name System. A hostname in this respect is always a Fully
Qualified Domain Name (FQDN).

STRUCTURE OF DOMAIN NAME SYSTEM

 The domain name space consists of a tree of domain names. Each


node or leaf in the tree has zero or more resource records, which
hold information associated with the domain name. The tree sub-
divides into zones beginning at the root zone. . A DNS zone may consist of
only one domain, or may consist of many domains and sub-domains, depending on the
administrative authority delegated to the manager.

The hierarchical Domain Name System, organized into zones, each served by a name server

Administrative responsibility over any zone may be divided by creating additional zones.
Authority is said to be delegated for a portion of the old space, usually in the form of sub-
domains, to another name server and administrative entity. The old zone ceases to be
authoritative for the new zone.
The definitive descriptions of the rules for forming domain names appear in RFC 1035, RFC
1123, and RFC 2181. A domain name consists of one or more parts, technically called labels
that are conventionally concatenated, and delimited by dots, such as ibm.com.

 The right-most label conveys the top-level domain; for example, the domain name
www.ibm.com belongs to the top-level domain com.
 The hierarchy of domains descends from right to left; each label to the left specifies a
subdivision, or sub domain of the domain to the right. For example: the label IBM specifies a
sub domain of the com domain, and www is a sub domain of ibm.com. This tree of
subdivisions may have up to 127 levels.
 Each label may contain up to 63 characters. The full domain name may not exceed a total
length of 253 characters in its external dotted-label specification. In the internal binary
representation of the DNS the maximum length requires 255 octets of storage. In practice,
some domain registries may have shorter limits.
 DNS names may technically consist of any character represent able in an octet. However,
the allowed formulation of domain names in the DNS roots zone, and most other sub
domains, uses a preferred format and character set. The characters allowed in a label are a
subset of the ASCII character set, and includes the characters a through z, A through Z,
digits 0 through 9, and the hyphen. This rule is known as the LDH rule (letters, digits,
hyphen). Domain names are interpreted in case-independent manner. Labels may not start
or end with a hyphen.
 A hostname is a domain name that has at least one IP address associated. For example, the
domain names www.ibm.com and ibm.com are also hostnames, whereas the com domain is
not.

The permitted character set of the DNS prevented the representation of names and words of
many languages in their native alphabets or scripts. ICANN has approved the
Internationalizing Domain Names in Applications (IDNA) system, which maps Unicode
strings into the valid DNS character set using Puny code. In 2009 ICANN approved the
installation of IDN country code top-level domains. In addition, many registries of the
existing top level domain names (TLD)s have adopted IDNA.

REVERSE LOOKUP

 A reverse lookup is a query of the DNS for domain names when the IP address is known.
Multiple domain names may be associated with an IP address. The DNS stores IP
addresses in the form of domain names as specially formatted names in pointer (PTR)
records within the infrastructure top-level domain arpa. For IPv4, the domain is in-
addr.arpa. For IPv6, the reverse lookup domain is ip6.arpa. The IP address is
represented as a name in reverse-ordered octet representation for IPv4, and reverse-
ordered nibble representation for IPv6.

When performing a reverse lookup, the DNS client converts the address into these formats, and then
queries the name for a PTR record following the delegation chain as for any DNS query. For example,
assume the IPv4 address 200.90.150.2 is assigned to IBM. It is represented as a DNS name in reverse
order like this: 2.150.90.200.in-addr.arpa. When the DNS resolver gets a PTR (reverse-lookup)
request, it begins by querying the root servers (which point to ARIN's servers for the 200.in-
addr.arpa zone). On ARIN's servers, 150.90.200.in-addr.arpa is assigned to IBM, so the
resolver sends another query to the IBM name server for 2.150.90.200.in-addr.arpa, which
results in an authoritative response

Type of DNS server


 Primary (master) DNS servers: This name server contains authoritative
information about the domains that it serves. In response to queries for
information about its domains, this server provides that information
marked as being authoritative. The primary is the ultimate source of for
data about the domain. The secondary name server only carries the
same authority in that it has received and loaded a complete set of
domain information from the primary.

Secondary (Slave) name server: This name server gets all information for
the domain from the primary. As is the case for the primary, DNS
considers the secondary„s information about the domain that it serves
authoritative

Packages used:

 bind

 bind-devel-*

 bind-utils-*

 caching-nameserver-*
*-means version no and other are appended in the end of these package names.

CONFIGURING SERVER

To configure BIND, following components needs to be configured:

 Configuration file (/var/named/chroot/etc/named.conf) – The main DNS


server configuration file.

 Zone Directory (/var/named/chroot/var/named) – The directory


containing files information about internet root DNS servers (named.ca
file) and information about the zones that are created for our DNS
server.

 Daemon process (/usr/sbin/named) – The daemon process that listens


for DNS requests and responds with the information that are
named.conf file presents.

 Debugging tools (named-checkconf, and named-checkzones) – use to


check that the configuration create is correct or not. (not mandatory).
Configuring

1. Edit /var/named/chroot/etc/named.conf.
# vi /var/named/chroot/etc/named.conf
2. # cd /var/named/chroot/var/named/
3. # cp localhost.zone pune.com.zone
4. # cp named. local pune.com.local
5. # vi pune.com.zone
Save (: wq) and Exit

6. # vi pune.com.local
7. # chgrp named pune.com.local
8. # chgrp named pune.com.zone
9. # chgrp named /var/named/chroot/etc/named.conf

10. # service named restart


11. # vi /etc/resolv.conf
12. # nslookup pune.com
13. # nslookup 122.160.237.201
DHCP SERVER

OVERVIEW

The Dynamic Host Configuration Protocol (DHCP) is a network


protocol that is used to configure network devices so that they can
communicate on the Internet. A DHCP client uses the DHCP protocol to
acquire configuration information, such as an IP address, default route and one
or more DNS server addresses from a DHCP server. The DHCP client then
uses this information to configure its host. Once the configuration process is
complete, the host is able to communicate on the internet.

The DHCP server maintains a database of available IP addresses and


configuration information. When it receives a request from a client, the DHCP
server determines the network to which the DHCP client is connected, and
then allocates an IP address or prefix that is appropriate for the client, and
sends configuration information appropriate for that client.

Because the DHCP protocol must work correctly even before DHCP clients
have been configured, the DHCP server and DHCP client must be connected
to the same network link. In larger networks, this is not practical. On such
networks, each network link contains one or more DHCP relay agents. These
DHCP relay agents receive messages from DHCP clients and forward them to
DHCP servers. DHCP servers send responses back to the relay agent, and the
relay agent then sends these responses to the DHCP client on the local
network link.

DHCP servers typically grant IP addresses to clients only for a limited interval.
DHCP clients are responsible for renewing their IP address before that interval
has expired, and must stop using the address once the interval has expired, if
they have not been able to renew it.

DHCP is used for IPv4 and IPv6. While both versions serve much the same
purpose, the details of the protocol for IPv4 and IPv6 are sufficiently different
that they may be considered separate protocols.

Hosts that do not use DHCP for address configuration may still use it to
obtain other configuration information. Alternatively, IPv6 hosts may
use stateless address auto configuration. IPv4 hosts may use link-local
addressing to achieve limited local connectivity.

Technical Overview

Dynamic Host Configuration Protocol automates network-parameter


assignment to network devices from one or more DHCP servers. Even in small
networks, DHCP is useful because it makes it easy to add new machines to the
network.

When a DHCP-configured client (a computer or any other network-aware


device) connects to a network, the DHCP client sends a broadcast query
requesting necessary information to a DHCP server. The DHCP server
manages a pool of IP addresses and information about client configuration
parameters such as default gateway, domain name, the name servers, other
servers such as time servers, and so forth. On receiving a valid request, the
server assigns the computer an IP address, a lease (length of time the allocation
is valid), and other IP configuration parameters, such as the subnet mask and
the default gateway. The query is typically initiated immediately after booting,
and must complete before the client can initiate IP-based communication with
other hosts. Upon disconnecting, the IP address is returned to the pool for use
by another computer. This way, many other computers can use the same IP
address within minutes of each other.

Depending on implementation, the DHCP server may have three methods of


allocating IP-addresses:

 Dynamic allocation: A network administrator assigns a range of IP


addresses to DHCP, and each client computer on the LAN is configured
to request an IP address from the DHCP server during network
initialization. The request-and-grant process uses a lease concept with a
controllable time period, allowing the DHCP server to reclaim (and then
reallocate) IP addresses that are not renewed.

 Automatic allocation: The DHCP server permanently assigns a free IP


address to a requesting client from the range defined by the
administrator. This is like dynamic allocation, but the DHCP server
keeps a table of past IP address assignments, so that it can preferentially
assign to a client the same IP address that the client previously had.
 Static allocation: The DHCP server allocates an IP address based on a
table with MAC address/IP address pairs, which are manually filled in
(perhaps by a network administrator). [Only requesting clients with a
MAC address listed in this table will be allocated an IP address]. This
feature (which is not supported by all DHCP servers) is variously
called Static DHCP Assignment (by DD-WRT), fixed-address (by the dhcpd
documentation), Address Reservation (by Net gear), DHCP
reservation or Static DHCP (by Cisco/Linksys), and IP reservation or MAC/IP
binding (by various other router manufacturers).

Technical Details

The DHCP client server interaction is as depicted in the following diagram:

Package Used

Dhcp-3.0.5-31.el5

Server Configuration

1. The DHCP server provided with the Virtual Box is disabled.


 Go to File --> Preferences --> “Network” Tab -> Select “Host only
Networking Adapter” -> Right click for Menu.

 Select “Edit Host Only Network” or Press Space.

 A dialog with title “Host only network Details” will appear. Select “DHCP
Server Tab”. Uncheck “Enable Server”.

2. Edit Configuration File.


#vim /etc/dhcpd.conf

1 #
2 # DHCP Server Configuration file.
3 ddns-update-style interim;
4 ignore client-updates;

5 subnet 192.168.56.0 netmask 255.255.255.0 {


8 # --- default gateway
9 option routers 192.168.56.252;
10 option subnet-mask 255.255.255.0;
11
12 option nis-domain "test.com";
13 option domain-name "test.com";
14 option domain-name-servers 192.168.56.2;
15
16 option time-offset -18000; # Eastern Standard Time
17 # option ntp-servers 192.168.1.1;
18 # option netbios-name-servers 192.168.1.1;
19 # --- Selects point-to-point node (default is hybrid). Don't
change this unless
20 # -- you understand Netbios very well
21 # option netbios-node-type 2;
22
23 range dynamic-bootp 192.168.56.128 192.168.56.254;
24 default-lease-times 21600;
25 max-lease-time 43200;
26
27 # we want the name server to appear at a fixed address
28 host ns {
29 next-server marvin.redhat.com;
30 hardware ethernet 12:34:56:78:AB:CD;
31 fixed-address 207.175.42.254;
32 }
33 }
34
Save and Exit (:wq)
3. Start DHCP Server.

#service dhcpd start


See log to check if DHCP is working properly.
Bibliography

1.Red Hat Linux 9 Bible

Websites:
http://www.redhat.com
http://www.ucs.com.uk/doc
/course-notes/unix-
courses/earlier/apache2/file
s/
http://www.infotech.com
http://www.wikipedia.com
http://www.centos.org
http://www-server-world.info

You might also like