LINUX ADMINISTRATION www.educlash.com
UNIT 2 CHAPTER-2 & 3 2 www.educlash.com
CHAPTER 2 : TCP/IP NETWORKING TCP/IP Explained TCP/IP is an acronym for Transmission Control Protocol/Internet Protocol It is able to send and receive information on the network, each device connected to it must have an address. Address consists of two parts the address of the network to which the device is connected the address of the device itself — its node or host address www.educlash.com
Understanding Network Classes All addresses must have two parts, the network part and the node, or host part NETWORK CLASSES AND THEIR IP NUMBER RANGE www.educlash.com
Setting Up a Network Interface Card (NIC) ifconfig command will be shown your current network interface configuration. Configuring the loopback address (lo) Add the device by using the ifconfig command ifconfig lo 127.0.0.1 You then need to use the route command to give the system a little more information about this interface route add -net 127.0.0.0 www.educlash.com
Configuring the network card ifconfig eth0 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 A file is created in /etc/sysconfig/network-scripts called ifcfg- eth0 Configuring an internal network To add additional computers to your network you need to repeat network device configuration on the other computers you want to add. Three files need to be modified. /etc/hosts.conf /etc/hosts /etc /resolv.conf /etc/hosts.conf file contains name Resolver Ipaddress hostnames /etc/resolv.conf. file provides nameservers employed to resolve host names Servername ipaddress 6
Understanding Subnetting A subnet is a logical grouping of connected network devices. Interpreting IP numbers IP numbers can have three possible meanings. 192.168.3.0 is a Class C network number 192.168.3.42 is a host address on this network 192.168.3.255 is the network broadcast address Classless InterDomain Routing (CIDR) CIDR was invented several years ago to keep the Internet from running out of IP addresses. The class system of allocating IP addresses can be very wasteful. Anyone who could reasonably show a need for more than 254 host addresses was given a Class B address block of 65,533 host addresses. 7 www.educlash.com
solution on scarcity of ipaddress on internet In 1992 as a scheme called supernetting. Was the solution on scarcity of ipaddress on internet Under CIDR, the subnet mask notation is reduced to simplified shorthand. Instead of spelling out the bits of the subnet mask the number of 1s bits that start the mask are simply listed 192.60.128.0, Subnet Mask 255.255.252.0 the network address is written simply as: 192.60.128.0/22 8 www.educlash.com
NETWORK INTERFACE CONFIGURATION NETWORK ROUTING CONFIGURATION Gateways and Routers This router that is connected to each network is called its gateway. All current Linux distributions have IP Forwarding compiled as a module, so all you need to do is make sure the module is loaded. cat /proc/sys/net.ipv4/ip_forwrd. 1 is returned it is enabled 0 is returned it is not enabled To enable IP forwarding echo ‚0‛ > /proc/sys/net/ipv4/ip_forward NETWORK INTERFACE CONFIGURATION Interface IP Address Netmask NETWORK ROUTING CONFIGURATION Destination Gateway Mask Interface www.educlash.com
Configuring Dynamic Host Configuration Protocol (DHCP) You can have an IP address and the other information automatically assigned to the hosts connected to your network. By using DHCP, you can ensure that every host on your network has a valid IP address, subnet mask, broadcast address, and gateway, with minimum effort on your part. You should have a DHCP server configured for each of your subnets. Each host on the subnet needs to be configured as a DHCP client. www.educlash.com
Setting up the server file dhcp-2.0pl5-1.i386.rpm rpm command from a command prompt to install it. DHCP server is controlled by the text file /etc/dhcpd.conf. start it by running the command dhcpcd. Each of your clients will now receive its IP address, subnet mask, gateway, and broadcast address from your dhcp server. place it in the /etc/rc.local file. Now whenever the system starts, this daemon will be loaded. www.educlash.com
CHAPTER 3 : THE NETWORK FILE SYSTEM NFS, the Network File System, is the most common method for providing file sharing services on Linux and Unix networks. Understanding NFS NFS uses a standard client/server architecture The server portion consists of the physical disks containing shared file systems It is visible to and available for use by client systems on the network www.educlash.com
www.educlash.com
NFS advantages NFS disadvantages NFS provides is centralized administration It is much easier Easy to back up a file system stored on a server NFS disadvantages Poor performance and security NFS is sensitive to network congestion constantly being probed and attacked running slowly because disk reads and writes take longer www.educlash.com
Server side configuration Configuring an NFS Server Configuring an NFS Server And client Server side configuration Server side configuration Edit /etc/exports file 1. /home/redhat 192.168.1.0/255.255.255.0(rw) 2. Service nfs restart Client side configuration Mount –t nfs siddhesh:/home/redhat/ /root/Desktop/sharingTest Cd /root/Desktop/sharingTest www.educlash.com
Nfs files rpcinfo’s output shows the RPC program‘s details exportfs command enables you to manipulate the list of available exports. showmount command queries the mount daemon, mountd, about the status of the NFS server rpcinfo -p to make sure the necessary daemons are running nfsstat command which prints the kernel‘s NFS statistics 16 www.educlash.com
THANK YOU 17 www.educlash.com