{"id":129,"date":"2024-10-12T20:13:15","date_gmt":"2024-10-12T20:13:15","guid":{"rendered":"http:\/\/linuxresellerwebhosting.in\/blog\/?p=129"},"modified":"2024-10-14T04:22:17","modified_gmt":"2024-10-14T04:22:17","slug":"troubleshooting-network-related-issues-using-netstat-command","status":"publish","type":"post","link":"https:\/\/linuxresellerwebhosting.in\/blog\/troubleshooting-network-related-issues-using-netstat-command\/","title":{"rendered":"How To Troubleshooting Network Related Issues using NETSTAT Command"},"content":{"rendered":"<p lang=\"zxx\"><span style=\"font-family: georgia, palatino, serif;\"><span style=\"font-size: medium;\">Hi all !<\/span><\/span><\/p>\n<p lang=\"zxx\"><span style=\"font-family: georgia, palatino, serif;\"><span style=\"font-size: medium;\">In this tutorail, we are going to see NETSTAT command-line utility. <\/span><\/span><\/p>\n<p lang=\"zxx\"><span style=\"font-family: georgia, palatino, serif;\"><span style=\"font-size: medium;\"><span style=\"color: #333333;\">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.\u00a0<\/span><\/span><span style=\"font-size: medium;\">The asnwer is both network and <a href=\"https:\/\/www.squarebrothers.com\/vps-hosting-india\/\" target=\"_blank\" rel=\"noopener\">hosting server<\/a> administrator can use it to trouble shoot networkmconnection related issues. <span style=\"color: #000000;\">Netstat displays protocol statistics and current TCP\/IP network connections using the following command switches:<\/span> <\/span><\/span><\/p>\n<h3 class=\"theme:dark-terminal lang:default decode:true \">NETSTAT [-a] [-e] [-n] [-s] [-p propto] [-r] [interval]<\/h3>\n<p>&nbsp;<\/p>\n<p lang=\"zxx\">-a Displays all connections and listening ports.<\/p>\n<p lang=\"zxx\">-e Displays Ethernet statistics. This may be combined with the -s option.<\/p>\n<p lang=\"zxx\">-n Displays addresses and port numbers in numerical form.<\/p>\n<p lang=\"zxx\">-o Displays the owning process ID associated with each connection.<\/p>\n<p lang=\"zxx\">-p proto Shows connections for the protocol specified by proto; proto may be any of: TCP, UDP,<br \/>\nTCPv6, or UDPv6. If used with option to display per-protocol statistics, proto may be any<br \/>\nof: IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.<\/p>\n<p lang=\"zxx\">-r Displays the routing table.<\/p>\n<p lang=\"zxx\">-s Displays per-protocol statistics. By default, statistics are<br \/>\nshown for IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPv6;<br \/>\nthe<\/p>\n<p lang=\"zxx\">-p option may be used to specify a subset of the default.<br \/>\ninterval 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.<\/p>\n<p>To display the routing table:<\/p>\n<pre class=\"theme:dark-terminal lang:default decode:true \">#netstat -rn<\/pre>\n<p>-r: Kernel routing tables.<br \/>\n-n: Shows numerical addresses instead of trying to determine hosts.<\/p>\n<p>To display the extended interfaces statistics:<\/p>\n<pre class=\"theme:dark-terminal lang:default decode:true \">#netstat -ie<\/pre>\n<p>-i: Interface<br \/>\n-e: Extended information<\/p>\n<p>To display all the opened network sockets:<\/p>\n<pre class=\"theme:dark-terminal lang:default decode:true \">#netstat -uta<\/pre>\n<p>-u: UDP<br \/>\n-t: TCP<br \/>\n-a: All<\/p>\n<p>To display all the listening state sockets:<\/p>\n<pre class=\"theme:dark-terminal lang:default decode:true \">#netstat -lt<\/pre>\n<p>-t: TCP<br \/>\n-l: Listening state sockets<\/p>\n<p>To display the quick interfaces statistics:<\/p>\n<pre class=\"theme:dark-terminal lang:default decode:true \">#netstat -i<\/pre>\n<p>-i: Interface<\/p>\n<p>To display the summary statistics for each protocol<\/p>\n<pre class=\"theme:dark-terminal lang:default decode:true \">#netstat -s<\/pre>\n<p>-s: Summary statistics for each protocol.<\/p>\n<p>Ip:<br \/>\n604 total packets received<br \/>\n1 with invalid addresses<br \/>\n0 forwarded<br \/>\n0 incoming packets discarded<br \/>\n485 incoming packets delivered<br \/>\n507 requests sent out<\/p>\n<p>Icmp:<br \/>\n0 ICMP messages received<br \/>\n0 input ICMP message failed.<br \/>\nICMP input histogram:<br \/>\n0 ICMP messages sent<br \/>\n0 ICMP messages failed<br \/>\nICMP output histogram:<\/p>\n<p>Tcp:<br \/>\n21 active connections openings<br \/>\n4 passive connection openings<br \/>\n0 failed connection attempts<br \/>\n0 connection resets received<br \/>\n3 connections established<br \/>\n351 segments received<br \/>\n388 segments send out<br \/>\n0 segments retransmited<br \/>\n0 bad segments received<br \/>\n2 resets sent<\/p>\n<p>Udp:<br \/>\n119 packets received<br \/>\n0 packets to unknown port received.<br \/>\n0 packet receive errors<br \/>\n119 packets sent<\/p>\n<p>TcpExt:<br \/>\n5 TCP sockets finished time wait in fast timer<br \/>\n21 delayed acks sent<br \/>\nQuick ack mode was activated 10 times<br \/>\n31 packets directly queued to recvmsg prequeue.<br \/>\n15765 of bytes directly received from prequeue<br \/>\n105 packet headers predicted<br \/>\n17 packets header predicted and directly queued to user<br \/>\n36 acknowledgments not containing data received<br \/>\n11 predicted acknowledgments<br \/>\n0 TCP data loss events<\/p>\n<p>By using these <code>netstat<\/code> commands and analyzing the results, you can diagnose many common network &amp; <a href=\"https:\/\/www.linuxresellerwebhosting.in\/vps-hosting\/\">server<\/a> -related issues, such as port conflicts, dropped packets, or misconfigured routing tables.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi all ! In this tutorail, we are going to see NETSTAT command-line utility. Netstat is a command line utility<\/p>\n","protected":false},"author":1,"featured_media":969,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[1],"tags":[],"class_list":["post-129","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=129"}],"version-history":[{"count":19,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/129\/revisions"}],"predecessor-version":[{"id":148,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/129\/revisions\/148"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/media\/969"}],"wp:attachment":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}