Netstat Examples

netstat -i
Name  Mtu Network     Address               Ipkts Ierrs    Opkts Oerrs  Coll
tu0   1500        00:00:f8:03:33:46  249357434    17 223493657 30222 2230822
tu0   1500  153.90.192  esus               249357434    17 223493657 30222 2230822
tu0   1500  DLI         none               249357434    17 223493657 30222 2230822


netstat -ip

Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   
tcp        1      0 harkin.cs.montana.:1865 esus.cs.montana.edu:www CLOSE_WAIT  7428/netscape-commu 
tcp        1      0 harkin.cs.montana.:1864 esus.cs.montana.edu:www CLOSE_WAIT  7428/netscape-commu 
tcp        1      0 harkin.cs.montana.:1862 esus.cs.montana.edu:www CLOSE_WAIT  7428/netscape-commu 
tcp        0      0 harkin.cs.montana:rsync esus.cs.montana.edu:ssh ESTABLISHED -                   
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  1      [ ]         STREAM     CONNECTED     34301  7419/kmail          @0000016b
unix  1      [ N ]       STREAM     CONNECTED     22124  8214/kvt            @0000012f
unix  1      [ ]         STREAM     CONNECTED     19643  7369/kfm            @000000dd
unix  1      [ ]         STREAM     CONNECTED     19635  7369/kfm            @000000d9
unix  1      [ ]         STREAM     CONNECTED     34299  7419/kmail          @0000016a
unix  1      [ ]         STREAM     CONNECTED     19641  7369/kfm            @000000dc
unix  1      [ N ]       STREAM     CONNECTED     19581  7477/kvt            @000000cb
unix  1      [ N ]       STREAM     CONNECTED     19422  7390/xosview        @000000ba
unix  1      [ ]         STREAM     CONNECTED     19647  7369/kfm            @000000df
unix  1      [ ]         STREAM     CONNECTED     19631  7369/kfm            @000000d7
unix  1      [ ]         STREAM     CONNECTED     19344  -                   @000000aa
unix  1      [ N ]       STREAM     CONNECTED     19448  7417/kvt            @000000c1
unix  1      [ ]         STREAM     CONNECTED     49748  -                   /tmp/.X11-unix/X0
unix  1      [ ]         STREAM     CONNECTED     46850  -                   /tmp/.X11-unix/X0
unix  1      [ ]         STREAM     CONNECTED     19582  -                   /tmp/.X11-unix/X0
unix  1      [ ]         STREAM     CONNECTED     19506  -                   /tmp/.X11-unix/X0
unix  0      [ ]         DGRAM                    19324  -                   
unix  0      [ ]         DGRAM                    928    -                   
unix  0      [ ]         DGRAM                    637    -                   
unix  0      [ ]         DGRAM                    616    -                   
unix  0      [ ]         DGRAM                    519    -                   
unix  0      [ ]         DGRAM                    311    -                   


netstat -s


Ip:
    3055283 total packets received
    2 with invalid headers
    0 forwarded
    0 incoming packets discarded
    2786080 incoming packets delivered
    157999 requests sent out
    2 fragments dropped after timeout
    2093 reassemblies required
    788 packets reassembled ok
    2 packet reassembles failed
    21754 fragments created
Icmp:
    14548 ICMP messages received
    25 input ICMP message failed.
    ICMP input histogram:
        destination unreachable: 7988
        redirects: 6525
        echo requests: 1
        echo replies: 18
        address mask replies
    407 ICMP messages sent
    0 ICMP messages failed
    ICMP output histogram:
        destination unreachable: 405
        time exceeded: 1
        echo replies: 1
Tcp:
    975 active connections openings
    0 passive connection openings
    11 failed connection attempts
    0 connection resets received
    2 connections established
    62444 segments received
    55787 segments send out
    314 segments retransmited
    30 bad segments received.
    82 resets sent
Udp:
    2260705 packets received
    390 packets to unknown port received.
    15 packet receive errors
    87363 packets sent
TcpExt:
    2 resets received for embryonic SYN_RECV sockets
    46 packets pruned from receive queue because of socket buffer overrun


