1 linux basics for networking. 2 module - linux basics for networking ♦ overview this module...

18
1 Linux Basics for Networking

Upload: audra-lamb

Post on 30-Jan-2016

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

1

Linux Basics for Networking

Page 2: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

2

Linux Basics for Networking

Module - Linux Basics for Networking

♦ OverviewThis module focuses on the basics of networking using Redhat Enterprise Linux. It introduces the various services available and their management and procedures for starting and stopping systems and services.

♦ Lessons covered in this module► Starting and Stopping Systems ► Managing Services ► Configuring Systems for Networking

Page 3: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

3

Linux Basics for Networking

Lesson 1 - Starting and Stopping Systems

♦ IntroductionUnderstanding the process involved in starting and stopping systems helps to a great extent in configuring Linux Network as per user and organization needs.

♦ Topics covered in this lesson► Introduction to Services ► System Startup Overview (Runlevels) ► Service Startup and Shutdown Scripts ► Starting and Stopping Services

Page 4: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

4

Linux Basics for Networking

Topic 1 – Introduction to Services

♦ To configure Linux network the following should be considered: Services required for the network, machines running on OS other than Linux, shared devices like printers, scanners, cable modem etc and the security measures required.

♦ These services are common in Linux Networks: apache-Web server, sshd-SSH server, qmail-mail server, postfix-mail server, boa—lightweight Web server, named-DNS server, xfs-X font server, xdm—X display manger, squid-Web proxy server.

Page 5: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

5

Linux Basics for Networking Topic 2 – System Startup Overview (Runlevels)

♦ After booting the OS loads programs in the configured order, which can be changed. As soon as Basic Input Outout System (BIOS) finds the Master Boot Record (MBR) the control is taken over by the GRand Unified Boot (GRUB) loader, a program to load the Linux OS.

♦ Red Hat has seven runlevels. Each of these has a set of processes, which will be started on entering that runlevel. The default is runlevel 5.

Page 6: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

6

Linux Basics for Networking Topic 3 - Service Startup and Shutdown Scripts

♦ /etc/rc.d has additional directories rc0.d, rc1.d, rc2.d, rc3.d, rc4.d, rc5.d and rc6.d. The number in the directory name indicates the runlevel required. These directories contain scripts for service start up shutdown scripts for the indicated runlevel.

♦ The scripts in these directories are symbolic links to the actual service startup and shutdown scripts located in /etc/rc.d/init.d/ directory.

Page 7: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

7

Linux Basics for Networking

Topic 4 - Starting and Stopping Services

♦ To start up the service use service <service name> start .

♦ To stop the service use service <service name > stop .

♦ gettys provides six terminals you can use to login.

♦ /etc/rc.d/rc.local contains calls to run any script .

Page 8: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

8

Linux Basics for Networking

Lesson 2 – Managing Services

♦ IntroductionRed Hat Linux provides many services run by different scripts.Their management involves configuring and adding new services and providing default services to suite a variety of user needs.

♦ Topics covered in this lesson

► Adding a Custom Service ► Use of chkconfig ► The Xinetd Services

Page 9: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

9

Linux Basics for Networking

Topic 1 - Adding a Custom Service

♦ Run levels 2 and 4 are intended for user to configure them as required. With this you can make your own custom services for testing and other purposes. Services configured in /etc/inittab and typically non-TCP/IP can be changed by activating init q.

♦ The name of the script and the daemons it starts may sometimes be similar. The changes made this way to invoke service scripts will not remain when the system is booted. To retain these changes across reboots the S or K symbolic links in /etc/rc.d/rc(2-4).d/ must be changed.

Page 10: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

10

Linux Basics for Networking

Topic 2 - Use of chkconfig

♦ chkconfig tool helps you to manage services in rc scripts and configuration file. The change is retained across reboots. chkconfig –list command lists all the services and their status in each runlevel.

♦ chkconfig <service name> on or off enables or disables the services in runlevels 2,3,4 and 5.

♦ chkconfig<service name> - add sets up a S or K link for the service in every level.

