Display Current TCP/IP Connections and Statistics
by Using Netstat

Netstat displays protocol statistics and current TCP/IP connections. Netstat -a displays all connections, and netstat -r displays the route table plus active connections. The -n switch tells netstat not to convert addresses and port numbers to names. The following is sample output:


C:\>netstat -e Interface Statistics Received Sent Bytes 3995837940 47224622 Unicast packets 120099 131015 Non-unicast packets 7579544 3823 Discards 0 0 Errors 0 0 Unknown protocols 363054211 C:\>netstat -a Active Connections Proto Local Address Foreign Address State TCP davemac1:1572 172.16.48.10:nbsession ESTABLISHED TCP davemac1:1589 172.16.48.10:nbsession ESTABLISHED TCP davemac1:1606 172.16.105.245:nbsession ESTABLISHED TCP davemac1:1632 172.16.48.213:nbsession ESTABLISHED TCP davemac1:1659 172.16.48.169:nbsession ESTABLISHED TCP davemac1:1714 172.16.48.203:nbsession ESTABLISHED TCP davemac1:1719 172.16.48.36:nbsession ESTABLISHED TCP davemac1:1241 172.16.48.101:nbsession ESTABLISHED UDP davemac1:1025 *:* UDP davemac1:snmp *:* UDP davemac1:nbname *:* UDP davemac1:nbdatagram *:* UDP davemac1:nbname *:* UDP davemac1:nbdatagram *:* C:\>netstat -s IP Statistics Packets Received = 5378528 Received Header Errors = 738854 Received Address Errors = 23150 Datagrams Forwarded = 0 Unknown Protocols Received = 0 Received Packets Discarded = 0 Received Packets Delivered = 4616524 Output Requests = 132702 Routing Discards = 157 Discarded Output Packets = 0 Output Packet No Route = 0 Reassembly Required = 0 Reassembly Successful = 0 Reassembly Failures = 0 Datagrams Successfully Fragmented = 0 Datagrams Failing Fragmentation = 0 Fragments Created = 0 ICMP Statistics Received Sent Messages 693 4 Errors 0 0 Destination Unreachable 685 0 Time Exceeded 0 0 Parameter Problems 0 0 Source Quenchs 0 0 Redirects 0 0 Echos 4 0 Echo Replies 0 4 Timestamps 0 0 Timestamp Replies 0 0 Address Masks 0 0 Address Mask Replies 0 0 TCP Statistics Active Opens = 597 Passive Opens = 135 Failed Connection Attempts = 107 Reset Connections = 91 Current Connections = 8 Segments Received = 106770 Segments Sent = 118431 Segments Retransmitted = 461 UDP Statistics Datagrams Received = 4157136 No Ports = 351928 Receive Errors = 2 Datagrams Sent = 13809