Sun Microsystems Logo
Products and Services
 
Support and Training
 
 

Previous Previous     Contents     Index     Next Next

Running Software Checks

If the network has problems, diagnose and fix software-related problems by acting in one of the following ways:

  • Use the netstat command to display network information.

  • Check the hosts database (and ipnodes if you are using IPv6) to ensure that the entries are correct and current.

  • If you are running RARP, check the Ethernet addresses in the ethers database to ensure that the entries are correct and current.

  • Try to connect to the local host by using telnet.

  • Ensure that the network daemon inetd is running. Log in as superuser and type the following:

    # ps -ef | grep inetd

The following example shows the output when the inetd daemon is running:
root 57 1 0 Apr 04 ? 3:19 /usr/sbin/inetd -s
root 4218 4198 0 17:57:23 pts/3 0:00 grep inetd 

ping Command

Use 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 Map

Table 4-6 ping Command Task Map

Task

Description

For Instructions, Go To ...

Determine if a host is running

Involves pinging the hostname

Network Databases and nsswitch.conf File

Determine if a host is losing packets

Involves using the -s option of the ping command

How Name Services Affect Network Databases

ProcedureHow to Determine if a Host Is Running

  • On the command line, type the following command.

    % 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

ProcedureHow to Determine if a Host Is Losing Packets

If 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.

  • On the command line, type the following command.

    % ping -s hostname

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.

ifconfig 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]

ifconfig Command Task Map

Table 4-7 ifconfig Command Task Map

Task

Description

For Instructions, Go To ...

Get information about a specific interface

Involves using the ifconfig command

How to Get Information About a Specific Interface

Get information about all interfaces on a network

Involves using the -a option of the ifconfig command

nsswitch.conf File -- Specifying Which Name Service to Use

ProcedureHow to Get Information About a Specific Interface

  1. Become superuser.

  2. On the command line, type the following command.

    # ifconfig interface

For 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.

ProcedureHow to Get Information About All Interfaces on a Network

A useful ifconfig option is -a, which provides information on all interfaces on your network.

  1. Become superuser.

  2. On the command line, type the following command.

    # ifconfig -a interface

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 Previous     Contents     Index     Next Next