Linux Solution A Dissertation Submitted in fulfillment of Industrial Training Program On LINUX NETWORKING June-July 2010 Submitted Guided By: Mr. Sanjay Gupta By: Sushil Verma 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. 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 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. 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  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 o o o o Samba Server DNS Apache Web Server 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. 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 are LAN computers more than a mile apart. WIDE AREA NETWORK Wide area network (WANs) connects larger geographic areas, such as Florida, United States, 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 are available at considerable savings when compared to buying individually licensed copies. 3. Security: Files and programs on a network can be designated as “copy inhibit”, so that you do not have to worry about illegal coping of programs. Also, password can be established for specific directories to restrict access to authorized users. 4. Centralized software management: One of the greatest benefits of installing a network at a school is the fact that all of the software can be loaded on one computer (the file server).This eliminates that need to spend time and energy installing updates and tracking files on independent computers throughout the building. 5. Resources Sharing: Sharing resources is another area in which a network exceeds stand-alone computers. 6. Electronic mail: The presence of a network provides the hardware necessary to install an e-mail system. 7. Flexible access: Networking allows users to access their files from throughout the network. Disadvantages of a Network : 1. Expensive to install: Although a network will generally save money over time, the initial costs of installation can be prohibitive. 2. Requires administrative time: Proper maintenance of a network requires considerable time and expertise. 3. File server may fail: Although a file server is no more susceptible to failure than any other computer, when the files server “goes down”, the entire network may come to a halt. 4. Cables may break: Some of the configurations are designed to minimize the inconvenience of a broken cable; with other configurations, one broken cable can stop the entire 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. 1. Networking with TCP/IP and other protocols. 2. 3. 4. 5. 6. Multiple user capability. Protected mode so programs or user's can't access unauthorized areas. Shared libraries True multitasking X - A graphical user interface similar to windows, but supports remote sessions over a network. 7. Advanced server functionality o DHCP server o Samba server o DNS server o 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 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.) 2.) 3.) 4.) / /boot swap /xyz Root Partition Boot or Debug partition Virtual Memory Addition partition (Optional) Minimum Required partitions. In Linux all install file are installed in ‘/’ partition, it has 14 file directories. This is called ‘Root File System’. Steps to Install Linux Operating System:  Insert RHE4 Disk-1 : To install Red Hat Linux from a CD-ROM, choose the CDROM 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 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). Creating special characters with multiple keystrokes is done using "dead keys" (also known as compose key sequences). Dead keys are enabled by default. If you do not wish to use them, select Disable dead keys. To test your keyboard configuration, use the blank text field at the bottom of the screen to enter text. Once you have made the appropriate selections, click Next to continue.  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.  Choosing to Upgrade or Install : The Upgrade Examine screen appears automatically if the installation program detects a prior version of Red Hat Linux on your system. If you would like to perform an upgrade, select Perform an upgrade of an existing installation. 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 choose the installation type that best fits your needs. Your options are Workstation, Server, Laptop, Custom, and Upgrade.  Disk Partitioning to 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 : Red Hat Linux offers firewall protection for enhanced system security. firewall exists between your computer and the network, and determines which resources on your computer remote users on the network can access. A properly configured firewall can greatly increase the security of your system.  A Language support Selection : Red Hat Linux can install and support multiple languages for use on your system. You must select a language to use as the default language. The default language will be used on your Red Hat Linux system once installation is complete. If you choose to install other languages, you can change your default language after the installation.  Time Zone Configuration : You can set your time zone by selecting your computer'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 a specific city, which is marked by a yellow dot; a red X will appear indicating your selection. You can also scroll through a list and choose a time zone.  Setting the root password : Setting up a root account and password is one of the most important steps during your installation. Your root account is similar to the administrator account used on Windows NT machines. The root account is used to install packages, upgrade RPMs, and perform most system maintenance. Logging in as root gives you complete control over your system.  Package Group Selection : After your partitions have been selected and configured for formatting, you are ready to select packages for installation. GNOME and KDE are both graphical desktop environments that handle the overall look and feel of your system. You must choose one of these to have a default graphical setup, but you can also install both to determine for yourself which you prefer. You can select components, which group packages together according to function (for example, C Development, Networked Workstation, or Web Server), individual packages, or a combination of the two. To select a component, click on the checkbox beside it.  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  Boot Disk Creation : If you chose to create a boot disk, you should now insert a blank, formatted diskette into your diskette drive. It is highly recommended that you create a boot disk. your system were not able boot properly using GRUB LILO, or a third-party boot loader, a boot disk would enable you to properly boot your Red Hat Linux system.  Video Card If to or Configuration : The installation program will now present a list of video cards for you to choose from. If you decided to install the X Window System packages, you now have the opportunity to configure an X server for your system. If you did not choose to install the X Window System packages, skip ahead to Preparing to Install.  XConfiguration — Monitor and Customization Dfgdf : In order to complete X configuration, you must configure your monitor and customize your X settings.  Configuring Your Monitor : The installation program will present you with a list of monitors to select from. From this list, you can either use the monitor that is automatically detected for you, or choose another monitor. If your monitor does not appear on the list, select the most appropriate Generic model available. If you select a Generic monitor, the installation program will suggest horizontal and vertical sync ranges. These values are generally available in the documentation which accompanies your monitor, or from your monitor's vendor or manufacturer; please check your 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 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. – File and subdirectory contents – Gives Linux software developers ability to locate files on any Linux system • Create non-distribution–specific software / /bin /boot /lib /dev /mnt /etc /opt /home /proc /var /root /tmp /usr/local /usr Directory /bin /boot /dev /etc /home /lib /mnt /opt /proc /root /sbin /tmp /usr /usr/local /var Description Contains binary commands for use by all users Contains the Linux kernel and files used by the boot loader Contains device files Contains system-specific configuration files Is the default location for user home directories Contains shared program library (used by the commands in /bin and /sbin) as well as kernel modules Is the empty directory used for accessing (mounting) disks, such as floppy disks and CD_ROMs Stores additional software programs Stores additional software programs Is the root user’s home directory Contains system binary commands (used for administration) Holds temporary files created by programs 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 Is the location for most additional programs 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 LISTING, DISPLAYING & PRINTING FILES: Command /Option ls cat filenames Execution This command lists file and directory names. This filter can be used to display a file. It can take filenames for its arguments. It outputs the contents of those files directly to the standard output, which, by default, is directed to the screen. This utility displays a file screen by screen. Press the SPACEBAR to continue to the next screen and q to quit. This utility also displays a file screen by screen. Press the SPACEBAR to continue to the next screen and q to quit. Sends a file to the line printer to be printed; a list of files may be used as arguments. Use the -P option to specify a printer. Lists the print queue for printing jobs. Removes a printing job from the print queu more filenames less filenames lpr filenames lpq lprm DIRECTORY COMMANDS Command mkdir directory rmdir directory ls -F Execution Creates a directory. Erases a directory. Lists directory name with a preceding slash. Command ls -R cd directory name Execution Lists working directory as well as all subdirectories. Changes to the specified directory, making it the working directory. cd without a directory name changes back to the home directory: $ cd reports Displays the pathname of the working directory. 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 . 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 pwd directory name/filename .. . ~/pathname find COMMAND Command/Option find Execution Searches directories for files according to search criteria. This command has several options that specify the type of criteria and actions to be taken. Searches for files with the pattern in the name. Searches for files belonging to this group name. Searches for files with the size num in blocks. If c is added after num, the size in bytes (characters) is searched for. Searches for files last modified num days ago. Searches for files modified after the one matched by pattern. Outputs the result of the search to the standard output. The result is usually a list of filenames, including their full pathnames. Searches for files with the specified file type. File type can be -name pattern -group name -size numc -mtime num -newer pattern -print -type filetype 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 cp filename filename Execution 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 Copies a subdirectory from one directory to another. The copied directory includes all its own subdirectories: $ cp -r letters/thankyou oldletters 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 Moves directories. In this case, the first and last arguments are directories: $ mv letters/thankyou oldletters 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 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 cp -r dirname dirname mv filename filename mv dirname dirname ln filename filename rm filenames 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 Mount Options -f -v Table: The mount Command Description Fakes the mounting of a file system. Use it to check if a file system can be mounted. Verbose mode. mount displays descriptions of the actions it is taking. Use with -f to check for any problems mounting a file system, -fv. Mounts the file system with read/write permission. Mounts the file system with read-only permission. Mounts the file system without placing an entry for it in the mstab file. Specifies the type of file system to be mounted. Mounts all file systems listed in /etc/fstab. Mounts the file system using a list of options. This is a commaseparated list of options following -o. -w -r -n -t type -a -o option-list # 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 explicitly unmount the one already mounted. Say you have mounted a floppy disk, and now you want to take it out and put in a new one. You must unmount that floppy disk before you can put in and 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 was mounted. Here is the syntax: # umount device-or-mountpoint The following example unmounts the floppy disk wherever it is mounted: # umount /dev/fd0 Using the example where the device was mounted on the /mydir directory, you could use that directory to unmount the file system: # umount /mydir # mount /dev/hdc /mnt/cdrom # cd /mnt/cdrom # umount /mnt/cdrom umount: /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 on your Linux system. The device name for your floppy drive is fd0, and it is located in the directory /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, and so on. You can mount to any directory you want. Red Hat creates a convenient directory to use for floppy disks, /mnt/floppy. The following example mounts the floppy disk in your floppy drive to the /mnt/floppy directory: # mount /dev/fd0 /mnt/floppy # umount /dev/fd0 For the umount or mount operations, you can specify either the directory it is mounted on or the /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 to put another one in the drive. You first have to unmount it, detaching the file system from the overall directory tree. In fact, the CD-ROM drive remains locked until you unmount it. Once you unmount a CD-ROM, you can then take it out and put in another one, which you then must mount before you can access it. When changing several CD-ROMs or floppy disks, you are continually mounting and unmounting them. For a CD-ROM, instead of using the umount 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 name in the mount command. The following example mounts the disc in your CD-ROM drive to the /mydir directory. The particular device name for the CD-ROM in this example is /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/fstab file as described previously. The Linux hard disk partitions you created during installation are already automatically mounted for you. As noted previously, to mount a Linux hard disk partition, enter the mount command with the device name of the partition and the directory to which you want to mount it. IDE hard drives use the prefix hd, and SCSI hard drives use the prefix sd. The next example mounts the Linux hard disk partition on /dev/hda4 to the directory /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 either the redhat-config-packages tool or the rpm command. Alternatively, you can install software by 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 the command that performs installation, removal, and verification of software packages. Each software package is actually an RPM package, consisting of an archive of software files and information about how to install those files. Each archive resides as a single file with a name that ends with .rpm, indicating it is a software package that can be installed by the Red Hat Package Manager. A set of commonly used options is shown here: Option -U -i -e -qi -ql -qpi Action Updates package Installs package Removes package Displays information for an installed package Displays file list for installed package 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. 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 was last 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 type for mydata is that of an ordinary file. Only one link exists, indicating the file has no other names and no other links. If you want to display this detailed information for all the files in a directory, 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 ………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-rNumber 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 To change file access permission chmod command is used. $ chmod u+x India.sh Here India.sh is granted execute permission. TOPOLOGY A Topology is basically a map of network. The physical topology of a network refers to the configuration of cables, computers and other peripherals. 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. Fig: STAR TOPOLOGY 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 Unshielded Twisted Pair (UTP) Cable: Twisted pair cabling comes in two varieties: shielded and unshielded. Unshielded twisted pair (UTP) is the most popular and is generally the best option for networks. Unshielded Twisted Pair Connector: The standard connector for unshielded twisted pair cabling is an RJ-45 connector. This is a plastic connector that looks like a large telephonestyle connector. 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 IP network. 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 .200 10001100.10110011.11011100.11001000 Every IP address consists of two parts, one identifying the network and one identifying the node. The Class of the address and the subnet mask determine which part belongs to the network 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 by examining the first 4 bits of the IP address. 1. 2. 3. 4. 5. Class A addresses begin with 0xxx, or 1 to 126 decimal. Class B addresses begin with 10xx, or 128 to 191 decimal. Class C addresses begin with 110x, or 192 to 223 decimal. Class D addresses begin with 1110, or 224 to 239 decimal. 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. Configuring a Samba Server : The default configuration file (/etc/samba/smb.conf) allows users to view their Red Hat Linux home directories as a Samba share. It also shares any printers configured for the Red Hat Linux system as Samba shared printers. In other words, you can attach a printer to your Red 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 Configuration Tool.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 Server Configuration Tool from the desktop, go to the Main Menu Button (on the Panel) => System Settings => Server Settings => Samba Server or type the command redhat-config-samba at a shell prompt (for example, in an XTerm or a GNOME terminal). Fig: - Samba Server Configuration Tool Configuring Server Settings : The first step in configuring a Samba server is to configure the basic settings for the server and a few security options. After starting the application, select Preferences => Server Settings from the pulldown menu. The Basic tab is displayed as shown in Fig:-Configuring Basic Server Settings On the Basic tab, specify which workgroup the computer should be in as well as a brief description of the computer. They correspond to workgroup and server string options in smb.conf. the Fig: - Configuring Security Server Settings Managing Samba Users : The Samba Server Configuration Tool requires that an existing user account be active on the Red Hat Linux system acting as the Samba server before a Samba user can be added. The Samba user is associated with the existing Red Hat Linux user account. To add a Samba user, select Preferences => Samba Users from the pulldown menu, and click the Add User button. On the Create New Samba User window select a Unix Username from the list of existing users on the local system. If the user has a different username on a Windows machine and will be logging into the Samba server from the Windows machine, specify that Windows username in the Windows Username field. The Authentication Mode on the Security tab of the Server Fig:-Managing Samba Users Settings preferences must be set to User for this option to work.Also configure a Samba Password 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 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. 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! The DNS 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. So does the e-mail address "sushil@gmail.com." Human-readable names like "gmail.com" are easy for people to remember, but they don'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 IP address 64.14.119.232. Every time you use a domain name, you use the Internet's domain name servers (DNS) to translate the human-readable domain name into the machine-readable IP address. During a day of browsing and e-mailing, you might access the domain name servers hundreds of times! 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 humanreadable 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 www.yahoo.com www.mit.edu encarta.msn.com www.bbc.co.uk ftp.microsoft.com - a typical name - the world's best-known name - a popular EDU name - a Web server that does not start with www - a name using four parts rather than three - 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 .net .edu .org .gov .int .mil For Commercial site Network Soulution Educational site Organisation Government International Military Geographical Domain: - (Made for load balancing) .co.in .co.uk .co.us .co.ca .co.au commercial site for India commercial site UK commercial site for USA commercial site for Canada commercial site for Australia Yahoo.com .co.in .co.uk .co.ca .co.au .co.us ----- These servers can be blocked for Security purpose 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: 1. Central Mail Hub Relay, 2. Local or neighbor client and servers on different servers. These installation instructions assume Commands are Unix-compatible. [root@deep] /# cp sendmail.version.tar.gz /var/tmp [root@deep] /# cd /var/tmp [root@deep ]/tmp# tar xzpf sendmail.version.tar.gz # define CMDDIR "/usr/adm/sm.bin" NETWORK FILE SYSTEM Network File System (NFS) is a way to share files between machines on a network as if the files were located on the client's local hard drive. Red Hat Linux can be both an NFS server and an NFS client, which means that it can export file systems to other systems and mount file 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 for that project using a shared directory of the NFS file system (commonly known as an NFS share) mounted in the directory /myproject. To access the shared files, the user goes into the /myproject directory on his machine. There are no passwords to enter or special commands 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 to mount the file system on the local machine. After the mount command runs (and if the client has proper permissions from the shadowman.example.com NFS server) the client user can execute the command ls /misc/local to display a listing of the files in /misc/export on shadowman.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, have root privileges, and have the redhat-config-nfs RPM package installed. To start the application, select Main Menu Button (on the Panel) => System Settings => Server Settings => NFS Server, or type the command redhat-config-nfs. To add an NFS share, click the Add button. The dialog box shown in Figure 2will appears. Fig 2:Add Share
Sign up to vote on this title
UsefulNot useful