20 Netstat Commands For Linux Network Management
20 Netstat Commands For Linux Network Management
tecmint.com
This tool is very important and much useful for Linux network
administrators as well as system administrators to monitor and
troubleshoot their network related problems and determine network
traffic performance. This article shows usages of netstat command
1 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
Listing all ports (both TCP and UDP) using netstat -a option.
# netstat -a | more
2 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
*:*
# netstat -at
3 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
tcp 0 0 localhost:smtp
*:* LISTEN
tcp 0 52 192.168.0.2:ssh
192.168.0.1:egs ESTABLISHED
tcp 1 0 192.168.0.2:59292
www.gov.com:http CLOSE_WAIT
# netstat -au
# netstat -l
4 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
Listing all active listening TCP ports by using option netstat -lt.
5 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
# netstat -lt
Listing all active listening UDP ports by using option netstat -lu.
6 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
# netstat -lu
# netstat -lx
7 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
8 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
5531 /var/run/pcscd.comm
# netstat -s
Ip:
2461 total packets received
0 forwarded
0 incoming packets discarded
2431 incoming packets delivered
2049 requests sent out
Icmp:
0 ICMP messages received
0 input ICMP message failed.
ICMP input histogram:
1 ICMP messages sent
0 ICMP messages failed
ICMP output histogram:
destination unreachable: 1
Tcp:
159 active connections openings
1 passive connection openings
4 failed connection attempts
0 connection resets received
1 connections established
9 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
# netstat -st
Tcp:
2805201 active connections openings
1597466 passive connection openings
1522484 failed connection attempts
37806 connection resets received
1 connections established
57718706 segments received
64280042 segments send out
3135688 segments retransmited
74 bad segments received.
17580 resets sent
10 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
# netstat -su
Udp:
1774823 packets received
901848 packets to unknown port received.
0 packet receive errors
2968722 packets sent
# netstat -tp
11 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
tcp 0 0 *:sunrpc
*:* LISTEN
tcp 0 0 *:58642
*:* LISTEN
tcp 0 0 *:ssh
*:* LISTEN
tcp 0 0 localhost:ipp
*:* LISTEN
tcp 0 0 localhost:smtp
*:* LISTEN
tcp 1 0 192.168.0.2:59447
www.gov.com:http CLOSE_WAIT
tcp 0 52 192.168.0.2:ssh
192.168.0.1:egs ESTABLISHED
tcp 0 0 *:sunrpc
*:* LISTEN
tcp 0 0 *:ssh
*:* LISTEN
tcp 0 0 localhost:ipp
*:* LISTEN
tcp 0 0 localhost:smtp
*:* LISTEN
tcp 0 0 *:59482
*:* LISTEN
12 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
# netstat -r
# netstat -i
13 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
# netstat -ie
14 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
(480.0 b)
# netstat -g
To get netstat information every few second, then use the following
command, it will print netstat information continuously, say every
few seconds.
# netstat -c
15 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
# netstat --verbose
16 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
tcp 0 0 *:http
*:* LISTEN 9056/httpd
tcp 0 0 *:https
*:* LISTEN 9056/httpd
tcp 0 0 tecmint.com:http
sg2nlhg008.shr.prod.s:35248 TIME_WAIT -
tcp 0 0 tecmint.com:http
sg2nlhg007.shr.prod.s:57783 TIME_WAIT -
tcp 0 0 tecmint.com:http
sg2nlhg007.shr.prod.s:57769 TIME_WAIT -
tcp 0 0 tecmint.com:http
sg2nlhg008.shr.prod.s:35270 TIME_WAIT -
tcp 0 0 tecmint.com:http
sg2nlhg009.shr.prod.s:41637 TIME_WAIT -
tcp 0 0 tecmint.com:http
sg2nlhg009.shr.prod.s:41614 TIME_WAIT -
unix 2 [ ] STREAM CONNECTED
88586726 10394/httpd
Ip:
17 of 18 09-Sep-15 3:28 PM
20 Netstat Commands for Linux Network Management about:reader?url=http://www.tecmint.com/20-netstat-commands-for-linu...
That’s it, If you are looking for more information and options about
netstat command, refer netstat manual docs or use man netstat
command to know all the information. If we’ve missed anything in
the list, please inform us using our comment section below. So, we
could keep updating this list based on your comments.
18 of 18 09-Sep-15 3:28 PM