netstat -l

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 *:printer               *:*                     LISTEN      
tcp        0      0 *:6000                  *:*                     LISTEN      
tcp        0      0 *:www                   *:*                     LISTEN      
tcp        0      0 *:smtp                  *:*                     LISTEN      
tcp        0      0 *:ssh                   *:*                     LISTEN      
tcp        0      0 *:linuxconf             *:*                     LISTEN      
tcp        0      0 *:auth                  *:*                     LISTEN      
tcp        0      0 *:finger                *:*                     LISTEN      
tcp        0      0 *:login                 *:*                     LISTEN      
tcp        0      0 *:shell                 *:*                     LISTEN      
tcp        0      0 *:telnet                *:*                     LISTEN      
tcp        0      0 *:ftp                   *:*                     LISTEN      
tcp        0      0 *:netbios-ssn           *:*                     LISTEN      
tcp        0      0 *:sunrpc                *:*                     LISTEN      
udp        0      0 *:ntalk                 *:*                                 
udp        0      0 *:talk                  *:*                                 
udp        0      0 harkin.cs.m:netbios-dgm *:*                                 
udp        0      0 harkin.cs.mo:netbios-ns *:*                                 
udp        0      0 *:netbios-dgm           *:*                                 
udp        0      0 *:netbios-ns            *:*                                 
udp        0      0 *:800                   *:*                                 
udp        0      0 *:sunrpc                *:*                                 
raw        0      0 *:icmp                  *:*                     7           
raw        0      0 *:tcp                   *:*                     7           
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node Path
unix  0      [ ACC ]     STREAM     LISTENING     576    /tmp/.font-unix/fs-1
unix  0      [ ACC ]     STREAM     LISTENING     49817  /dev/printer
unix  0      [ ACC ]     STREAM     LISTENING     19405  /tmp//kfm_2605_7369harkin.cs.montana.edu_0
unix  0      [ ACC ]     STREAM     LISTENING     19337  /tmp/.X11-unix/X0
unix  0      [ ACC ]     STREAM     LISTENING     19401  /tmp//kio_2605_7369harkin.cs.montana.edu_0
unix  0      [ ACC ]     STREAM     LISTENING     544    /dev/gpmctl


netstat -tcp

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 *:printer               *:*                     LISTEN      
tcp        1      0 harkin.cs.montana.:1865 esus.cs.montana.edu:www CLOSE_WAIT  
tcp        1      0 harkin.cs.montana.:1864 esus.cs.montana.edu:www CLOSE_WAIT  
tcp        1      0 harkin.cs.montana.:1863 esus.cs.montana.edu:www CLOSE_WAIT  
tcp        1      0 harkin.cs.montana.:1862 esus.cs.montana.edu:www CLOSE_WAIT  
tcp       57      0 harkin.cs.montana.:1619 metalab.unc.edu:ftp     CLOSE_WAIT  
tcp        0      0 harkin.cs.montana.e:859 esus.cs.montana.edu:ssh ESTABLISHED 
tcp        0      0 harkin.cs.montana:rsync esus.cs.montana.edu:ssh ESTABLISHED 
tcp        0      0 *:6000                  *:*                     LISTEN      
tcp        0      0 *:www                   *:*                     LISTEN      
tcp        0      0 *:smtp                  *:*                     LISTEN      
tcp        0      0 *:ssh                   *:*                     LISTEN      
tcp        0      0 *:linuxconf             *:*                     LISTEN      
tcp        0      0 *:auth                  *:*                     LISTEN      
tcp        0      0 *:finger                *:*                     LISTEN      
tcp        0      0 *:login                 *:*                     LISTEN      
tcp        0      0 *:shell                 *:*                     LISTEN      
tcp        0      0 *:telnet                *:*                     LISTEN      
tcp        0      0 *:ftp                   *:*                     LISTEN      
tcp        0      0 *:netbios-ssn           *:*                     LISTEN      
tcp        0      0 *:sunrpc                *:*                     LISTEN      


netstat --ip -s

ip:
   254070155 total packets received
   11 bad header checksums
   0 with size smaller than minimum
   0 with data size < data length
   5 with header length < data size
   0 with data length < header length
   1934936 fragments received
   0 fragments dropped (dup or out of space)
   136 fragments dropped after timeout
   0 packets forwarded
   1584844 packets not forwardable
   0 packets denied access
   0 redirects sent
   98 packets with unknown or unsupported protocol
   250888394 packets consumed here
   247429789 total packets generated here
   5804 lost packets due to resource problems
   338133 total packets reassembled ok
   1044464 output packets fragmented ok
   5955042 output fragments created
   0 packets with special flags set