[ Team LiB ] Previous Section Next Section

Showing Network Status (netstat)

You can use the netstat(1M) command to display the following network status information.

  • A list of active sockets for each protocol.

  • The state of the interfaces.

  • The routing table.

  • The multicast routing table.

  • The state of DHCP on one or all interfaces.

The Solaris release supports both the IPv4 and IPv6 network interfaces. In the Solaris 8 release, the netstat command has been updated to include the IPv6 interfaces.

Displaying Status of Active TCP and UDP Ports

Use the netstat command with no arguments to display the status of active TCP and UDP ports. The following example shows the output of the netstat command with no arguments, to display the status of active TCP and UDP ports.


paperbark% netstat
TCP: IPv4
   Local Address        Remote Address    Swind Send-Q Rwind Recv-Q  State
-------------------- -------------------- ----- ------ ----- ------ ------
localhost.32786      localhost.32773      32768      0 32768      0 ESTABLISHED
localhost.32773      localhost.32786      32768      0 32768      0 ESTABLISHED
localhost.32789      localhost.32784      32768      0 32768      0 ESTABLISHED
localhost.32784      localhost.32789      32768      0 32768      0 ESTABLISHED
localhost.32792      localhost.32791      32768      0 32768      0 ESTABLISHED
localhost.32791      localhost.32792      32768      0 32768      0 ESTABLISHED
localhost.32795      localhost.32784      32768      0 32768      0 ESTABLISHED
localhost.32784      localhost.32795      32768      0 32768      0 ESTABLISHED
localhost.32798      localhost.32797      32768      0 32768      0 ESTABLISHED
localhost.32797      localhost.32798      32768      0 32768      0 ESTABLISHED
localhost.32813      localhost.32784      32768      0 32768      0 ESTABLISHED
localhost.32784      localhost.32813      32768      0 32768      0 ESTABLISHED
localhost.32816      localhost.32815      32767      0 32768      0 ESTABLISHED
localhost.32815      localhost.32816      32768      0 32768      0 ESTABLISHED
paperbark.32891      G3.ftp               17520      0 24820      0 ESTABLISHED
paperbark.8888       paperbark.32904      32768      0 32768      0 TIME_WAIT
paperbark.32905      paperbark.32779      32768      0 32768      0 TIME_WAIT

Active UNIX domain sockets
Address  Type          Vnode     Conn  Local Addr      Remote Addr
707f1d90 stream-ord 705b89e0 00000000 /tmp/.X11-unix/X0
707f1ea8 stream-ord 00000000 00000000
paperbark%



Displaying the Status of Network Interfaces

Use the -i option to the netstat command to display the status of network interfaces. The following example uses the netstat -i command on the system paperbark to display the status of network interfaces.


paperbark% netstat -i
Name  Mtu  Net/Dest      Address       Ipkts   Ierrs Opkts  Oerrs Collis Queue
lo0   8232 loopback      localhost     11787   0     11787  0     0      0
hme0  1500 paperbark     paperbark     8       0     5      0     0      0

paperbark%



Displaying Kernel Routing Tables

Use the -r option to the netstat command to display kernel routing tables, and use the -n option to display network addresses as numbers. The following example uses the netstat -r -n command to display the kernel's routing tables with the network addresses as numbers.


paperbark% netstat -r -n

Routing Table:  IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------
172.16.8.0           172.16.8.22           U        1      0  hme0
224.0.0.0            172.16.8.22           U        1      0  hme0
127.0.0.1            127.0.0.1             UH      16  11150  lo0
paperbark%

Refer to the netstat(1M) manual page for more information.

    [ Team LiB ] Previous Section Next Section