Difference between revisions of "Network Statistics"
(Created page with "= netstat = Gives an overview of network activities and displays which ports are open or have established connections. The netstat tool is essential for discovering network problems.</br> == Use == <code>netstat</code> show lists of ''active'' connections</br> </br> The first list shows internet connections:</br> '''Proto''' – Protocol of the connection (TCP, UDP)</br> '''Recv-Q''' – Receive queue of bytes received or ready to be received</br> '''Send-Q''' – Send...") |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 25: | Line 25: | ||
<code>netstat -l</code> list open ports</br> | <code>netstat -l</code> list open ports</br> | ||
<code>netstat -a</code> list open ports and active connections</br> | <code>netstat -a</code> list open ports and active connections</br> | ||
<code>netstat -s</code> show statistics for all | <code>netstat -s</code> show statistics for all protocols</br> | ||
<code>netstat -i</code> show interface statistics</br> | <code>netstat -i</code> show interface statistics</br> | ||
<code>netstat -ie</code> show extended interface statistics</br> | <code>netstat -ie</code> show extended interface statistics</br> | ||
| Line 31: | Line 31: | ||
== Useful Flags == | == Useful Flags == | ||
<code>-t</code> | <code>-t</code> tcp connections only</br> | ||
<code>-u</code> | <code>-u</code> udp connections only</br> | ||
<code>-x</code> | <code>-x</code> unix sockets only</br> | ||
<code>-n</code> | <code>-n</code> numerical addresses and ports</br> | ||
<code>-p</code> | <code>-p</code> display associated pid/program</br> | ||
<code>-c</code> continuous output</br> | <code>-c</code> continuous output</br> | ||
<code>-r</code> show routing table</br> | <code>-r</code> show routing table</br> | ||
Latest revision as of 10:38, 2 December 2022
netstat
Gives an overview of network activities and displays which ports are open or have established connections. The netstat tool is essential for discovering network problems.
Use
netstat show lists of active connections
The first list shows internet connections:
Proto – Protocol of the connection (TCP, UDP)
Recv-Q – Receive queue of bytes received or ready to be received
Send-Q – Send queue of bytes ready to be sent
Local Address – Address details and port of the local connection, an asterisk (*) in the host indicates that the server is listening and if a port is not yet established
Foreign Address– Address details and port of the remote end of the connection, an asterisk (*) appears if a port is not yet established
State – State of the local socket, most commonly ESTABLISHED, LISTENING, CLOSED or blank
The second list shows "Unix Domain" open sockets:
Proto – Protocol used by the socket (always unix)
RefCnt – Reference count of the number of attached processes to this socket
Flags – Usually ACC or blank
Type – The socket type
State – State of the socket, most often CONNECTED, LISTENING or blank
I-Node – File system inode (index node) associated with this socket
Path – System path to the socket
netstat -l list open ports
netstat -a list open ports and active connections
netstat -s show statistics for all protocols
netstat -i show interface statistics
netstat -ie show extended interface statistics
Useful Flags
-t tcp connections only
-u udp connections only
-x unix sockets only
-n numerical addresses and ports
-p display associated pid/program
-c continuous output
-r show routing table