Professional Documents
Culture Documents
Submitted
By:
Guided By:
Sushil
Mr. Sanjay
Verma
Gupta
0133CS041050
ACKNOWLEDGEMENT
It is a feeling of immense pleasure & contentment to have successfully
completed the industrial training work during different phases of the training the
invaluable suggestion given by our training guide Mr. Sanjay Gupta can’t be spanned in
words. We extend our deep sense of gratitude for their persistent, encouragement,
motivation & inspiration, which led to us the pinnacle, of success.
Anything done would have been very difficult without their vast experience, innovative
ideas, and through knowledge. Whatever has been done was impossible without their
help & given by them is beyond our expressing capabilities.
Last but not the least, we express our deep appreciation towards our teachers
who provided the much needed support & encouragement to keep us in the race.
July, 2007
Bhopal (M.P.) SUSHIL VERMA
PREFACE
Welcome to documentation report of Linux Networking. It provides exciting
feature of building Networks. This report is being submitted under taking by “Sagar
Institute of Research & Technology” Bhopal (M.P.)
In this introduction part the reader can get the brief information about Linux
networking. This part is useful to make a mind to read and make use of training
report. It covers all training scenario in brief.
The case involved in it provide the actual problem definition & expressing
modules and complete logic which is required to implement design phase of
]
Networking project. This case study is useful for making design, entity relationship &
for networking project. It supports networking project to milestone for testing and
implementation.
Overall, we provide a complete reference to understand the
Networking and could be enhanced in near future. We are very happy to provide a
complete manual of networking with enthusiasm and dedication.
SUSHIL VERMA
COMPANY PROFILE
Established in early 2000, Linux Solution is today, a name to reckon within the
computing world. Linux Solution is having a very huge industrial and corporate
relationship. It has provided training to many corporate as well as industrial institutes.
Linux Solution is a service provider and trainer. Its goal is to have Network
Experts as the core of their computing environment. The institute teaches how to
recover from a disaster in less than an hour. Institute also envisions distribution of
services to different servers to minimize the magnitude of a possible disaster and to
better utilize the network.
In last five years the departmental computing needs have quadrupled and the trend
still continues...therefore, efficient network utilization is key to the deployment.
CONTENTS
Acknowledgement
Preface
Certificate
Company Profile
Introduction
History & Features
Linux Installation
The Filesystem Hierarchy Standard
Linux Commands
To Mount(activate) any disk
RedHat Package Manager (rpm)
Protocols
Topologies
Network cabling
IP Addressing
Servers
o Samba Server
o DNS
o Apache
o Web Server
o Sendmail
INTRODUCTION
What is a Network?
A network consists of two or more computers that are linked in order to share
resources (such as printers and CD-ROMs), exchange files, or allow electronic
communication.
Disadvantages of a Network :
History
Linux is an operating system that was initially created as a hobby by a young student,
Linus Torvalds, at the University of Helsinki in Finland. Linus had an interest in Minix, a
small UNIX system, and decided to develop a system that exceeded the Minix standards. He
began his work in 1991 when he released version 0.02 and worked steadily until 1994 when
version 1.0 of the Linux Kernel was released.
The kernel, at the heart of all Linux systems, is developed and released under the
GNU General Public License and its source code is freely available to everyone. It is this
kernel that forms the base around which a Linux operating system is developed.
Throughout most of the 1990's, tech mostly computer users are unaware of Linux's
potential, dismissed it as a computer hobbyist project, unsuitable for the general public's
computing needs. Through the efforts of developers of desktop management systems such
as KDE and GNOME, office suite project OpenOffice.org and the Mozilla web browser
project, to name only a few, there are now a wide range of applications that run on Linux
and it can be used by anyone regardless of his/her knowledge of computers.
Features
Virtual memory, allowing the system to use disk room the same as RAM memory.
8. Support of file systems that other operating systems use such as DOS (FAT),
Windows95,98 (FAT32), Windows NT, 2000 (NTFS), Apple, minix, and others.
Reasons to use Linux: Safe & Virus free, Free – No License fee, Runs on various
machine architectures, Works well on machines that are not "modern", Recommended 8MB
RAM, with 16MB swap drive space. It will run in hard drives as small as 500MB or less;
Linux is stable and even if a program crashes, it won't bring the OS down, Source code is
openly available.
Linux Installation
Minimum required partitions:
1.) / Root Partition
Minimum Required
2.) /boot Boot or Debug partition partitions.
3.) swap Virtual Memory
In Linux all install file are installed in ‘/’ partition, it has 14 file directories. This is called
‘Root File System’.
Language Selection :
Using your mouse, select the language you would prefer to use for the installation and as the
system default. Selecting the appropriate language will also help target your time zone
configuration later in the
installation. The
installation program will
try to define the
appropriate time zone
based on what you specify
on this screen. Once you
select the appropriate
language, click Next to
continue.
Keyboard Configuration :
Choose the keyboard model that best fits your system. If you cannot find an exact match,
choose the best Generic match for your keyboard type (for example, Generic 101-key PC).
Next, choose the correct
layout type for your keyboard
(for example, U.S. English).
Mouse Configuration :
Choose the correct mouse type for your system. If you cannot find an exact match, choose a
mouse type that you are sure is compatible with your system. To determine your mouse's
interface, follow the mouse
cable back to where it plugs
into your system. If the
connector at the end of the
mouse cable plugs into a
rectangular connector, you
have a serial mouse; if the
connector is round, you have a
PS/2 mouse. If you are
installing Red Hat Linux on a
laptop computer, in most cases
the pointing device will be
PS/2 compatible.
If you cannot find a mouse
that you are sure is compatible
with your system, select one of
the Generic entries, based on your mouse's number of buttons, and its interface.
Be sure to select
Customize packages to be
upgraded if you would to
have more control over
which packages are
upgraded on your system.
To perform a new
installation of Red Hat
Linux on your system,
select perform a new Red
Hat Linux installation and click Next.
Install Options :
Choose whether you would
like to perform a full
installation or an upgrade.
Red Hat Linux allows you to
choose the installation type
that best fits your needs.
Your options are
Workstation, Server,
Laptop, Custom, and
Upgrade.
Disk Partitioning
Setup :
Partitioning allows you to
divide your hard drive into
isolated sections, where each section behaves as its own hard drive. Partitioning is
particularly useful if you run more than one operating system. If you are not sure how you
want your system to be partitioned.
To partition manually, choose
either the Disk Druid or fdisk
(recommended for experts only)
partitioning tool.
Automatic Partitioning :
Automatic partitioning allows
you to have some control
concerning what data is
removed (if any) from your
system. Your options are:
• Remove all Linux partitions
on this system —
Select this option to remove only
Linux partitions (partitions
created from a previous Linux
installation). This will not remove other partitions you may have on your hard drive(s) (such
as VFAT or FAT32 partitions).
• Remove all partitions on
this system —
Select this option to
remove all partitions on
your hard drive(s) (this
includes partitions created
by other operating systems
such as Windows
9x/NT/2000/ME/XP or
NTFS partitions).
Keep
all partitions and use
existing free space —
Select this option to retain
your current data and
partitions, assuming you
have enough free space available on your hard drive(s).
Using your mouse, choose the hard drive(s) on which you want Red Hat Linux to be
installed.
Click Next once you have made your selections to proceed.
Boot Loader Installation : In order to boot the system without a boot diskette,
you usually need to install a boot loader. A boot loader is the first software program
that runs when a computer starts. It is responsible for loading and transferring control
to the operating system kernel software.
GRUB (GRand Unified Bootloader), which is installed by default, is a very powerful boot
loader. GRUB can load a variety of free operating systems, as well as proprietary operating
systems with chain-loading
(the mechanism for loading
unsupported operating
systems, such as DOS or
Windows, by loading
another boot loader).
LILO (LInux LOader) is a
versatile boot loader for
Linux. It does not depend on
a specific file system, can
boot Linux kernel images
from floppy diskettes and
hard disks, and can even
boot other operating
systems.
Network Configuration : If you do not have a network card, you will not see this
screen. Skip ahead to Configuration. If you have a network card and you have not already
configured your
networking, you now
have the opportunity to
do so.
Firewall
Configuration :
Installing Packages
:
At this point there is nothing
left for you to do until all the
packages have been installed
(see Figure). How quickly
this happens depends on the
number of packages you
have selected and your
computer's speed
Installation Complete :
Congratulations! Your Red Hat Linux 7.2 installation is now complete!
The installation program will prompt you to prepare your system for reboot. Do not forget to
remove any diskette in the diskette drive or CD in the CD-ROM drive. If you did not install a
boot loader, you will need to use your boot disk now.
After your computer's normal power-up sequence has completed, you should see the
graphical boot loader prompt, at which you can do any of the following things:
• Press [Enter] — causes the default boot entry to be booted.
• Select a boot label, followed by [Enter] — causes the boot loader to boot the
operating system corresponding to the boot label. (Press [?] at the text mode
boot loader prompt for a list of valid boot labels.)
• Do nothing — after the boot loader's timeout period, (by default, five seconds)
the boot loader will automatically boot the default boot entry.
Do whatever is appropriate to boot Red Hat Linux. You should see one or more screens of
messages scroll by. Eventually, you should see a login: prompt or a GUI login screen (if you
installed the X Window System and chose to start X automatically).
The Filesystem Hierarchy Standard
• Standard set of directories for Linux and UNIX systems.
/bin
/boot /dev /etc
/var
/usr/local
Directory Description
/bin Contains binary commands for use by all users
/boot Contains the Linux kernel and files used by the boot loader
/dev Contains device files
/etc Contains system-specific configuration files
/home Is the default location for user home directories
/lib Contains shared program library (used by the commands in /bin and
/sbin) as well as kernel modules
/mnt Is the empty directory used for accessing (mounting) disks, such as
floppy disks and CD_ROMs
/opt Stores additional software programs
/proc Stores additional software programs
/root Is the root user’s home directory
/sbin Contains system binary commands (used for administration)
/tmp Holds temporary files created by programs
/usr Contains most system commands and utilities – contains the following
directories:
/usr/bin – user binary commands
/usr/games – Educational programs and games
/usr/include – C program hearer files
/usr/local – Local Programs
/usr/sbin – System Binary Commands
/usr/share – Files that are architecture independent
/usr/src – Source code
/usr/X11R6 – The X Windows system
/usr/local Is the location for most additional programs
/var Contains log files and spools
Linux Commands
There are two types of Linux Command, First is Administrator Commands & second
type is Local user Commands.
[root@sushil root] #
Administrator sign
DIRECTORY COMMANDS
Command Execution
mkdir directory Creates a directory.
rmdir directory Erases a directory.
ls -F Lists directory name with a preceding slash.
Command Execution
ls -R Lists working directory as well as all subdirectories.
cd directory name Changes to the specified directory, making it the working
directory. cd without a directory name changes back to the home
directory:
$ cd reports
pwd Displays the pathname of the working directory.
directory name/filename A slash is used in pathnames to separate each directory name. In
the case of pathnames for files, a slash separates the preceding
directory names from the filename.
.. References the parent directory. You can use it as an argument or
as part of a pathname:
$ cd ..
$ mv ../larisa oldletters
. References the working directory. You can use it as an argument
or as part of a pathname:
$ ls .
~/pathname The tilde is a special character that represents the pathname for the
home directory. It is useful when you need to use an absolute
pathname for a file or directory:
$ cp monday ~/today
find COMMAND
Command/Option Execution
find Searches directories for files according to search criteria. This
command has several options that specify the type of criteria
and actions to be taken.
-name pattern Searches for files with the pattern in the name.
-group name Searches for files belonging to this group name.
-size numc Searches for files with the size num in blocks. If c is added
after num, the size in bytes (characters) is searched for.
-mtime num Searches for files last modified num days ago.
-newer pattern Searches for files modified after the one matched by pattern.
-print Outputs the result of the search to the standard output. The
result is usually a list of filenames, including their full
pathnames.
-type filetype Searches for files with the specified file type. File type can be
Command/Option Execution
b for block device, c for character device, d for directory, f for
file, or l for symbolic link.
FILE OPERATIONS
Command Execution
cp filename filename Copies a file. cp takes two arguments: the original file and the
name of the new copy. You can use pathnames for the files to
copy across directories:
$ cp today reports/monday
cp -r dirname dirname Copies a subdirectory from one directory to another. The copied
directory includes all its own subdirectories:
$ cp -r letters/thankyou oldletters
mv filename filename Moves (renames) a file. mv takes two arguments: the first is the
file to be moved. The second argument can be the new filename
or the pathname of a directory. If it is the name of a directory,
then the file is literally moved to that directory, changing the
file's pathname:
$ mv today /home/chris/reports
mv dirname dirname Moves directories. In this case, the first and last arguments are
directories:
$ mv letters/thankyou oldletters
ln filename filename Creates added names for files referred to as links. A link can be
created in one directory that references a file in another
directory:
$ ln today reports/monday
rm filenames Removes (erases) a file. Can take any number of filenames as
its arguments. Literally removes links to a file. If a file has more
than one link, you need to remove all of them to erase a file:
$rm today weather weekend
MOUNTING
The mount Command
The mount command takes two arguments: the storage device through which Linux accesses
the file system, and the directory in the file structure to which the new file system is
attached. The mountpoint is the directory on your main directory tree where you want the
files on the storage device attached. The device is a special device file that connects your
system to the hardware device. The syntax for the mount command is as follows:
# mount device mountpoint
If you are unsure as to the type of file system that the floppy disk holds, you can mount it
specifying the auto file system type with the -t option. Given the auto file system type,
mount attempts to detect the type of file system on the floppy disk automatically.
# umount /mydir
# mount /dev/hdc /mnt/cdrom
# cd /mnt/cdrom
# umount /mnt/cdrom
umount: /dev/hdd: device is busy
# cd /root
# umount /mnt/cdrom
PACKAGE INSTALLATION
On Red Hat, you can easily install or remove software from your system with either
the redhat-config-packages tool or the rpm command. Alternatively, you can install software
by downloading and compiling its source code.
Option Action
-U Updates package
-i Installs package
-e Removes package
-qi Displays information for an installed package
-ql Displays file list for installed package
-qpi Displays information from an RPM package file (used for uninstalled
packages)
Option Action
-qpl Displays file list from an RPM package file (used for uninstalled packages)
-K Authenticates and performs integrity check on a package
The software package name is usually quite lengthy, including information about the version
and release date in its name. All end with .rpm.
………owner………group…………other……….
r w x :r w x:r w x
………………………………………………………………
File modes
Read permission = r
Write permission = w
Execute permission = x
-rw–r–r- 1 chris weather 207 Feb20 11:55 mydata
File type = -
Permission = rw-r-r-
Number of lines = 1
Owner name = chris
Group name = weather
Size of file in bytes = 207
Date and Time last modified = Feb 20 , 11:55
File name = mydata
CHANGING FILE PERMISSIONS
CLASSIFICATION OF TOPOLOGY
Topology can be classified as :
• BUS
• STAR
• RING
• TREE
BUS
Bus topology consists of a one long cable which
act as a backbone to link all the devices in
the network.All nodes (file server,workstations
and peripherals) are reconnected to the linear
cable. Ethernet and Local Talk network use a
linear bus Topology.
Fig: BUS TOPOLOGY
STAR TOPOLOGY
In Star Topology each device(file server,workstation
and peripherals ) are connected directly to a central network
hub or concentrator.Data on a star network passes through
the hub or concentrator before continuing to its
destination.The hub or concentrator manages and controls
all functions of the network.
RING TOPOLOGY
In ring topology each computer is connected directly to other
computers in the network.Data moves down a one way path
from one computer to another.
Token Ring protocol uses ring topology.
Fig: RING TOPOLOGY
PROTOCOLS
A uniform set of rules that enable two devices to connect and transmit data to one
another. Protocols determine how data are transmitted between computing devices and over
networks. They define issues such as error control and data compression methods. The
protocol determines the following:
Type of error checking to be used, data compression method (if any), how the
sending device will indicate that it has finished a message and how the receiving device will
indicate that it has received the message.
Internet protocols include:
• TCP/IP (Transfer Control Protocol/Internet Protocol)
• HTTP (Hypertext Transfer Protocol)
• FTP (File Transfer Protocol)
• SMTP (Simple Mail Transfer Protocol)
NETWORK CABLING
Cable is the medium through which information usually moves from one network
device to another. There are several types of cable which are commonly used with LANs.The
following sections discuss the types of cables used in networks and other related topics:
• Unshielded twisted pair(UTP) cable
• Shielded twisted pair(STP) cable
• Coaxial cable
• Fiber optic cable
• Wireless LANs
• Cable installation guides
Address Classes
There are 5 different address classes. You can determine which class any IP address is in by
examining the first 4 bits of the IP address.
1. Class A addresses begin with 0xxx, or 1 to 126 decimal.
2. Class B addresses begin with 10xx, or 128 to 191 decimal.
3. Class C addresses begin with 110x, or 192 to 223 decimal.
4. Class D addresses begin with 1110, or 224 to 239 decimal.
5. Class E addresses begin with 1111, or 240 to 254 decimal.
Addresses beginning with 01111111, or 127 decimal, are reserved for loopback and for
internal testing on a local machine; [You can test this: you should always be able to ping
127.0.0.1, which points to yourself] Class D addresses are reserved for multicasting; Class E
addresses are reserved for future use. They should not be used for host addresses.
Now we can see how the Class determines, by default, which part of the IP address belongs
to the network (N, in blue) and which part belongs to the node (n, in red).
• Class A -- NNNNNNNN.nnnnnnnn.nnnnnnnn.nnnnnnnn
• Class B -- NNNNNNNN.NNNNNNNN.nnnnnnnn.nnnnnnnn
• Class C -- NNNNNNNN.NNNNNNNN.NNNNNNNN.nnnnnnnn
Samba Server
Samba uses the SMB protocol to share files and printers across a network connection.
Operating systems that support this protocol include Microsoft Windows (through its
Network Neighborhood), OS/2, and Linux.
Samba is useful if you have a network of both Windows and Linux machines.
Samba allows files and printers to be shared by all the systems in your network. If you want
to share files between Red Hat Linux machines only, use NFS.
DNS
(Domain Name Server/Domain Name Service/Specification)
Definitions of DNS :
• Domain Name Server (or system) – An Internet service that translates domain names
into IP addresses.
• (Domain Name System) The Domain Name System is the system that translates
Internet domain names into IP numbers. A "DNS Server" is a server that performs this
kind of translation.
• DNS stands for Domain Name System. This System translates a domain name such as
rshweb.com into the Internet Protocol (IP) numbers (209.203.234.42) to find the
correct web site - in this case the site for Domain Bank. The network of computers
that constitute the Internet map domain names to their corresponding IP numbers. The
data is then made available to all computers and users on the Internet.
Domain name servers translate domain names to IP addresses. That sounds like a simple
task, and it would be -- except for five things:
1. There are billions of IP addresses currently in use, and most machines have a human-
readable name as well.
2. There are many billions of DNS requests made every day. A single person can easily
make a hundred or more DNS requests a day, and there are hundreds of millions of
people and machines using the Internet daily.
3. Domain names and IP addresses change daily.
4. New domain names get created daily.
5. Millions of people do the work to change and add domain names and IP addresses
every day.
Domain Names:
If we had to remember the IP addresses of all of the Web sites we visit every day, we would
all go nuts. Human beings just are not that good at remembering strings of numbers. We are
good at remembering words, however, and that is where domain names come in. You
probably have hundreds of domain names stored in your head. For example:
• www.gmail.com - a typical name
• www.yahoo.com - the world's best-known name
• www.mit.edu - a popular EDU name
• encarta.msn.com - a Web server that does not start with www
• www.bbc.co.uk - a name using four parts rather than three
• ftp.microsoft.com - an FTP server rather than a Web server
The COM, EDU and UK portions of these domain names are called the top-level
domain or first-level domain. There are several hundred top-level domain names, including
COM, EDU, GOV, MIL, NET, ORG and INT, as well as unique two-letter combinations for
every country. Within every top-level domain there is a huge list of second-level domains.
For example, in the COM first-level domain, you've got:
• gmail
• yahoo
• msn
• microsoft
Every name in the COM top-level domain must be unique, but there can be
duplication across domains. For example, gmail.com.com and gmail.org are completely
different machines. In the case of bbc.co.uk, it is a third-level domain. Up to 127 levels are
possible, although more than four is rare.
The left-most word, such as www or encarta, is the host name. It specifies the name of
a specific machine (with a specific IP address) in a domain. A given domain can potentially
contain millions of host names as long as they are all unique within that domain.
Domain: Provides hierarchy property
Domain + name = Domain Name
There are 7 top level domains : -
.com - For Commercial site
.net - Network Soulution
.edu - Educational site
.org - Organisation
.gov - Government
.int - International
.mil - Military
Yahoo.com
-----
.co.in .co.uk .co.ca .co.au .co.us
DNS Functions:
It resolve name into IP, & IP into name & fully qualified domain name.
There are three types of zone in DNS:
1. Forward Master Zone – It resolve name into IP.
2. Reverse Master Zone – It resolve IP into Name.
3. Slave Zone – For creating subdomains.
Fully Qualified Zone: www. Sites are fully qualified. For fully qualified sites, like
awww.yahoo.com, if we simply give ‘yahoo’ it opens the site, or we write ‘yahoo.com’ it
opens the site. We do not need to give the full name ‘www.yahoo.com’ .
DNS Server is also known as Named or BIND (Barkeley Internet Named Domain) Server.
DNS with BIND = DNS Server
APACHE WEB SERVER
The httpd and redhat-config-httpd RPM packages need to be installed to use the
HTTP Configuration Tool. It also requires the X Window System and root access. To start
the application, go to the Main Menu Button => System Settings => Server Settings =>
HTTP Server or type the command redhat-config-httpd at a shell prompt (for example, in an
XTerm or GNOME Terminal).
The general steps for configuring the Apache HTTP Server using the HTTP Configuration
Tool are as following:
1. Configure the basic settings under the Main tab.
2. Click on the Virtual Hosts tab and configure the default settings.
3. Under the Virtual Hosts tab, configure the Default Virtual Host.
4. If you want to serve more than one URL or virtual host, add the additional virtual
hosts.
5. Configure the server settings under the Server tab.
6. Configure the connections settings under the Performance Tuning tab.
7. Copy all necessary files to the DocumentRoot and cgi-bin directories.
8. Exit the application and select to save your settings.
SENDMAIL SERVER
In our configuration and installation we'll provide you two different configurations that you
can set up for Sendmail;
Central Mail Hub Relay, The Central Mail Hub Relay Server configuration will be used for
your server where the assigned task is to send, receive and relay all mail for all local or
neighbor client and server mail machines you may have on your network.
Local or neighbor clients and servers.
A local or neighbor client and server refer to all other local server or client
machines on your network that run Sendmail and send all outgoing mail to the Central Mail
Hub for future delivery. This kind of internal client never receives mail directly via the
Internet; instead, all mail from the Internet for those computers is kept on the Mail Hub
server.
It is a good idea to run one
Central Mail Hub Server for
all computers on your
network; this architecture
will limit the task
managements on the server
and client machines, and
improve the security of your
site.
You can configure the
neighbor Sendmail so that it accepts only mail that is generated locally, thus insulating
neighbor machines for easier security. The Gateway server outside the firewall or part of it
acts as a proxy and accepts external mail via its Firewall rules file that is destined for internal
delivery from the outside, and forwards it to the Central Mail Hub Server. Also note that the
Gateway server is configured like a neighbor Sendmail server to never accept incoming mail
from the outside the Internet.
Here is a graphical representation of the Sendmail configuration used in this book, with
different settings: