Contained WithinFind More DocumentationFeatured Support Resources | PDF로 이 문서 다운로드 (1868 KB)
Chapter 6 TCP/IP AdministrationThis is the phase of network administration which involves setting up the network. This consists of assembling the hardware which makes up the physical part of the network, and configuring TCP/IP. This chapter explains how to configure TCP/IP, as well as how to troubleshoot TCP/IP after the network has been configured.
Before You Configure TCP/IP Task MapBefore configuring the TCP/IP software, you should have completed the tasks listed in the following table: Table 6-1 Before You Configure TCP/IP Task Map
Determining Host Configuration ModesOne of your key functions as a network administrator is configuring TCP/IP to run on hosts and routers (if applicable). You can set up these machines to obtain configuration information from two sources: files on the local machine or files located on other machines on the network. Configuration information includes:
A machine that obtains TCP/IP configuration information from local files is said to be operating in local files mode. A machine that obtains TCP/IP configuration information from a remote machine is said to be operating in network client mode. Machines That Should Run in Local Files ModeTo run in local files mode, a machine must have local copies of the TCP/IP configuration files. These files are described in "TCP/IP Configuration Files". The machine should have its own disk, though this is not strictly necessary. Most servers should run in local file mode. This requirement includes:
Additionally, routers should run in local files mode. Machines that exclusively function as print servers do not need to run in local files mode. Whether individual hosts should run in local files mode depends on the size of your network. If you are running a very small network, the amount of work involved in maintaining these files on individual hosts is manageable. If your network serves hundreds of hosts, the task becomes difficult, even with the network divided into a number of administrative subdomains. Thus, for large networks, using local files mode is usually less efficient. On the other hand, because routers and servers must be self-sufficient, they should be configured in local files mode. Network Configuration ServersNetwork configuration servers are the machines that supply the TCP/IP configuration information to hosts configured in network client mode. These servers support three booting protocols:
Network configuration servers can also function as NFS file servers. If you are going to configure any hosts as network clients, then you must also configure at least one machine on your network as a network configuration server. If your network is subnetted, then you must have at least one network configuration server for each subnet with network clients. Machines That Are Network ClientsAny host that gets its configuration information from a network configuration server is said to be "operating" in network client mode. Machines configured as network clients do not require local copies of the TCP/IP configuration files. Network client mode simplifies administration of large networks. It minimizes the number of configuration tasks that must be performed on individual hosts and assures that all machines on the network adhere to the same configuration standards. You can configure network client mode on all types of computers, from fully standalone systems to dataless machines. Although it is possible to configure routers and servers in network client mode, local files mode is a better choice for these machines. Routers and servers should be as self-sufficient as possible. Mixed ConfigurationsBecause of the flexibility of the system, configurations are not limited to either an all-local-hosts mode or an all-network-client mode. The configuration of routers and servers typifies this, in that routers and servers should always be configured in local mode. For hosts, you can use any combination of local and network client mode you want. Sample NetworkThe figure below shows the hosts of a fictional network with the network number 192.9.200. The network includes one network configuration server, the machine sahara. Machines tenere and nubian have their own disks and run in local files mode. Machine faiyum also has a disk but operates in network client mode. Finally, the machine timbuktu is configured as a router. It includes two network interfaces, one named timbuktu on network 192.9.200 and one named timbuktu-201 on network 192.9.201. Both networks are in the organizational domain deserts.worldwide.com. The domain uses local files as its name service. Most examples in this chapter use the network shown in the following figure as their basis. Figure 6-1 Hosts in a Sample Network
Adding a Subnet to a Network Task MapIf you are changing from a network that does not use subnets to one that is subnetted, perform the the tasks in the following table: Table 6-2 Adding a Subnet to a Network Task Map
Network Configuration ProceduresNetwork software installation takes place along with the installation of the operating system software. At that time, certain IP configuration parameters must be stored in appropriate files so they can be read at boot time. The procedure is a matter of creating or editing the network configuration files. How configuration information is made available to a machine's kernel depends on whether these files are stored locally (local files mode) or acquired from the network configuration server (network client mode). Parameters supplied during network configuration are:
This chapter contains information on creating and editing local configuration files. See the Solaris Naming Administration Guide for information on working with name service databases. Network Configuration Task MapTable 6-3 Network Configuration Task Map
How to Configure a Host for Local Files ModeUse this procedure for configuring TCP/IP on a machine that runs in local files mode.
How to Set Up a Network Configuration Server
Information for setting up install servers and boot servers can be found in Solaris Advanced Installation Guide. Configuring Network ClientsNetwork clients receive their configuration information from network configuration servers. Therefore, before you configure a host as a network client you must ensure that at least one network configuration server is set up for the network. How to Configure Hosts for Network Client ModeDo the following on each host to be configured in network client mode:
How to Specify a Router for the Network Client
Creating /etc/defaultrouter and leaving it empty causes one of the two dynamic routing protocols to run: ICMP Router Discovery protocol (RDISC), or Routing Information Protocol (RIP). The system first runs the program in.rdisc, which looks for routers that are running the router discovery protocol. If it finds one such router, in.rdisc continues to run and keeps track of the routers that are running the RDISC protocol. If the system discovers that routers are not responding to the RDISC protocol, it uses RIP and runs the daemon in.routed to keep track of them. Configuring Standard TCP/IP ServicesServices such as telnet, ftp, and rlogin are started by the inetd daemon, which runs automatically at boot time. Like the name service ordering specified in nsswitch.conf, you can configure TCP/IP services in the file /etc/inetd.conf by using the inetd -t flag. For example, you can use inetd to log the IP addresses of all incoming TCP connections (remote logins and telnet) as shown in the following procedure. How to Log the IP Addresses of All Incoming TCP Connections
See Solaris Naming Administration Guide and Solaris Naming Setup and Configuration Guide for further information on name services. Configuring RoutersTCP/IP's first requirement for a router is that the machine must have at least two network interfaces installed, as introduced in "Network Interfaces". As long as one of the network interfaces is not disabled, the router automatically "talks" to the RDISC and RIP protocols. These protocols keep track of routers on the network and advertise the router to the hosts on the network. After the router is physically installed on the network, configure it to operate in local files mode, as described in "How to Configure a Host for Local Files Mode". This ensures that routers will boot in case the network configuration server is down. Remember that, unlike a host, a router has at least two interfaces to configure. Configuring Routers Task MapTable 6-4 Configuring Routers Task Map
Configuring Both Router Network InterfacesBecause a router provides the interface between two or more networks, you must assign a unique name and IP address to each of the router's network interface cards. Thus, each router has a host name and IP address associated with its primary network interface, plus at least one more unique name and IP address for each additional network interface. How to Configure a Machine as a Router
The startup script determines whether to start up a routing protocol (RIP or RDISC) on the machine or use static routing. How to Select Static Routing on a Host That Is a Nework Client
(See "/etc/defaultrouter File".) A single static default route is then installed in the routing table. Under this condition, the host does not run any dynamic routing protocol (such as RIP and RDISC). How to Select Dynamic Routing on a Host That Is a Nework Client
The type of dynamic routing used is selected according to the following criteria:
How to Force a Machine to Be a RouterYou can force a machine that has only one /etc/hostname.interface file (by default a host) to be a router. This is important if you decide to configure PPP links, as explained in "Routing Considerations". Creating a Multihomed HostBy default, TCP/IP considers any machine with multiple network interfaces to be a router. However, you can change a router into a multihomed host--a machine with more than one network interface that does not run routing protocols or forward IP packets. You typically configure the following types of machines as multihomed hosts:
Since TCP/IP considers any machine with multiple network interfaces to be a router, you need to perform a few operations to turn it into a multihomed host. How to Create a Multihomed Host
When the machine reboots, the startup script looks for the presence of the /etc/notrouter file. If the file exists, the startup script does not run in.routed -s or in.rdisc -r, and does not turn on IP forwarding on all interfaces configured "up" by ifconfig. This happens regardless of whether an /etc/gateways file exists. Thus the machine is now a multihomed host. Turning On Space-Saving ModeSpace-saving mode provides the host with a table that contains only the default routes. On a host, in.routed runs with space saving mode turned off by default. If you do not want the host to have a full routing table (which provides increased protection against misconfigured routers), turn space saving mode on. How to Turn On Space-Saving Mode
Turning Off ICMP Router DiscoveryFor reasons involving router reliability, you might not want your hosts to use RDISC. If the automatic selection of RIP rather than RDISC by a host is to work reliably, the routers in the network (particularly those running RDISC) must also work reliably. If your routers are not running RDISC and you install a single Solaris router, by default all hosts connected to that router rely on it alone. To have the hosts on that network use the other routers as well, turn off RDISC on the new router. Turning Off ICMP Router Discovery Task MapTable 6-5 Turning Off ICMP Router Discovery Task Map
How to Turn Off ICMP Router Discovery on the Host
How to Turn Off ICMP Router Discovery on the Router
General Troubleshooting TipsOne of the first signs of trouble on the network is a loss of communications by one or more hosts. If a host refuses to come up at all the first time it is added to the network, the problem might lie in one of the configuration files, or in the network interface. If a single host suddenly develops a problem, the network interface might be the cause. If the hosts on a network can communicate with each other but not with other networks, the problem could lie with the router, or it could lie in another network. You can use the ifconfig program to obtain information on network interfaces and netstat to display routing tables and protocol statistics. Third-party network diagnostic programs provide a number of troubleshooting utilities. Refer to third-party documentation for information. Less obvious are the causes of problems that degrade performance on the network. For example, you can use tools like ping to quantify problems like the loss of packets by a host. Running Software ChecksIf the network has trouble, some actions that you can take to diagnose and fix software-related problems include:
Here is an example of output displayed if the inetd daemon is running:
ping CommandUse the ping command to find out whether there is IP connectivity to a particular host. The basic syntax is: /usr/sbin/ping host [timeout] where host is the host name of the machine in question. The optional timeout argument indicates the time in seconds for ping to keep trying to reach the machine--20 seconds by default. The ping(1M) man page describes additional syntaxes and options. When you run ping, the ICMP protocol sends a datagram to the host you specify, asking for a response. (ICMP is the protocol responsible for error handling on a TCP/IP network. See "ICMP Protocol" for details.) ping Command Task MapTable 6-6 ping Command Task Map
How to Determine if a Host Is RunningOn the command line, type the following command.
If host hostname is up, this message is displayed:
This indicates that hostname responded to the ICMP request. However, if hostname is down or cannot receive the ICMP packets, you receive the following response from ping:
How to Determine if a Host Is Losing PacketsIf you suspect that a machine might be losing packets even though it is running, you can use the s option of ping to try to detect the problem. On the command line, type the following command.
ping continually sends packets to hostname until you send an interrupt character or a timeout occurs. The responses on your screen will resemble:
The packet-loss statistic indicates whether the host has dropped packets. If ping fails, check the status of the network reported by ifconfig and netstat, as described in "ifconfig Command" and "netstat Command". ifconfig CommandThe ifconfig command displays information about the configuration of an interface that you specify. (Refer to the ifconfig(1M) man page for details.) The syntax of ifconfig is: ifconfig interface-name [protocol_family] ifconfig Command Task MapTable 6-7 ifconfig Command Task Map
How to Get Information About a Specific InterfaceFor an le0 interface, your output resembles the following:
The flags section just given shows that the interface is configured "up," capable of broadcasting, and not using "trailer" link level encapsulation. The mtu field tells you that this interface has a maximum transfer size of 1500 octets. Information on the second line includes the IP address of the host you are using, the netmask being currently used, and the IP broadcast address of the interface. The third line gives the machine address (Ethernet, in this case) of the host. How to Get Information About All Interfaces on a NetworkA useful ifconfig option is -a, which provides information on all interfaces on your network.
Output that indicates an interface is not running might mean a problem with that interface. In this case, see the ifconfig(1M) man page. netstat CommandThe netstat command generates displays that show network status and protocol statistics. You can display the status of TCP and UDP endpoints in table format, routing table information, and interface information. netstat displays various types of network data depending on the command line option selected. These displays are the most useful for system administration. The syntax for this form is: netstat [-m] [-n] [-s] [-i | -r] [-f address_family] The most frequently used options for determining network status are: s, r, and i. See the netstat(1M) man page for a description of the options. netstat Command Task MapTable 6-8 netstat Command Task Map
How to Display Statistics by ProtocolThe netstat -s option displays per protocol statistics for the UDP, TCP, ICMP, and IP protocols. On the command line, type the following command.
The result resembles the display shown in the example below. (Parts of the output have been truncated.) The information can indicate areas where a protocol is having problems. For example, statistical information from ICMP can indicate where this protocol has found errors.
How to Display Network Interface StatusThe i option of netstat shows the state of the network interfaces that are configured with the machine where you ran the command. On the command line, type the following command:
Here is a sample display produced by netstat -i:
Using this display, you can find out how many packets a machine thinks it has transmitted and received on each network. For example, the input packet count (Ipkts) displayed for a server can increase each time a client tries to boot, while the output packet count (Opkts) remains steady. This suggests that the server is seeing the boot request packets from the client, but does not realize it is supposed to respond to them. This might be caused by an incorrect address in the hosts, ipnodes, or ethers database. On the other hand, if the input packet count is steady over time, it means that the machine does not see the packets at all. This suggests a different type of failure, possibly a hardware problem. How to Display Routing Table StatusThe -r option of netstat displays the IP routing table. On the command line, type the following command.
Here is a sample display produced by netstat -r run on machine tenere:
The first column shows the destination network, the second the router through which packets are forwarded. The U flag indicates that the route is up; the G flag indicates that the route is to a gateway. The H flag indicates that the destination is a fully qualified host address, rather than a network. The Refcnt column shows the number of active uses per route, and the Use column shows the number of packets sent per route. Finally, the Interface column shows the network interface that the route uses. Logging Network ProblemsIf you suspect a routing daemon malfunction, you can log its actions, including all packet transfers when you start up the routed daemon. How to Log Network Problems
On a busy network, this can generate almost continuous output. Displaying Packet ContentsYou can use snoop to capture network packets and display their contents. Packets can be displayed as soon as they are received, or saved to a file. When snoop writes to an intermediate file, packet loss under busy trace conditions is unlikely. snoop itself is then used to interpret the file. For information about using the snoop command, refer to the snoop(1M) man page. The snoop command must be run by root (#) to capture packets to and from the default interface in promiscuous mode. In summary form, only the data pertaining to the highest-level protocol is displayed. For example, an NFS packet only displays NFS information. The underlying RPC, UDP, IP, and Ethernet frame information is suppressed but can be displayed if either of the verbose options is chosen. The snoop capture file format is described in RFC 1761. To access, use your favorite web browser with the URL: http://ds.internic.net/rfc/rfc1761.txt. snoop server client rpc rstatd collects all RPC traffic between a client and server, and filters it for rstatd. Displaying Packet Contents Task MapTable 6-9 Displaying Packet Contents Task Map
How to Check All Packets from Your System
How to Capture snoop Results to a File
How to Check Packets Between Server and Client
Use snoop frequently and consistently to get a feel for normal system behavior. For assistance in analyzing packets, look for recent white papers and RFCs, and seek the advice of an expert in a particular area, such as NFS or YP. For details on using snoop and its options, refer to the snoop(1M) man page. Displaying Routing InformationUse the traceroute utility to trace the route an IP packet follows to some internet host. The traceroute utility utilizes the IP protocol (time to live) ttl field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path, and the response PORT_UNREACHABLE (or ECHO_REPLY) from the destination host. The traceroute utility starts sending probes with a ttl of one and increases by one until it gets to the intended host or has passed through a maximum number of intermediate hosts. The traceroute utility is especially useful for determining routing misconfiguration and routing path failures. If a particular host is unreachable, you can use the traceroute utility to see what path the packet follows to the intended host and where possible failures might occur. The traceroute utility also displays the round trip time for each gateway along the path to the target host. This information can be useful for analyzing where traffic is slow between the two hosts. How to Run the Traceroute UtilityOn the command line, type the following command.
For details of the traceroute utility see the traceroute(1M) man page. Example--traceroute UtilityThe following sample of the traceroute command shows the 7-hop path a packet follows from the host istanbul to the host sanfrancisco along with the times for a packet to traverse each hop.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||