♦ chkconfig<service name> - del removes the service from chkconfig management.

♦ Run chkconfig - List again to ensure that all the changes have been set as desired. They will take effect on next system reboot.

Page 11: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

11

Linux Basics for Networking

Topic 3 - The Xinetd Services

♦ This xinetd daemon provides host-based authentication, resource logging, timed access and address redirection in its configuration options. The default configuration of xinetd is the configuration file /etc/xinetd.conf and service specific files under the /etc/xinetd.d directory.

♦ To enable or disable the xinetd services those files must be opened in /etc/xinetd.d directory. The following are some of the xinetd services : echo, time, swat, gasftp, finger, kshell, daytimeudp and rsh .

Page 12: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

12

Linux Basics for Networking Lesson 3 - Configuring Systems for Networking

♦ IntroductionThere are many configuration and analysis tools in Red Hat Linux. They help to configure networking parameters in Linux systems. Sometimes they may have to be configured manually.

♦ Topics covered in this lesson► Configuring IP ► Assigning Host Name ► /etc/hosts File ► IP Multiplexing

Page 13: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

13

Linux Basics for Networking

Topic 1 - Configuring IP

♦ These are the tools for configuring IP : netconfig, ifconfig, /etc/sysconfig/network, /etc/resolv.conf, /etc/host.conf, /etc/hosts, /etc/networks and /etc/sysconfig/network-scripts/ifcfg-ethx.

♦ These are the analysis tools : netstat, netstat -rn or route -n traceroute, nslookup, arp, tcpdump and dig.

Page 14: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

14

Linux Basics for Networking

Topic 2 - Assigning Host Name

♦ The /etc/inittab file contains the entry si::sysinit:/etc/rc.d/rc.sysinit which causes the system at startup to run the rc.sysinit script. The rc.sysinit file expects to find the file /etc/sysconfig/network if networking is to be enabled.

♦ The network file with the host name should read like this:► NETWORKING=yes► FORWARD_IPV4=false► HOSTNAME= myhost.mycompany.com► DOMAINNAME= mycompany.com► GATEWAY=192.168.1.1► GATEWAYDEV=eth0

Page 15: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

15

Linux Basics for Networking

Topic 3 - /etc/hosts File

♦ The /etc/hosts defines local hosts. For example

127.0.0.1 localhost.localdomain localhost

192.168.1.10 myhost.mycompany.com myhost► /etc/services - Internet network services list .► /etc/protocols - contains line entries with protocol name and the number.► /etc/named.conf - used for domain name service to configure named ► /etc/resolv.conf – used for address resolution► /etc/host.conf - Specifies the order for resolution

Page 16: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

16

Linux Basics for Networking

Topic 4 - IP Multiplexing

♦ IP Multiplexing is the adaptation of a successful LAN concept to WAN. In IP Multiplexing LAN packets are forwarded to a WAN logical link through a Proxy ARP process. Then a unique MAC address is mapped to each WAN bundle.

♦ IP addressing is configured to spoof a router to think that the receiver, also a router, is on the same LAN. When the local router sends an ARP request for the receiver, the IP Multiplexing device responds with the MAC address of the WAN connecting to the receiver.

♦ The local router sends that MAC address to all packets for the receiver and they are forwarded to the appropriate WAN devices.

Page 17: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

17

Linux Basics for Networking

Lab Exercises

♦ Disabling firewall.♦ Adding a service.♦ Using a service.

Page 18: 1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise

18

Linux Basics for Networking

Conclusion

♦ Summary► BIOS starts the system and loads GRUB to select the Kernel and then

loads OS. The OS loads the files and runs the scripts in an order. System shuts down also in an order. Five Runlevels suite different uses.

► Chkconfig helps to manage services in rc scripts and configuration files. The xinetd monitors the ports for all services and manages network resources. /etc/hosts contains local hosts. Protocol details, domain name configuration, search order etc. are in other /etc/ files. A LAN connecting with a WAN logical link through a Proxy ARP is IP Multiplexing

♦ Question and Answer Session