How To Troubleshooting Network Related Issues using NETSTAT Command

Hi all !

In this tutorail, we are going to see NETSTAT command-line utility.

Netstat is a command line utility that can be used to list out all the network (socket) connections on a system. It lists out all the tcp, udp socket connections and the unix socket connections. The asnwer is both network and server administrator can use it to trouble shoot networkmconnection related issues. Netstat displays protocol statistics and current TCP/IP network connections using the following command switches:

 

-a Displays all connections and listening ports.
-e Displays Ethernet statistics. This may be combined with the -s option.
-n Displays addresses and port numbers in numerical form.
-o Displays the owning process ID associated with each connection.
-p proto Shows connections for the protocol specified by proto; proto may be any of: TCP, UDP,
TCPv6, or UDPv6. If used with option to display per-protocol statistics, proto may be any
of: IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.
-r Displays the routing table.
-s Displays per-protocol statistics. By default, statistics are
shown for IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPv6;
the -p option may be used to specify a subset of the default.
interval Redisplays selected statistics, pausing interval seconds between each display. Press CTRL+C to stop redisplaying statistics. If omitted, netstat will print the current configuration information once.

To display the routing table:

-r: Kernel routing tables.
-n: Shows numerical addresses instead of trying to determine hosts.

To display the extended interfaces statistics:

-i: Interface
-e: Extended information

To display all the opened network sockets:

-u: UDP
-t: TCP
-a: All

To display all the listening state sockets:

-t: TCP
-l: Listening state sockets

To display the quick interfaces statistics:

-i: Interface

To display the summary statistics for each protocol

-s: Summary statistics for each protocol.

Ip:
604 total packets received
1 with invalid addresses
0 forwarded
0 incoming packets discarded
485 incoming packets delivered
507 requests sent out

Icmp:
0 ICMP messages received
0 input ICMP message failed.
ICMP input histogram:
0 ICMP messages sent
0 ICMP messages failed
ICMP output histogram:

Tcp:
21 active connections openings
4 passive connection openings
0 failed connection attempts
0 connection resets received
3 connections established
351 segments received
388 segments send out
0 segments retransmited
0 bad segments received
2 resets sent

Udp:
119 packets received
0 packets to unknown port received.
0 packet receive errors
119 packets sent

TcpExt:
5 TCP sockets finished time wait in fast timer
21 delayed acks sent
Quick ack mode was activated 10 times
31 packets directly queued to recvmsg prequeue.
15765 of bytes directly received from prequeue
105 packet headers predicted
17 packets header predicted and directly queued to user
36 acknowledgments not containing data received
11 predicted acknowledgments
0 TCP data loss events

 

About

View all posts by

Leave a Reply

Your email address will not be published. Required fields are marked *