
{"id":14512,"date":"2013-11-23T18:29:44","date_gmt":"2013-11-23T18:29:44","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=14512"},"modified":"2013-11-23T18:29:44","modified_gmt":"2013-11-23T18:29:44","slug":"netstat-print-network-connections-routing-tables-interface-statistics-masquerade-connections-and-multicast-memberships","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2013\/11\/23\/netstat-print-network-connections-routing-tables-interface-statistics-masquerade-connections-and-multicast-memberships\/","title":{"rendered":"What does the command  &#8220;netstat &#8221; do ?"},"content":{"rendered":"<p>ABOUT netstat<\/p>\n<pre>\nIn computing, netstat (network statistics) is a command-line network utility tool that displays network connections for the Transmission Control Protocol (both incoming and outgoing), routing tables, and a number of network interface (network interface controller or software-defined network interface) and network protocol statistics. It is available on Unix-like operating systems including macOS, Linux, Solaris, and BSD, and is available on Windows NT-based operating systems including Windows XP, Windows Vista, Windows 7, Windows 8 and Windows 10.\n\nIt is used for finding problems in the network and to determine the amount of traffic on the network as a performance measurement.[1] On Linux this program is mostly obsolete, although still included in many distributions.\n\nOn Linux, netstat (part of \"net-tools\") is superseded by ss (part of iproute2). Replacement for netstat -r is ip route. Replacement for netstat -i is ip -s link, replacement for netstat -g is ip maddr, all of which are recommended instead\n<\/pre>\n<p>RELATED SHELL SESSION EXPOSURE<br \/>\n[bash light=&#8221;true&#8221;]<br \/>\n$netstat &#8211;tcp<br \/>\nActive Internet connections (w\/o servers)<br \/>\nProto Recv-Q Send-Q Local Address           Foreign Address         State<br \/>\ntcp        0      0 debian.local:39585      74.125.169.8:http       ESTABLISHED<br \/>\ntcp        0      0 debian.local:39586      74.125.169.8:http       ESTABLISHED<br \/>\ntcp        0      0 debian.local:47951      maa03s17-in-f6.1e:https ESTABLISHED<br \/>\ntcp        0      0 debian.local:47203      maa03s17-in-f0.1e1:http ESTABLISHED<br \/>\n$<br \/>\n$netstat &#8211;tcp &#8211;numeric<br \/>\nActive Internet connections (w\/o servers)<br \/>\nProto Recv-Q Send-Q Local Address           Foreign Address         State<br \/>\ntcp        1      0 192.168.0.101:54541     46.22.210.18:80         CLOSE_WAIT<br \/>\ntcp        0      0 192.168.0.101:54542     46.22.210.18:80         ESTABLISHED<br \/>\ntcp        0      0 192.168.0.101:39585     74.125.169.8:80         ESTABLISHED<br \/>\ntcp        0      0 192.168.0.101:39586     74.125.169.8:80         TIME_WAIT<br \/>\ntcp        0      0 192.168.0.101:47951     74.125.236.198:443      ESTABLISHED<br \/>\ntcp        0      0 192.168.0.101:47203     74.125.236.192:80       ESTABLISHED<br \/>\n$netstat &#8211;tcp &#8211;numeric<br \/>\nActive Internet connections (w\/o servers)<br \/>\nProto Recv-Q Send-Q Local Address           Foreign Address         State<br \/>\ntcp        0      0 192.168.0.101:54542     46.22.210.18:80         TIME_WAIT<br \/>\ntcp        0      0 192.168.0.101:39585     74.125.169.8:80         ESTABLISHED<br \/>\ntcp        0      0 192.168.0.101:39586     74.125.169.8:80         TIME_WAIT<br \/>\ntcp        0      0 192.168.0.101:47951     74.125.236.198:443      ESTABLISHED<br \/>\ntcp        0      0 192.168.0.101:47203     74.125.236.192:80       ESTABLISHED<br \/>\n$netstat &#8211;tcp &#8211;listen<br \/>\nActive Internet connections (only servers)<br \/>\nProto Recv-Q Send-Q Local Address           Foreign Address         State<br \/>\ntcp        0      0 *:35436                 *:*                     LISTEN<br \/>\ntcp        0      0 *:sunrpc                *:*                     LISTEN<br \/>\ntcp        0      0 *:ssh                   *:*                     LISTEN<br \/>\ntcp        0      0 localhost:smtp          *:*                     LISTEN<br \/>\ntcp6       0      0 [::]:sunrpc             [::]:*                  LISTEN<br \/>\ntcp6       0      0 [::]:501100              [::]:*                  LISTEN<br \/>\ntcp6       0      0 [::]:ssh                [::]:*                  LISTEN<br \/>\ntcp6       0      0 localhost:smtp          [::]:*                  LISTEN<br \/>\n$netstat &#8211;tcp &#8211;listen<br \/>\nActive Internet connections (only servers)<br \/>\nProto Recv-Q Send-Q Local Address           Foreign Address         State<br \/>\ntcp        0      0 *:35436                 *:*                     LISTEN<br \/>\ntcp        0      0 *:sunrpc                *:*                     LISTEN<br \/>\ntcp        0      0 *:ssh                   *:*                     LISTEN<br \/>\ntcp        0      0 localhost:smtp          *:*                     LISTEN<br \/>\ntcp6       0      0 [::]:sunrpc             [::]:*                  LISTEN<br \/>\ntcp6       0      0 [::]:501100              [::]:*                  LISTEN<br \/>\ntcp6       0      0 [::]:ssh                [::]:*                  LISTEN<br \/>\ntcp6       0      0 localhost:smtp          [::]:*                  LISTEN<br \/>\n$netstat &#8211;tcp &#8211;program<br \/>\n(Not all processes could be identified, non-owned process info<br \/>\n will not be shown, you would have to be root to see it all.)<br \/>\nActive Internet connections (w\/o servers)<br \/>\nProto Recv-Q Send-Q Local Address           Foreign Address         State       PID\/Program name<br \/>\ntcp        0      0 debian.local:39600      74.125.169.8:http       ESTABLISHED 3846\/chrome<br \/>\ntcp        0      0 debian.local:47951      maa03s17-in-f6.1e:https ESTABLISHED 3846\/chrome<br \/>\ntcp        0      0 debian.local:47203      maa03s17-in-f0.1e1:http ESTABLISHED 3846\/chrome<br \/>\n$<br \/>\n$netstat &#8211;tcp &#8211;route<br \/>\nKernel IP routing table<br \/>\nDestination     Gateway         Genmask         Flags   MSS Window  irtt Iface<br \/>\ndefault         192.168.0.1     0.0.0.0         UG        0 0          0 eth0<br \/>\n192.168.0.0     *               255.255.255.0   U         0 0          0 eth0<br \/>\n$netstat &#8211;tcp &#8211;statistics<br \/>\nIcmpMsg:<br \/>\n    OutType3: 1<br \/>\nTcp:<br \/>\n    522 active connections openings<br \/>\n    0 passive connection openings<br \/>\n    14 failed connection attempts<br \/>\n    16 connection resets received<br \/>\n    2 connections established<br \/>\n    60302 segments received<br \/>\n    41524 segments send out<br \/>\n    22 segments retransmited<br \/>\n    21 bad segments received.<br \/>\n    140 resets sent<br \/>\nUdpLite:<br \/>\nTcpExt:<br \/>\n    190 TCP sockets finished time wait in fast timer<br \/>\n    495 delayed acks sent<br \/>\n    1 delayed acks further delayed because of locked socket<br \/>\n    Quick ack mode was activated 32 times<br \/>\n    47899 packet headers predicted<br \/>\n    1353 acknowledgments not containing data payload received<br \/>\n    406 predicted acknowledgments<br \/>\n    7 congestion windows recovered without slow start after partial ack<br \/>\n    22 other TCP timeouts<br \/>\n    32 DSACKs sent for old packets<br \/>\n    3 DSACKs sent for out of order packets<br \/>\n    5 DSACKs received<br \/>\n    25 connections reset due to unexpected data<br \/>\n    16 connections reset due to early user close<br \/>\n    TCPSackShiftFallback: 2<br \/>\n    TCPChallengeACK: 21<br \/>\n    TCPSYNChallenge: 21<br \/>\nIpExt:<br \/>\n    InMcastPkts: 929<br \/>\n    OutMcastPkts: 42<br \/>\n    InBcastPkts: 16<br \/>\n    OutBcastPkts: 14<br \/>\n    InOctets: 83827635<br \/>\n    OutOctets: 2776707<br \/>\n    InMcastOctets: 332300<br \/>\n    OutMcastOctets: 5264<br \/>\n    InBcastOctets: 1808<br \/>\n    OutBcastOctets: 1006<br \/>\n$<\/p>\n<p>[\/bash]<br \/>\nLINKS<br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Netstat\">https:\/\/en.wikipedia.org\/wiki\/Netstat<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/tags\/netstat\/info\">https:\/\/stackoverflow.com\/tags\/netstat\/info<\/a><\/p>\n<h4><u>Bash &#8211; netstat  ( network statistics related )  &#8211;  Video Tutorial Related <\/u><\/h4>\n<p>[ source : <a href=\"http:\/\/www.youtube.com\/user\/metalx1000\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.youtube.com\/user\/metalx1000<\/a> ]<\/p>\n<pre style=\"width:100%;\">\n[youtube https:\/\/www.youtube.com\/watch?v=wcrQgKNUD10?rel=0&w=560&h=315]\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>ABOUT netstat In computing, netstat (network statistics) is a command-line network utility tool that displays network connections for the Transmission Control Protocol (both incoming and outgoing), routing tables, and a number of network interface (network interface controller or software-defined network interface) and network protocol statistics. It is available on Unix-like operating systems including macOS, Linux, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2013\/11\/23\/netstat-print-network-connections-routing-tables-interface-statistics-masquerade-connections-and-multicast-memberships\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;What does the command  &#8220;netstat &#8221; do ?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,91],"tags":[457,832,1157],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/14512"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=14512"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/14512\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=14512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=14512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=14512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}