?? unx37.htm
字號:
<UL>
<LI>
<A HREF="#I101">NFS Mount Options</A></LI>
<LI>
<A HREF="#I102">Using the Cache File System</A></LI></UL></UL>
<LI>
<A HREF="#I103">Backing Up on a Network</A></LI>
<UL>
<UL>
<LI>
<A HREF="#I104">Using rdump/rrestore</A></LI>
<LI>
<A HREF="#I105">Using tar over a Network</A></LI>
<LI>
<A HREF="#I106">Using cpio over a Network</A></LI></UL></UL>
<LI>
<A HREF="#I107">Introduction to NIS</A></LI>
<UL>
<LI>
<A HREF="#I108">What Is NIS?</A></LI>
<LI>
<A HREF="#I109">The NIS Components</A></LI>
<UL>
<LI>
<A HREF="#I110">Database Administration Utilities</A></LI>
<LI>
<A HREF="#I111">NIS Daemons</A></LI>
<LI>
<A HREF="#I112">Database Distribution Utilities</A></LI>
<LI>
<A HREF="#I113">Database Lookup Utilities</A></LI></UL>
<LI>
<A HREF="#I114">DB Files</A></LI>
<LI>
<A HREF="#I115">What Files Does NIS Control?</A></LI></UL>
<LI>
<A HREF="#I116">Automounting File Systems</A></LI>
<UL>
<LI>
<A HREF="#I117">The Automounter Configuration File—/etc/auto.master</A></LI>
<LI>
<A HREF="#I118">Indirect Map Files</A></LI></UL>
<LI>
<A HREF="#I119">Analyzing and Troubleshooting Utilities</A></LI>
<UL>
<LI>
<A HREF="#I120">ifconfig</A></LI>
<LI>
<A HREF="#I121">netstat</A></LI>
<UL>
<LI>
<A HREF="#I122">netstat -i—Interfaces</A></LI>
<LI>
<A HREF="#I123">netstat -r—Routes</A></LI>
<LI>
<A HREF="#I124">netstat -a—Connections</A></LI>
<LI>
<A HREF="#I125">netstat -s—Statistics</A></LI></UL>
<LI>
<A HREF="#I126">nfsstat</A></LI>
<LI>
<A HREF="#I127">arp</A></LI>
<LI>
<A HREF="#I128">ping</A></LI>
<LI>
<A HREF="#I129">traceroute</A></LI>
<LI>
<A HREF="#I130">snoop</A></LI></UL>
<LI>
<A HREF="#I131">Summary</A></LI></UL></UL></UL>
<H1 ALIGN="CENTER">
<CENTER><A ID="I1" NAME="I1">
<BR>
<FONT SIZE=5><A ID="I2" NAME="I2"></A><B>37 — Networking</B>
<BR></FONT></A></CENTER></H1>
<H5 ALIGN="CENTER">
<CENTER><A ID="I3" NAME="I3">
<FONT SIZE=3><B>By Sydney S. Weinstein</B>
<BR></FONT></A></CENTER></H5>
<P>UNIX is a network operating system. It is tightly integrated with the TCP/IP networking protocols. Most of the original work on networking and UNIX was done at the University of California at Berkeley in the late 1970s and early 1980s. Thus, UNIX has a
well-developed and rich set of networking utilities available to both the user and the system administrator.
<BR></P>
<P>This chapter explains the basics of networking with TCP/IP and introduces you to how the network is administered. Then it goes into using the network, via the Network File System (NFS) and the Network Information Service (NIS). Because things don't
always go right, the last part of this chapter is on troubleshooting UNIX networks.
<BR></P>
<H3 ALIGN="CENTER">
<CENTER><A ID="I4" NAME="I4">
<FONT SIZE=4><B>TCP/IP Basics</B>
<BR></FONT></A></CENTER></H3>
<P>The primary protocol used by UNIX is the Internet Protocol, or IP. Often called TCP/IP, it actually is composed of several parts, including the following:
<BR></P>
<UL>
<LI><B>Internet Protocol (IP)</B> The underlying layer that provides the transfer of information from computer to computer.
<BR>
<BR></LI>
<LI><B>Transmission Control Protocol (TCP)</B> A protocol layer on top of IP that provides reliable connection-oriented communications between two processes. The TCP layer adds flow control, error detection and recovery, and connection services.
<BR>
<BR></LI>
<LI><B>User Datagram Protocol (UDP)</B> A protocol layer on top of IP that provides a low-overhead, unnumbered datagram protocol. It is connectionless and does not provide error checking or flow control.
<BR>
<BR></LI>
<LI><B>Serial Line IP (SLIP)</B> An adaptation of the normal EtherNet-based IP that runs over asynchronous serial lines. It is considered obsolete and has been replaced by PPP.
<BR>
<BR></LI>
<LI><B>Point to Point Protocol (PPP)</B> An adaptation of the normal EtherNet-based IP that runs over asynchronous and synchronous serial lines. It supports dial-up and dedicated circuits and compression to improve bandwidth utilization.
<BR>
<BR></LI>
<LI><B>Internet Control Message Protocol (ICMP)</B> A protocol layer on top of IP that provides control messages to control the IP protocol, such as Host or Network Unreachable, or "reroute this message." The most common use of it is for the ping
packet to see if a computer is alive.
<BR>
<BR></LI></UL>
<P>The basis of communications in IP is the packet. All communications over any medium IP supports are in integral units of packets. Packets are exchanged between nodes. Every node has an address. From the user's point of view, every IP node can
communicate with every other node in the network. However, underneath, the IP software may route the packet via many store and forward hops before the packet gets to the final destination.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I5" NAME="I5">
<FONT SIZE=3><B>Addressing</B>
<BR></FONT></A></CENTER></H4>
<P>IP addresses are 32-bit quantities. Every computer has one or more addresses assigned to it. Each network interface (EtherNet adapter, token ring, FDDI, serial line, and so on) has its own 32-bit address. With 32 bits there are 232 addresses available,
or a maximum of 4,294,967,296 network interfaces. However, to make routing (sending the packets for each address to the proper computer, or network node) easier, not all the addresses are used. Instead, the addressing space is broken up to make it easier
to route to networks of different sizes.
<BR></P>
<P>In IP each network is given a network number. Each computer on the network is given a node number within that network. Thus the address is split into two parts separated by a dot (network.node). Routing decisions are made on the network part. Reception
decisions within a network are made on the entire address.
<BR></P>
<P>For ease of reference, the addresses are not normally written as network.node, but as dotted quads, where each section refers to the value of 8 bits of the 32-bit address, as in this:
<BR></P>
<PRE>192.65.202.1</PRE>
<P>which is the address of our gateway host at MYXA Corporation.
<BR></P>
<H5 ALIGN="CENTER">
<CENTER><A ID="I6" NAME="I6">
<FONT SIZE=3><B>Class A, B, and C Addresses</B>
<BR></FONT></A></CENTER></H5>
<P>Networks come in different sizes. Really big organizations have thousands of locations and thousands of computers. Middle-sized organizations have hundreds of locations and thousands of computers. Small organizations are, well, small. To make it easy to
handle routing decisions, which are made on a network basis and not on the full address, the addressing space is split into several classes.
<BR></P>
<H6 ALIGN="CENTER">
<CENTER>
<FONT SIZE=3><B>Class A Addresses</B>
<BR></FONT></CENTER></H6>
<P>The 32 bits are split into 1 bit of 0, 7 bits of network number, and 24 bits of node number. (See Figure 37.1.) There could have been a maximum of 127 Class A addresses. However, net 0 is reserved, because at one time it was used as a global broadcast,
and net 127 is reserved to mean loop back, or stay within my own computer. This leaves 126 possible Class A addresses. Each Class A address can have 224—or 16,777,214—nodes (the addresses with all 0s and all 1s are reserved to mean
"broadcast to all nodes in this network"). In reality, the organization that uses a Class A address internally splits it up to route to their many internal networks, called subnets, and it really supports many fewer systems. Class A addresses are
very rarely handed out. An example of a Class A address is net 16, Digital Equipment Corporation.
<BR></P>
<P>
<BR><B><A HREF="37unx01.gif">Figure 37.1. A Class A network address layout.</A></B>
<BR></P>
<H6 ALIGN="CENTER">
<CENTER>
<FONT SIZE=3><B>Class B Addresses</B>
<BR></FONT></CENTER></H6>
<P>In a Class B address the 32 bits are split into 2 bits of 10, 14 bits of network number, and 16 bits of node number. (See Figure 37.2.) Allowing the address of 128 to equal a Class B broadcast, this leaves 16,383 Class B addresses with up to 65,534
nodes per network. Again, an address that is all 0s or all 1s is a broadcast address. Class B addresses, like Class A addresses, are normally split by their owners into many networks of fewer nodes per network. Even so, Class B addresses are running out
and are hard to obtain. Most major universities have one or more Class B addresses.
<BR></P>
<P>
<BR><B><A HREF="37unx02.gif">Figure 37.2. A Class B network address layout.</A></B>
<BR></P>
<H6 ALIGN="CENTER">
<CENTER>
<FONT SIZE=3><B>Class C Addresses</B>
<BR></FONT></CENTER></H6>
<P>In a Class C address the 32 bits are split into 3 bits of 110, 21 bits of network number, and 8 bits of node number. (See Figure 37.3.) This provides 2,097,150 Class C addresses, with up to 254 nodes per network. Again, an address that is all 0s or all
1s is a broadcast address. Class C addresses are often handed out in blocks of 4 or 8 to allow for more than 254 nodes in the same network. MYXA Corporation has several Class C networks and a block of 8 Class C's.
<BR></P>
<P>
<BR><B><A HREF="37unx03.gif">Figure 37.3. A Class C network address layout.</A></B>
<BR></P>
<HR ALIGN=CENTER>
<NOTE>
<IMG SRC="note.gif" WIDTH = 35 HEIGHT = 35><B>NOTE:</B> Notice that bit 2 of a Class C address has a forced 0 in the network portion of the address. There are Class D and Class E addresses, but those are labeled as experimental and are not in current use.
Class D addresses are now being considered for use as multicast addresses.
<BR></NOTE>
<HR ALIGN=CENTER>
<H5 ALIGN="CENTER">
<CENTER><A ID="I7" NAME="I7">
<FONT SIZE=3><B>Acquiring a Network Number</B>
<BR></FONT></A></CENTER></H5>
<P>Every network, whether connected to the Internet or not, should apply for a network number. If you are connected to the Internet, you will have to do this. Routing is based on the network number, and if you don't want your packets going to some other
network, you have to have a unique network number.
<BR></P>
<P>Even if your network is not connected to the Internet, you still should apply for the network number. It's a lot easier to set up your network now, with a unique network number, than to decide later that you want to connect to a public TCP/IP network,
such as the Internet, and have to reassign the network numbers and IP addresses for all your nodes. Besides, the network number is free—all it takes is a small amount of effort to get one. You simply need to fill in a network address request template
and send it in to the Network Information Center, known as NIC. (The CD-ROM for this book contains a complete copy of the application template in a file called NET-ADDR.TXT.)
<BR></P>
<P>Here is how to provide information for the nine items in the application found on the disk:
<BR></P>
<H6 ALIGN="CENTER">
<CENTER>
<FONT SIZE=3><B>Item 1</B>
<BR></FONT></CENTER></H6>
<P>If you are a connected network, you will get your network number from your Internet provider, who will file this form with the NIC on your behalf. Therefore, let the Internet provider answer this question (you can leave it blank).
<BR></P>
<P>If you are a nonconnected network, you don't need to answer it, so leave it blank.
<BR></P>
<H6 ALIGN="CENTER">
<CENTER>
<FONT SIZE=3><B>Item 2</B>
<BR></FONT></CENTER></H6>
<P>Who is the person responsible for this network number? This should be your network administrator or some such person. If this person has already filed information with the NIC, he or she will have a NIC handle. If not, don't worry. The first time you
send an application in, the NIC will assign you a net handle.
<BR></P>
<P>If you do not have an Internet-reachable electronic mail address, leave the Net Mailbox field blank.
<BR></P>
<H6 ALIGN="CENTER">
<CENTER>
<FONT SIZE=3><B>Item 3</B>
<BR></FONT></CENTER></H6>
<P>This shows how NIC will list this network in its database. Just make up some short name so you can recognize that it's yours.
<BR></P>
<H6 ALIGN="CENTER">
<CENTER>
<FONT SIZE=3><B>Item 4</B>
<BR></FONT></CENTER></H6>
<P>This is the name and address of the site of this network—usually it's your name and address.
<BR></P>
<H6 ALIGN="CENTER">
<CENTER>
<FONT SIZE=3><B>Item 5</B>
<BR></FONT></CENTER></H6>
<P>You can skip this question because the military's network known as MILNET uses its own forms and files them with the NIC.
<BR></P>
<H6 ALIGN="CENTER">
<CENTER>
<FONT SIZE=3><B>Items 6 and 7</B>
<BR></FONT></CENTER></H6>
<P>This is very important, because it determines what type of network number you get (and if you get a Class C number(s), it determines how many you get). The NIC expects the five year number to be a guess.
<BR></P>
<P>You will be assigned a Class C number unless your answer in Item 7 explicitly shows that because the number of networks and nodes you have that you really cannot fit into a set of Class C numbers and you require a Class B number. How you answer this
question, however, also indicates how many Class C numbers you can get. It helps to document your entire network and show how the net numbers will be used. Since address space is getting short, NIC is getting particular on how you answer this question.
<BR></P>
<H6 ALIGN="CENTER">
<CENTER>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -