Linux Trng Lsbpl

Embed Size (px)

Citation preview

  • 8/8/2019 Linux Trng Lsbpl

    1/37

    Linux Solution

    A Dissertation Submitted in fulfillment of

    Industrial Training ProgramOn

    LINUX NETWORKINGJune-July 2010

    ACKNOWLEDGEMENT

    SubmittedBy:

    Sushil

    Verma

    0133CS041050

    Guided By:Mr. Sanjay

    Gupta

  • 8/8/2019 Linux Trng Lsbpl

    2/37

    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 cant 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.

    We are thankful to LINUX SOLUTION institute for providing us necessary help

    & congenial environment for our training work.

    Last but not the least, we express our deep appreciation towards our teacherswho provided the much needed support & encouragement to keep us in the race.

    July, 2007Bhopal (M.P.) SUSHIL VERMA

    PRE FACE

  • 8/8/2019 Linux Trng Lsbpl

    3/37

    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 & TechnologyBhopal (M.P.)

    In this introduction part the reader can get the brief information about Linuxnetworking. 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

  • 8/8/2019 Linux Trng Lsbpl

    4/37

    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 aservice providerand trainer. Its goal is to haveNetworkExperts 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.

    Linux Solution is an upcoming institute with huge industrial and corporate

    contacts which resembles a RHCE course pattern with some modifications which

    increase the performance of an individual and has been used in many designs of

    computing environments.

    CONTENTS

    Acknowledgement

  • 8/8/2019 Linux Trng Lsbpl

    5/37

    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

  • 8/8/2019 Linux Trng Lsbpl

    6/37

    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.

    The two basic types of networks include:-

    LOCAL AREA NETWORK (LAN)

    WIDE AREA NETWORK(WAN)LOCAL AREA NETWORK

    A local area network (LAN) is a network that is confined to a relatively small area. It

    is generally limited to a geographic area such as writing lab, school or building .Rarely areLAN computers more than a mile apart.

    WIDE AREA NETWORK

    Wide area network (WANs) connects larger geographic areas, such as Florida, UnitedStates, or the world.

    Need for a Network :

    1. Speeds: Network provide a very rapid method for sharing and

    transferring files.

    2. Cost: Network able version of many popular software programs areavailable at considerable savings when compared to buying individuallylicensed copies.

    3. Security:Files and programs on a network can be designated as copyinhibit, so that you do not have to worry about illegal coping ofprograms. Also, password can be established for specific directories torestrict access to authorized users.

    4. Centralized software management: One of thegreatest benefits ofinstalling a network at a school is the fact that all of the software can beloaded on one computer (the file server).This eliminates that need tospend time and energy installing updates and tracking files onindependent computers throughout the building.

  • 8/8/2019 Linux Trng Lsbpl

    7/37

    5. Resources Sharing:Sharing resources is another area in which a networkexceeds stand-alone computers.

    6. Electronic mail:The presence of a network provides the hardwarenecessary to install an e-mail system.

    7. Flexible access: Networking allows users to access their files fromthroughout the network.

    Disadvantages of a Network :

    1. Expensive to install: Although a network will generally save moneyover time, the initial costs of installation can be prohibitive.

    2. Requires administrative time: Proper maintenance of a networkrequires considerable time and expertise.

    3. File server may fail: Although a file server is no more susceptible tofailure than any other computer, when the files server goes down, theentire network may come to a halt.

    4. Cables may break: Some of the configurations are designed to minimizethe inconvenience of a broken cable; with other configurations, onebroken cable can stop the entire network.

    History

  • 8/8/2019 Linux Trng Lsbpl

    8/37

    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, asmall UNIX system, and decided to develop a system that exceeded the Minix standards. Hebegan his work in 1991 when he released version 0.02 and worked steadily until 1994 whenversion 1.0 of the Linux Kernel was released.

    The kernel, at the heart of all Linux systems, is developed and released under theGNU General Public License and its source code is freely available to everyone. It is thiskernel 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'spotential, dismissed it as a computer hobbyist project, unsuitable for the general public'scomputing needs. Through the efforts ofdevelopers of desktop management systems suchas KDE and GNOME, office suite project OpenOffice.org and the Mozilla web browserproject, to name only a few, there are now a wide range of applications that run on Linuxand it can be used by anyone regardless of his/her knowledge of computers.

    FeaturesVirtual memory, allowing the system to use disk room the same as RAM memory.

    1. Networking with TCP/IP and other protocols.2. Multiple user capability.3. Protected mode so programs or user's can't access unauthorized areas.4. Shared libraries5. True multitasking6. X - A graphical user interface similar to windows, but supports remote sessions over a

    network.

    7. Advanced server functionalityo DHCP servero Samba server

    o DNS servero Mail services

    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 8MBRAM, 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 isopenly available.

    Linux Installation

    http://www.linux.org/info/gnu.htmlhttp://www.linux.org/info/gnu.html
  • 8/8/2019 Linux Trng Lsbpl

    9/37

    Minimum required partitions:

    1.) / Root Partition

    2.) /boot Boot or Debug partition3.) swap Virtual Memory

    4.) /xyz Addition partition (Optional)

    In Linux all install file are installed in / partition, it has 14 file directories. This is calledRoot File System.

    Steps to Install Linux Operating System:

    Insert RHE4 Disk-1 : To install Red Hat Linux from a CD-ROM, choose the CD-

    ROM option from the boot loader screen and select OK.

    Language Selection :Using your mouse, select the language you would prefer to use for the installation and as thesystem default. Selecting the appropriate language will also help target your time zoneconfiguration later in theinstallation. The

    installation program willtry to define theappropriate time zonebased on what you specifyon this screen. Once youselect the appropriatelanguage, click Next tocontinue.

    Keyboard Configuration :

    Minimum Required

    partitions.

  • 8/8/2019 Linux Trng Lsbpl

    10/37

    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 correctlayout type for your keyboard(for example, U.S. English).

    Creating special characterswith multiple keystrokes isdone using "dead keys" (alsoknown as compose keysequences). Dead keys areenabled by default. If you donot wish to use them, selectDisable dead keys.To testyour keyboard configuration,

    use the blank text field at thebottom of the screen to entertext. Once you have made theappropriate selections, click Next to continue.

    Mouse Configuration :Choose the correct mouse type for your system. If you cannot find an exact match, choose amouse type that you are sure is compatible with your system. To determine your mouse'sinterface, follow the mouse

    cable back to where it plugsinto your system. If theconnector at the end of themouse cable plugs into arectangular connector, youhave a serial mouse; if theconnector is round, you have aPS/2 mouse. If you areinstalling Red Hat Linux on alaptop computer, in most casesthe pointing device will bePS/2 compatible.If you cannot find a mousethat you are sure is compatiblewith your system, select one ofthe Generic entries, based on your mouse's number of buttons, and its interface.

    Choosing to Upgrade or Install :

  • 8/8/2019 Linux Trng Lsbpl

    11/37

    The Upgrade Examine screen appears automatically if the installation program detects aprior version of Red Hat Linux on your system.

    If you would like toperform an upgrade, select

    Perform an upgrade of anexisting installation.

    Be sure to selectCustomize packages to beupgraded if you would tohave more control overwhich packages areupgraded on your system.

    To perform a newinstallation of Red HatLinux on your system,select perform a new RedHat Linux installation and click Next.

    Install Options :Choose whether you wouldlike to perform a fullinstallation or an upgrade.Red Hat Linux allows you tochoose the installation typethat best fits your needs.Your options areWorkstation, Server,Laptop, Custom, andUpgrade.

    Disk Partitioning

    Setup :

    Partitioning allows you todivide your hard drive intoisolated sections, where each section behaves as its own hard drive. Partitioning isparticularly useful if you run more than one operating system. If you are not sure how youwant your system to be partitioned.

  • 8/8/2019 Linux Trng Lsbpl

    12/37

    To partition manually, chooseeither the Disk Druid orfdisk(recommended for experts only)partitioning tool.

    Automatic Partitioning :Automatic partitioning allowsyou to have some controlconcerning what data isremoved (if any) from yoursystem. Your options are:

    Remove all Linux partitions

    on this system

    Select this option to remove onlyLinux partitions (partitions

    created from a previous Linuxinstallation). This will not remove other partitions you may have on your hard drive(s) (suchas VFAT or FAT32 partitions).

    Remove all partitions on

    this system

    Select this option toremove all partitions onyour hard drive(s) (thisincludes partitions createdby other operating systems

    such as Windows9x/NT/2000/ME/XP orNTFS partitions).

    Keep

    all partitions and use

    existing free space Select this option to retainyour current data andpartitions, assuming youhave 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 beinstalled.

    ClickNext 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

  • 8/8/2019 Linux Trng Lsbpl

    13/37

    that runs when a computer starts. It is responsible for loading and transferring controlto the operating system kernel software.

    GRUB (GRand Unified Bootloader), which is installed by default, is a very powerful bootloader. GRUB can load a variety of free operating systems, as well as proprietary operatingsystems with chain-loading

    (the mechanism for loadingunsupported operatingsystems, such as DOS orWindows, by loadinganother boot loader).

    LILO (LInux LOader) is aversatile boot loader forLinux. It does not depend ona specific file system, canboot Linux kernel imagesfrom floppy diskettes andhard disks, and can evenboot other operatingsystems.

    Network Configuration : If you do not have a network card, you will not see thisscreen. Skip ahead to Configuration. If you have a network card and you have not alreadyconfigured yournetworking, you nowhave the opportunity to

    do so. Firewall

    Configuration :

    Red Hat Linux offersfirewall protection forenhanced system security. Afirewall exists betweenyour computer and thenetwork, and determines

    which resources on yourcomputer remote users onthe network can access. Aproperly configured firewall can greatly increase the security of your system.

    Language support Selection :Red Hat Linux can install and supportmultiple languages for use on your system. You must select a language to use as thedefault language. The default language will be used on your Red Hat Linux system once

  • 8/8/2019 Linux Trng Lsbpl

    14/37

    installation is complete. If you choose to install other languages, you can change yourdefault language after the installation.

    Time Zone Configuration : You can set your time zone by selecting yourcomputer's physical location or by specifying your time zone's offset from Universal Time,

    Coordinated (UTC).On the interactive map,you can also click on aspecific city, which ismarked by a yellow dot; ared X will appearindicating your selection.You can also scroll through alist and choose a time zone.

    Setting the root

    password :Setting up a root accountand password is one of themost important stepsduring your installation.Your root account is similar to the administrator account used on Windows NT machines.The root account is used toinstall packages, upgradeRPMs, and perform mostsystem maintenance.Logging in as root givesyou complete control overyour system.

    Package

    Group

    Selection :After yourpartitionshave beenselected andconfiguredforformatting, you are ready to select packages for installation.

    GNOME and KDE are both graphical desktop environments that handle the overall look andfeel of your system. You must choose one of these to have a default graphical setup, but youcan also install both to determine for yourself which you prefer.

  • 8/8/2019 Linux Trng Lsbpl

    15/37

    You can select components, which group packages together according to function (forexample, C Development, Networked Workstation, or Web Server), individual packages, ora combination of the two.To select a component, clickon the checkbox beside it.

    Installing Packages:

    At this point there is nothingleft for you to do until all thepackages have been installed(see Figure). How quicklythis happens depends on thenumber of packages you

    have selected and yourcomputer's speed

    Boot Disk Creation :If you chose to create a boot disk, you should now insert a blank, formatted diskette intoyour diskette drive.It is highly recommendedthat you create a boot disk. Ifyour system were not able to boot properly using GRUB LILO, or a third-party bootloader, a boot disk wouldenable you to properly bootyour Red Hat Linuxsystem.

    Video Card

    Configuration :

    The installation programwill now present a list ofvideo cards for you tochoose from.If you decided to install the X Window System packages, you now have the opportunity toconfigure an X server for your system. If you did not choose to install the X Window Systempackages, skip ahead to Preparing to Install.

    http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/install-guide/s1-installpkgs.html#INSTALLPKGS-FIGhttp://www.redhat.com/docs/manuals/linux/RHL-9-Manual/install-guide/s1-preparetoinstall.htmlhttp://www.redhat.com/docs/manuals/linux/RHL-9-Manual/install-guide/s1-installpkgs.html#INSTALLPKGS-FIGhttp://www.redhat.com/docs/manuals/linux/RHL-9-Manual/install-guide/s1-preparetoinstall.html
  • 8/8/2019 Linux Trng Lsbpl

    16/37

    XConfiguration Monitor and Customization Dfgdf :

    In order to complete X configuration, you must configure your monitor and customize yourX settings.

    Configuring Your Monitor :

    The installation program will present you with a list of monitors to select from. From thislist, you can either use the monitor that is automatically detected for you, or choose anothermonitor.If your monitor does not appear on the list, select the most appropriate Generic modelavailable. If you select a Generic monitor, the installation program will suggest horizontaland vertical sync ranges. These values are generally available in the documentation whichaccompanies your monitor, or from your monitor's vendor or manufacturer; please checkyour documentation to make sure these values are set correctly.

    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 toremove any diskette in the diskette drive or CD in the CD-ROM drive. If you did not install aboot loader, you will need to use your boot disk now.

    After your computer's normal power-up sequence has completed, you should see thegraphical 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 theoperating system corresponding to the boot label. (Press [?] at the text modeboot 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 ofmessages scroll by. Eventually, you should see a login: prompt or a GUI login screen (if youinstalled the X Window System and chose to start X automatically).

  • 8/8/2019 Linux Trng Lsbpl

    17/37

    The Filesystem Hierarchy Standard

    Standard set of directories for Linux and UNIX systems.

    File and subdirectory contents Gives Linux software developers ability to locate files on any Linux system

    Create non-distributionspecific software

    /

    /bin/boot /dev /etc

    /home /lib /mnt

    /proc /root /tmp

    /var/usr/local

    /usr

    /opt

  • 8/8/2019 Linux Trng Lsbpl

    18/37

    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 asfloppy disks and CD_ROMs

    /opt Stores additional software programs

    /proc Stores additional software programs

    /root Is the root users 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 followingdirectories:/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

  • 8/8/2019 Linux Trng Lsbpl

    19/37

    Linux Commands

    There are two types of Linux Command, First is Administrator Commands & secondtype is Local user Commands.

    [root@sushil root] #

    LISTING, DISPLAYING & PRINTING FILES:

    Command /Option Execution

    ls This command lists file and directory names.

    catfilenames This filter can be used to display a file. It can take filenamesfor its arguments. It outputs the contents of those filesdirectly to the standard output, which, by default, is directedto the screen.

    morefilenames This utility displays a file screen by screen. Press theSPACEBAR to continue to the next screen and q to quit.

    lessfilenames This utility also displays a file screen by screen. Press theSPACEBAR to continue to the next screen and q to quit.

    lprfilenames Sends a file to the line printer to be printed; a list of filesmay be used as arguments. Use the -P option to specify aprinter.

    lpq Lists the print queue for printing jobs.

    lprm Removes a printing job from the print queu

    DIRECTORY COMMANDS

    Command Execution

    mkdirdirectory Creates a directory.

    rmdirdirectory Erases a directory.

    ls -F Lists directory name with a preceding slash.

    Administrator sign

  • 8/8/2019 Linux Trng Lsbpl

    20/37

    Command Execution

    ls -R Lists working directory as well as all subdirectories.

    cd directory name Changes to the specified directory, making it the workingdirectory. cd without a directory name changes back to the home

    directory:$cdreports

    pwd Displays the pathname of the working directory.

    directory name/filename A slash is used in pathnames to separate each directory name. Inthe case of pathnames for files, a slash separates the precedingdirectory names from the filename.

    .. References the parent directory. You can use it as an argument oras 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 thehome directory. It is useful when you need to use an absolutepathname for a file or directory:$ cp monday ~/today

    find COMMAND

    Command/Option Execution

    find Searches directories for files according to search criteria. Thiscommand has several options that specify the type of criteriaand actions to be taken.

    -namepattern Searches for files with thepattern in the name.

    -groupname Searches for files belonging to this group name.

    -sizenumc Searches for files with the size num in blocks. If c is addedafternum, the size in bytes (characters) is searched for.

    -mtimenum Searches for files last modified num days ago.

    -newerpattern Searches for files modified after the one matched bypattern.

    -print Outputs the result of the search to the standard output. Theresult is usually a list of filenames, including their fullpathnames.

    -typefiletype Searches for files with the specified file type. File type can be

  • 8/8/2019 Linux Trng Lsbpl

    21/37

    Command/Option Execution

    b for block device, c for character device, d for directory, fforfile, orl for symbolic link.

    FILE OPERATIONS

    Command Execution

    cpfilenamefilename Copies a file. cp takes two arguments: the original file and thename of the new copy. You can use pathnames for the files tocopy across directories:$cptodayreports/monday

    cp-rdirname dirname Copies a subdirectory from one directory to another. The copieddirectory includes all its own subdirectories:$cp-rletters/thankyouoldletters

    mvfilename filename Moves (renames) a file. mv takes two arguments: the first is thefile to be moved. The second argument can be the new filenameor the pathname of a directory. If it is the name of a directory,then the file is literally moved to that directory, changing thefile's pathname:$mvtoday/home/chris/reports

    mvdirnamedirname Moves directories. In this case, the first and last arguments aredirectories:$mvletters/thankyouoldletters

    lnfilenamefilename Creates added names for files referred to as links. A link can becreated in one directory that references a file in anotherdirectory:$lntodayreports/monday

    rmfilenames Removes (erases) a file. Can take any number of filenames asits arguments. Literally removes links to a file. If a file has morethan one link, you need to remove all of them to erase a file:$rmtodayweatherweekend

    MOUNTINGThe mount CommandThe mount command takes two arguments: the storage device through which Linux accessesthe file system, and the directory in the file structure to which the new file system isattached. The mountpoint is the directory on your main directory tree where you want thefiles on the storage device attached. The device is a special device file that connects yoursystem to the hardware device. The syntax for the mount command is as follows:

  • 8/8/2019 Linux Trng Lsbpl

    22/37

    # mountdevice mountpoint

    Table: The mount Command

    Mount Options Description

    -f Fakes the mounting of a file system. Use it to check if a filesystem can be mounted.

    -v Verbose mode. mount displays descriptions of the actions it istaking. Use with -f to check for any problems mounting a filesystem, -fv.

    -w Mounts the file system with read/write permission.

    -r Mounts the file system with read-only permission.

    -n Mounts the file system without placing an entry for it in the

    mstab file.-ttype Specifies the type of file system to be mounted.

    -a Mounts all file systems listed in /etc/fstab.

    -ooption-list Mounts the file system using a list of options. This is a comma-separated list of options following -o.

    # mount /dev/fd0 /mnt/floppy# mount /mnt/windows

    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.

    # mount -t auto /dev/fd0 /mnt/floppy

    The umount Command

    If you want to replace one mounted file system with another, you must first explicitlyunmount the one already mounted. Say you have mounted a floppy disk, and now you wantto take it out and put in a new one. You must unmount that floppy disk before you can put inand mount the new one. You unmount a file system with the umount command. The umount

    command can take as its argument either a device name or the directory where it wasmounted. Here is the syntax:

    # umountdevice-or-mountpoint

    The following example unmounts the floppy disk wherever it is mounted:

    # umount /dev/fd0

  • 8/8/2019 Linux Trng Lsbpl

    23/37

    Using the example where the device was mounted on the /mydir directory, you could usethat directory to unmount the file system:

    # umount /mydir# mount /dev/hdc /mnt/cdrom

    # cd /mnt/cdrom# umount /mnt/cdromumount: /dev/hdd: device is busy# cd /root# umount /mnt/cdrom

    Mounting Floppy Disks

    As noted previously, to access a file on a floppy disk, the disk first has to be mounted onyour Linux system. The device name for your floppy drive is fd0, and it is located in thedirectory /dev. Entering /dev/fd0 references your floppy drive. Notice the number 0 after fd.

    If you have more than one floppy drive, the additional drives are represented by fd1, fd2, andso on. You can mount to any directory you want. Red Hat creates a convenient directory touse for floppy disks, /mnt/floppy. The following example mounts the floppy disk in yourfloppy drive to the /mnt/floppy directory:

    # mount /dev/fd0 /mnt/floppy# umount /dev/fd0For the umount or mount operations, you can specify either the directory it is mounted on orthe /dev/fd0 device.# umount /mnt/floppy

    You can now remove the floppy disk, put in the new one, and then mount it:# mount /mnt/floppy

    Mounting CD-ROMs

    Remember, when you mount a CD-ROM or floppy disk, you cannot then simply remove it toput another one in the drive. You first have to unmount it, detaching the file system from theoverall directory tree. In fact, the CD-ROM drive remains locked until you unmount it. Onceyou unmount a CD-ROM, you can then take it out and put in another one, which you thenmust mount before you can access it. When changing several CD-ROMs or floppy disks, youare continually mounting and unmounting them. For a CD-ROM, instead of using theumount command, you can use the eject command with the device name or mount point,

    which will unmount and then eject the CD-ROM from the drive.

    # mount /mnt/cdrom# umount /mnt/cdrom

    If you want to mount a CD-ROM to another directory, you have to include the device namein the mount command. The following example mounts the disc in your CD-ROM drive tothe /mydir directory. The particular device name for the CD-ROM in this example is

  • 8/8/2019 Linux Trng Lsbpl

    24/37

    /dev/hdc.# mount /dev/hdc /mydir

    Mounting Hard Drive Partitions: Linux and Windows

    You can mount either Linux or Windows hard drive partitions with the mount command.However, it is much more practical to have them mounted automatically using the /etc/fstabfile as described previously. The Linux hard disk partitions you created during installationare already automatically mounted for you. As noted previously, to mount a Linux hard diskpartition, enter the mount command with the device name of the partition and the directory towhich you want to mount it. IDE hard drives use the prefix hd, and SCSI hard drives use theprefix sd. The next example mounts the Linux hard disk partition on /dev/hda4 to thedirectory /mnt/mydata:

    # mount -t ext3 /dev/hda4 /mnt/mydata# mount -t vfat /dev/hda1 /mnt/windows

    PACKAGE INSTALLATION

    On Red Hat, you can easily install or remove software from your system with eitherthe redhat-config-packages tool or the rpm command. Alternatively, you can install softwareby downloading and compiling its source code.

    Installing Packages with the rpm Command

    If you do not have access to the desktop or you prefer to work from the command line

    interface, you can use the rpm command to manage and install software packages. This is thecommand that performs installation, removal, and verification of software packages. Eachsoftware package is actually an RPM package, consisting of an archive of software files andinformation about how to install those files. Each archive resides as a single file with a namethat ends with .rpm, indicating it is a software package that can be installed by the Red HatPackage Manager. A set of commonly used options is shown here:

    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 uninstalledpackages)

  • 8/8/2019 Linux Trng Lsbpl

    25/37

    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.

    PERMISSIONS OF FILE /DIRECTORY

    First the permissions are displayed, followed by the number of links, the owner of the file,the name of the group the user belongs to, the file size in bytes, the date and time the file waslast modified, and the name of the file. Permissions indicate who can access the file: the user,members of a group, or all other users.

    The group name indicates the group permitted to access the file object. In fig, the file typefor mydata is that of an ordinary file. Only one link exists, indicating the file has no othernames and no other links. If you want to display this detailed information for all the files in adirectory, simply use the ls -l command without an argument.$ ls -l-rw-r--r-- 1 chris weather 207 Feb 20 11:55 mydata-rw-rw-r-- 1 chris weather 568 Feb 14 10:30 today-rw-rw-r-- 1 chris weather 308 Feb 17 12:40 monday

    ownergroupother.r w x : r w x : r w x

    File modes

    Read permission = rWrite permission = wExecute permission = x

    -rwrr- 1 chris weather 207 Feb20 11:55 mydata

    File type = -Permission = rw-r-r-

    Number of lines = 1Owner name = chrisGroup name = weatherSize of file in bytes = 207Date and Time last modified = Feb 20 , 11:55File name = mydata

  • 8/8/2019 Linux Trng Lsbpl

    26/37

    CHANGING FILE PERMISSIONS

    To change file access permission chmod command is used.$ chmod u+x India.shHere India.sh is granted execute permission.

    TOPOLOGY

    A Topology is basically a map of network. The physical topology of a network refers to theconfiguration of cables, computers and other peripherals.

    CLASSIFICATION OF TOPOLOGYTopology can be classified as :

    BUS

    STAR

    RING

    TREE

    BUS

    Bus topology consists of a one long cable whichact as a backbone to link all the devices inthe network.All nodes (file server,workstationsand peripherals) are reconnected to the linearcable. Ethernet and Local Talk network use alinear bus Topology.

    Fig: BUS TOPOLOGY

    STAR TOPOLOGY

    In Star Topology each device(file server,workstationand peripherals ) are connected directly to a central networkhub or concentrator.Data on a star network passes throughthe hub or concentrator before continuing to itsdestination.The hub or concentrator manages and controlsall functions of the network.

    Fig: STAR TOPOLOGY

    RING TOPOLOGY

    In ring topology each computer is connected directly to othercomputers in the network.Data moves down a one way pathfrom one computer to another.Token Ring protocol uses ring topology.

  • 8/8/2019 Linux Trng Lsbpl

    27/37

    Fig: RING TOPOLOGY

    PROTOCOLSA 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 overnetworks. They define issues such as error control and data compression methods. Theprotocol determines the following:

    Type of error checking to be used, data compression method (if any), how thesending device will indicate that it has finished a message and how the receiving device willindicate 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 networkdevice to another. There are several types of cable which are commonly used with LANs.Thefollowing 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

    Unshielded Twisted Pair (UTP) Cable:Twisted pair cabling comes in two varieties: shielded and

    unshielded. Unshielded twisted pair (UTP) is the most popular and isgenerally the best option for networks.

    Unshielded Twisted Pair Connector:The standard connector for unshielded twisted pair cabling is an RJ-45connector. This is a plastic connector that looks like a large telephone-style connector.

  • 8/8/2019 Linux Trng Lsbpl

    28/37

    DISADVANTAGE OF A TREE TOPOLOGY Overall length of each segment is limited by the type of cabling used.

    If the backbone line breaks, the entire segment goes down.

    More difficult to configure wire than other topologies.

    IP Addressing

    An IP (Internet Protocol) address is a unique identifier for a node or host connection on an IPnetwork. An IP address is a 32 bit binary number usually represented as 4 decimal values,each representing 8 bits, in the range 0 to 255 (known as octets) separated by decimal points.This is known as "dotted decimal" notation.

    Example: 140.179.220.200

    It is sometimes useful to view the values in their binary form.

    140 .179 .220 .20010001100.10110011.11011100.11001000

    Every IP address consists of two parts, one identifying the network and one identifying thenode. The Class of the address and the subnet mask determine which part belongs to thenetwork address and which part belongs to the node address.

    Address Classes

    There are 5 different address classes. You can determine which class any IP address is in byexamining 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 forinternal testing on a local machine; [You can test this: you should always be able to ping127.0.0.1, which points to yourself] Class D addresses are reserved for multicasting; Class Eaddresses 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 belongsto the network (N, inblue) 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

  • 8/8/2019 Linux Trng Lsbpl

    29/37

    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 itsNetwork 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 wantto share files between Red Hat Linux machines only, use NFS.

    Configuring a Samba Server :

    The default configuration file (/etc/samba/smb.conf) allows users to view their Red HatLinux home directories as a Samba share. It also shares any printers configured for the RedHat Linux system as Samba shared printers. In other words, you can attach a printer to yourRed Hat Linux system and print to it from the Windows machines on your network.

    Graphical Configuration :

    To configure Samba using a graphical interface, use the Samba Server ConfigurationTool.Samba Server Configuration Tool is a graphical interface for managing Samba shares,users, and basic server settings. It modifies the configuration files in the /etc/samba/

    directory. Any changes to these files not made using the application are preserved.

    To use this application, you must be running the X Window System, have root privileges,and have the redhat-config-samba RPM package installed. To start the Samba ServerConfiguration Tool from the desktop, go to the Main Menu Button (on the Panel) => SystemSettings => Server Settings => Samba Server or type the command redhat-config-samba at ashell prompt (for example, in an XTerm or a GNOME terminal).

  • 8/8/2019 Linux Trng Lsbpl

    30/37

    Fig: - Samba Server Configuration Tool

    Configuring Server Settings :

    The first step in configuring a Samba server is toconfigure the basic settings for the server and a fewsecurity options. After starting the application, selectPreferences => Server Settings from the pulldownmenu. The Basic tab is displayed as shown in

    Fig:-Configuring Basic Server Settings

    On the Basic tab, specify which workgroupthe computer should be in as well as a briefdescription of the computer. They correspond to theworkgroup and server string options in smb.conf.

    Fig: - Configuring Security Server Settings

    Managing Samba Users :The Samba Server Configuration Tool requires that an existing user account be active on theRed Hat Linux system acting as the Samba server before a Samba user can be added. TheSamba user is associated with the existingRed Hat Linux user account.

    To add a Samba user, select Preferences => SambaUsers from the pulldown menu, and click the AddUser button. On the Create New Samba User windowselect a Unix Username from the list of existing users

    on the local system.If the user has a different username on a Windowsmachine and will be logging into the Samba serverfrom the Windows machine, specify that Windows Fig:-Managing Samba Usersusername in the Windows Username field. TheAuthentication Mode on the Security tab of the Server

  • 8/8/2019 Linux Trng Lsbpl

    31/37

    Settings preferences must be set to User for this option to work.Also configure a SambaPassword for the Samba User and confirm the Samba Password by typing it again.

    DNS(Domain Name Server/Domain Name Service/Specification)

    Definitions of DNS :

    Domain Name Server (or system) An Internet service that translates domain namesinto IP addresses.

    (Domain Name System) The Domain Name System is the system that translatesInternet 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 thecorrect web site - in this case the site for Domain Bank. The network of computersthat constitute the Internet map domain names to their corresponding IP numbers. Thedata is then made available to all computers and users on the Internet.

    How Domain Name Servers Work:If you spend any time on the Internet sending e-mail or browsing the Web, then you

    use domain name servers without even realizing it. Domain name servers, or DNS, are an

    incredibly important but completely hidden part of the Internet, and they are fascinating! TheDNS system forms one of the largest and most active distributed databases on the planet.Without DNS, the Internet would shut down very quickly.

    The Basics :

    When you use the Web or send an e-mail message, you use a domain name to do it.For example, the URL "http://www.gmail.com" contains the domain name gmail.com. Sodoes the e-mail address "[email protected]."

    Human-readable names like "gmail.com" are easy for people to remember, but theydon't do machines any good. All of the machines use names called IP addresses to refer to

    one another. For example, the machine that humans refer to as "www.gmail.com" has the IPaddress 64.14.119.232. Every time you use a domain name, you use the Internet's domainname servers (DNS) to translate the human-readable domain name into the machine-readableIP address. During a day of browsing and e-mailing, you might access the domain nameservers hundreds of times!

    Domain name servers translate domain names to IP addresses. That sounds like a simpletask, and it would be -- except for five things:

  • 8/8/2019 Linux Trng Lsbpl

    32/37

    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 easilymake a hundred or more DNS requests a day, and there are hundreds of millions ofpeople 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 wouldall go nuts. Human beings just are not that good at remembering strings of numbers. We aregood 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-leveldomain 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 forevery 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

    microsoftEvery 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 completelydifferent 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 potentiallycontain millions of host names as long as they are all unique within that domain.Domain: Provides hierarchy property

    Domain + name = Domain Name

    http://www.gmail.com/http://www.yahoo.com/http://www.mit.edu/http://www.bbc.co.uk/ftp://ftp.microsoft.com/http://www.gmail.com/http://www.yahoo.com/http://www.mit.edu/http://www.bbc.co.uk/ftp://ftp.microsoft.com/
  • 8/8/2019 Linux Trng Lsbpl

    33/37

    There are 7 top level domains : -

    .com - For Commercial site

    .net - Network Soulution

    .edu - Educational site

    .org - Organisation

    .gov - Government

    .int - International

    .mil - Military

    Geographical Domain: - (Made for load balancing)

    .co.in - commercial site for India

    .co.uk - commercial site UK

    .co.us - commercial site for USA

    .co.ca - commercial site for Canada

    .co.au - commercial site for Australia

    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 ZoneIt resolve name into IP.

    2. Reverse Master ZoneIt resolve IP into Name.3. Slave Zone For creating subdomains.

    Fully Qualified Zone: www. Sites are fully qualified. For fully qualified sites, likeawww.yahoo.com, if we simply give yahoo it opens the site, or we write yahoo.com itopens 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.

    Yahoo.com

    .co.in .co.uk .co.ca .co.au .co.us

    -----

    These servers can be blocked for

    Security purpose

    http://www./http://www./
  • 8/8/2019 Linux Trng Lsbpl

    34/37

    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 startthe 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 anXTerm or GNOME Terminal).

    The general steps for configuring the Apache HTTP Server using the HTTP ConfigurationTool 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 virtualhosts.

    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 youcan set up for Sendmail;

  • 8/8/2019 Linux Trng Lsbpl

    35/37

  • 8/8/2019 Linux Trng Lsbpl

    36/37

    and an NFS client, which means that it can export file systems to other systems and mountfile systems exported from other machines.

    Why Use NFS?NFS is useful for sharing directories of files between multiple users on the same network.

    For example, a group of users working on the same project can have access to the files forthat project using a shared directory of the NFS file system (commonly known as an NFSshare) mounted in the directory /myproject. To access the shared files, the user goes intothe /myproject directory on his machine. There are no passwords to enter or specialcommands to remember. Users work as if the directory is on their local machines.Use the mount command to mount a shared NFS directory from another machine:

    mount shadowman.example.com:/misc/export /misc/local

    In this command, shadowman.example.com is the hostname of the NFS fileserver,

    /misc/export is the directory that shadowman is exporting, and /misc/local is the location tomount the file system on the local machine. After the mount command runs (and if the clienthas proper permissions from the shadowman.example.com NFS server) the client user canexecute the command ls /misc/local to display a listing of the files in /misc/export onshadowman.example.com.

    Exporting NFS File Systems :

    Sharing files from an NFS server is known as exporting the directories. The NFS Server

    Fig1:-NFS Server Configuration Tool

    Configuration Tool can be used to configure a system as an NFS server.To use the NFS Server Configuration Tool, you

    must be running the X Window System, haveroot privileges, and have the redhat-config-nfsRPM package installed. To start the application,select Main Menu Button (on the Panel) =>System Settings => Server Settings => NFSServer, or type the command redhat-config-nfs.

  • 8/8/2019 Linux Trng Lsbpl

    37/37

    To add an NFS share, click the Add button. The dialog box shown in Figure 2will appears.

    Fig 2:Add Share