![]() |
![]() |
| |||||||||||||||||||||||||
Running Software ChecksIf the network has problems, diagnose and fix software-related problems by acting in one of the following ways:
The following example shows the output when the inetd daemon is running:
ping CommandUse the ping command to find out whether an IP connection exists for a particular host. The basic syntax is: /usr/sbin/ping host [timeout] In this syntax, host is the host name of the machine in question. The optional timeout argument indicates the time in seconds for ping to continue 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 4-6 ping Command Task Map
|
% ping hostname |
If host hostname is up, this message is displayed:
hostname is alive |
This message 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:
no answer from hostname |
How to Determine if a Host Is Losing PacketsIf you suspect that a machine might be losing packets even though the machine is running, you can use the s option of ping to try to detect the problem.
ping continually sends packets to hostname until you send an interrupt character or a timeout occurs. The responses on your screen resemble the following:
PING elvis: 56 data bytes 64 bytes from 129.144.50.21: icmp_seq=0. time=80. ms 64 bytes from 129.144.50.21: icmp_seq=1. time=0. ms 64 bytes from 129.144.50.21: icmp_seq=2. time=0. ms 64 bytes from 129.144.50.21: icmp_seq=3. time=0. ms . . . ----elvis PING Statistics---- 4 packets transmitted, 4 packets received, 0% packet loss round-trip (ms) min/avg/max = 0/20/80 |
The packet-loss statistic indicates whether the host has dropped packets.
If ping fails, check the status of the network that is reported by ifconfig and netstat, as described in ifconfig Command and netstat Command.
The 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 follows:
ifconfig interface-name [protocol_family]
Table 4-7 ifconfig Command Task Map
Task | Description | For Instructions, Go To ... |
|---|---|---|
Get information about a specific interface | Involves using the ifconfig command | |
Get information about all interfaces on a network | Involves using the -a option of the ifconfig command |
How to Get Information About a Specific InterfaceFor an le0 interface, your output resembles the following:
le0: flags=863<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 129.144.44.140 netmask ffffff00 broadcast 129.144.44.255 ether 8:0:20:8:el:fd |
The previous flags section 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 instance) 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.
This command produces, for example:
le0: flags=49<UP,LOOPBACK,RUNNING> mtu 8232
inet 127.144.44.140 netmask ff000000
le0:flags=863<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 129.144.44.140 netmask ffffff00 broadcast 129.144.44.255
ether 8:0:20:8:el:fd
|
Output that indicates an interface is not running might mean a problem with that interface. In this instance, see the ifconfig(1M) man page.
Previous Contents Index Next ![]() |