{"id":3160,"date":"2025-02-19T14:11:57","date_gmt":"2025-02-19T14:11:57","guid":{"rendered":"https:\/\/foghosting.com\/20-netstat-commands-for-linux-network-management-\/"},"modified":"2025-02-19T14:11:57","modified_gmt":"2025-02-19T14:11:57","slug":"20-netstat-commands-for-linux-network-management","status":"publish","type":"post","link":"https:\/\/foghosting.com\/blog\/20-netstat-commands-for-linux-network-management\/","title":{"rendered":"20 Netstat Commands for Linux Network Management |"},"content":{"rendered":"<div>\n<p>The Management server, DNS server, host name, and default gateway network interfaces are configured. To add the hostname\/IP address automatically to the Management server, use the net set autohost command. It is also possible to set how long it takes before a lost carrier is reported. If you want to check whether your different settings are correct, you can run net show memory after executing multiple net set commands. Following the confirmation, you can restart your computer to take effect.<\/p>\n<p>Configure all items to static values or none to improve startup time in networks without DHCP servers. Use either Dynamic or Static addressing for all your settings (IP address, hostname, domain, etc.) instead of a mix.<\/p>\n<p>The Management server may take a while to start when any value is configured to be obtained through DHCP. In this article, we will learn the 20 netstat commands for Network management in Linux.<\/p>\n<h2><span id=\"What_is_Netstat_Command\">What is Netstat Command?<\/span><\/h2>\n<figure><\/figure>\n<p><strong>Netstat<\/strong> (network statistics) is a command-line tool that can be used to view information about incoming and outgoing network connections, routing tables, interface statistics, etc.<\/p>\n<p>In addition to operating systems based on Unix-like environments,<strong> netstat <\/strong>is also available on Windows. Performance measurements and network troubleshooting are very useful with it.<\/p>\n<p>You can use<strong> netstat<\/strong> to check which ports are open and if any programs are listening on them. It is one of the most basic tools for debugging network services.<\/p>\n<p>The <strong>netstat command in Linux<\/strong> has been replaced by the new ss command, which displays much more information about network connections and is faster than the older <strong>netstat <\/strong>command.<\/p>\n<p>For Linux system administrators and network administrators, the <strong>netstat<\/strong> tool is of great importance and great use in monitoring and troubleshooting network problems and determining network traffic performance.<\/p>\n<p>With examples, this article shows how the <strong>netstat command<\/strong> can be used in a day-to-day operation.<\/p>\n<h2><span id=\"List_of_Netstat_Commands_with_examples\">List of Netstat Commands with examples<\/span><\/h2>\n<figure><\/figure>\n<h3><span id=\"1_An_overview_of_all_TCP_and_UDP_connections_LISTENING\">1. An overview of all TCP and UDP connections LISTENING<\/span><\/h3>\n<p>Listing all TCP and UDP ports using the netstat -a option.<\/p>\n<pre><code># netstat -a | more<\/code><\/pre>\n<figure><\/figure>\n<p>A working Internet connection (servers and established)<\/p>\n<p>Proto Recv-Q Send-Q Local Address\u00a0 \u00a0 \u00a0 \u00a0 <strong>\u00a0\u00a0\u00a0<\/strong><strong>netstat foreign address<\/strong><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0State<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:sunrpc\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0 \u00a0 \u00a0 52 192.168.0.2:ssh \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 192.168.0.1:egs \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ESTABLISHED<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 1\u00a0 \u00a0 \u00a0 0 192.168.0.2:59292 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 www.gov.com:http\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CLOSE_WAIT<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 localhost:smtp\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:59482 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:35036 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:npmp-local\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<figure><\/figure>\n<p>(Servers and established) UNIX domain sockets<\/p>\n<p>Proto RefCnt Flags \u00a0 \u00a0 \u00a0 Type \u00a0 \u00a0 \u00a0 State \u00a0 \u00a0 \u00a0 \u00a0 I-Node Path<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 16972\u00a0 \/tmp\/orbit-root\/linc-76b-0-6fa08790553d6<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 17149\u00a0 \/tmp\/orbit-root\/linc-794-0-7058d584166d2<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 17161\u00a0 \/tmp\/orbit-root\/linc-792-0-546fe905321cc<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 15938\u00a0 \/tmp\/orbit-root\/linc-74b-0-415135cb6aeab<\/p>\n<h3><span id=\"2_Listing_TCP_Ports_connections\">2. Listing TCP Ports connections<\/span><\/h3>\n<p><strong>netstat usage <\/strong>-at to show only TCP (Transmission Control Protocol) port connections.<\/p>\n<pre><code># netstat -at<\/code><\/pre>\n<figure><\/figure>\n<p>Active Internet connections (servers and established)<\/p>\n<p>Proto Recv-Q Send-Q Local Address \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <strong>\u00a0\u00a0\u00a0<\/strong><strong>netstat foreign address<\/strong><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0State<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:ssh \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 localhost:ipp \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 localhost:smtp\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0 \u00a0 \u00a0 52 192.168.0.2:ssh \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 192.168.0.1:egs \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ESTABLISHED<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 1\u00a0 \u00a0 \u00a0 0 192.168.0.2:59292 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 www.gov.com:http\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CLOSE_WAIT<\/p>\n<h3><span id=\"3_Listing_UDP_Ports_connections\">3. Listing UDP Ports connections<\/span><\/h3>\n<p><strong>netstat usage<\/strong> -au, this command lists only UDP (User Datagram Protocol ) port connections.<\/p>\n<pre><code># netstat -au<\/code><\/pre>\n<figure><\/figure>\n<p>Active Internet connections (servers and established)<\/p>\n<p>Proto Recv-Q Send-Q Local Address\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <strong>\u00a0\u00a0<\/strong><strong>netstat foreign address<\/strong><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0State<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:35036 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:npmp-local\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:mdns\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<h3><span id=\"4_Listing_all_LISTENING_Connections\">4. Listing all LISTENING Connections<\/span><\/h3>\n<p>Netstat -l displays all active listening port connections.<\/p>\n<pre><code># netstat -l<\/code><\/pre>\n<figure><\/figure>\n<p>Active Internet connections (only servers)<\/p>\n<p>Proto Recv-Q Send-Q Local Address \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Foreign Address \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 State<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:sunrpc\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:58642 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:ssh \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:35036 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:npmp-local\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<p>Active UNIX domain sockets (only servers)<\/p>\n<p>Proto RefCnt Flags \u00a0 \u00a0 \u00a0 Type \u00a0 \u00a0 \u00a0 State \u00a0 \u00a0 \u00a0 \u00a0 I-Node Path<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 16972\u00a0 \/tmp\/orbit-root\/linc-76b-0-6fa08790553d6<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 17149\u00a0 \/tmp\/orbit-root\/linc-794-0-7058d584166d2<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 17161\u00a0 \/tmp\/orbit-root\/linc-792-0-546fe905321cc<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 15938\u00a0 \/tmp\/orbit-root\/linc-74b-0-415135cb6aeab<\/p>\n<h3><span id=\"5_Listing_all_TCP_Listening_Ports\">5. Listing all TCP Listening Ports<\/span><\/h3>\n<p>Use the option netstat -lt to list all active TCP ports.<\/p>\n<pre><code># netstat -lt<\/code><\/pre>\n<figure><\/figure>\n<p>Active Internet connections (only servers)<\/p>\n<p>Proto Recv-Q Send-Q Local Address \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Foreign Address \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 State<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:dctp\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:mysql \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:sunrpc\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:munin \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:ftp \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 localhost.localdomain:ipp \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 localhost.localdomain:smtp\u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:http\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:ssh \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:https \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<h3><span id=\"6_Listing_all_UDP_Listening_Ports\">6. Listing all UDP Listening Ports<\/span><\/h3>\n<p>The option netstat -lu lists all UDP ports that are actively listening.<\/p>\n<pre><code># netstat -lu<\/code><\/pre>\n<figure><\/figure>\n<p>Active Internet connections (only servers)<\/p>\n<p>Proto Recv-Q Send-Q Local Address \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Foreign Address \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 State<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:39578 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:meregister\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:vpps-qua\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:openvpn \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:mdns\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:sunrpc\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:ipp \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:60222 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<p>udp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:mdns\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:*<\/p>\n<h3><span id=\"7_Listing_all_UNIX_Listening_Ports\">7. Listing all UNIX Listening Ports<\/span><\/h3>\n<p>Listing all active UNIX listening ports using netstat -lx.<\/p>\n<pre><code># netstat -lx<\/code><\/pre>\n<figure><\/figure>\n<p>Active UNIX domain sockets (only servers)<\/p>\n<p>Proto RefCnt Flags \u00a0 \u00a0 \u00a0 Type \u00a0 \u00a0 \u00a0 State \u00a0 \u00a0 \u00a0 \u00a0 I-Node Path<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 4171 \u00a0 @ISCSIADM_ABSTRACT_NAMESPACE<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 5767 \u00a0 \/var\/run\/cups\/cups.sock<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 7082 \u00a0 @\/tmp\/fam-root-<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 6157 \u00a0 \/dev\/gpmctl<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 6215 \u00a0 @\/var\/run\/hald\/dbus-IcefTIUkHm<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 6038 \u00a0 \/tmp\/.font-unix\/fs7100<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 6175 \u00a0 \/var\/run\/avahi-daemon\/socket<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 4157 \u00a0 @ISCSID_UIP_ABSTRACT_NAMESPACE<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 60835836 \/var\/lib\/mysql\/mysql.sock<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 4645 \u00a0 \/var\/run\/audispd_events<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 5136 \u00a0 \/var\/run\/dbus\/system_bus_socket<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 6216 \u00a0 @\/var\/run\/hald\/dbus-wsUBI30V2I<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 5517 \u00a0 \/var\/run\/acpid.socket<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ACC ] \u00a0 \u00a0 STREAM \u00a0 \u00a0 LISTENING \u00a0 \u00a0 5531 \u00a0 \/var\/run\/pcscd.comm<\/p>\n<h3><span id=\"8_Showing_Statistics_by_Protocol\">8. Showing Statistics by Protocol<\/span><\/h3>\n<p>Displays statistics by protocol. By default, statistics are shown for the TCP, UDP, ICMP, and IP protocols. The -s parameter can be used to specify a set of protocols.<\/p>\n<pre><code># netstat -s<\/code><\/pre>\n<figure><\/figure>\n<p>Ip:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a02461 total packets received<\/p>\n<p>\u00a0\u00a0\u00a0\u00a00 forwarded<\/p>\n<p>\u00a0\u00a0\u00a0\u00a00 incoming packets discarded<\/p>\n<p>\u00a0\u00a0\u00a0\u00a02431 incoming packets delivered<\/p>\n<p>\u00a0\u00a0\u00a0\u00a02049 requests sent out<\/p>\n<figure><\/figure>\n<p>Icmp:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a00 ICMP messages received<\/p>\n<p>\u00a0\u00a0\u00a0\u00a00 input ICMP message failed.<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0ICMP input histogram:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a01 ICMP messages sent<\/p>\n<p>\u00a0\u00a0\u00a0\u00a00 ICMP messages failed<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0ICMP output histogram:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0destination unreachable: 1<\/p>\n<figure><\/figure>\n<p>Tcp:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0159 active connections openings<\/p>\n<p>\u00a0\u00a0\u00a0\u00a01 passive connection openings<\/p>\n<p>\u00a0\u00a0\u00a0\u00a04 failed connection attempts<\/p>\n<p>\u00a0\u00a0\u00a0\u00a00 connection resets received<\/p>\n<p>\u00a0\u00a0\u00a0\u00a01 connections established<\/p>\n<p>\u00a0\u00a0\u00a0\u00a02191 segments received<\/p>\n<p>\u00a0\u00a0\u00a0\u00a01745 segments send out<\/p>\n<p>\u00a0\u00a0\u00a0\u00a024 segments retransmited<\/p>\n<p>\u00a0\u00a0\u00a0\u00a00 bad segments received.<\/p>\n<p>\u00a0\u00a0\u00a0\u00a04 resets sent<\/p>\n<figure><\/figure>\n<p>Udp:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0243 packets received<\/p>\n<p>\u00a0\u00a0\u00a0\u00a01 packets to unknown port received.<\/p>\n<p>\u00a0\u00a0\u00a0\u00a00 packet receive errors<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0281 packets sent<\/p>\n<h3><span id=\"9_Showing_Statistics_by_TCP_Protocol\">9. Showing Statistics by TCP Protocol<\/span><\/h3>\n<p>Showing statistics of only TCP protocol by using option netstat -st.<\/p>\n<pre><code># netstat -st<\/code><\/pre>\n<figure><\/figure>\n<p>Tcp:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a02805201 active connections openings<\/p>\n<p>\u00a0\u00a0\u00a0\u00a01597466 passive connection openings<\/p>\n<p>\u00a0\u00a0\u00a0\u00a01522484 failed connection attempts<\/p>\n<p>\u00a0\u00a0\u00a0\u00a037806 connection resets received<\/p>\n<p>\u00a0\u00a0\u00a0\u00a01 connections established<\/p>\n<p>\u00a0\u00a0\u00a0\u00a057718706 segments received<\/p>\n<p>\u00a0\u00a0\u00a0\u00a064280042 segments send out<\/p>\n<p>\u00a0\u00a0\u00a0\u00a03135688 segments retransmited<\/p>\n<p>\u00a0\u00a0\u00a0\u00a074 bad segments received.<\/p>\n<p>\u00a0\u00a0\u00a0\u00a017580 resets sent<\/p>\n<h3><span id=\"10_Showing_Statistics_by_UDP_Protocol\">10. Showing Statistics by UDP Protocol<\/span><\/h3>\n<pre><code># netstat -su<\/code><\/pre>\n<figure><\/figure>\n<p>Udp:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a01774823 packets received<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0901848 packets to unknown port received.<\/p>\n<p>\u00a0\u00a0\u00a0\u00a00 packet receive errors<\/p>\n<p>\u00a0\u00a0\u00a0\u00a02968722 packets sent<\/p>\n<h3><span id=\"11_Displaying_Service_name_with_PID\">11. Displaying Service name with PID<\/span><\/h3>\n<p>Displaying service name with their PID number, using option netstat -tp will display \u201cPID\/Program Name\u201c.<\/p>\n<pre><code># netstat -tp<\/code><\/pre>\n<figure><\/figure>\n<p>Active Internet connections (w\/o servers)<\/p>\n<p>Proto Recv-Q Send-Q Local Address \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Foreign Address \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 State \u00a0 \u00a0 \u00a0 PID\/Program name<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 192.168.0.2:ssh \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 192.168.0.1:egs \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ESTABLISHED 2179\/sshd<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 1\u00a0 \u00a0 \u00a0 0 192.168.0.2:59292 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 www.gov.com:http\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CLOSE_WAIT\u00a0 1939\/clock-applet<\/p>\n<h3><span id=\"12_Displaying_Promiscuous_Mode\">12. Displaying Promiscuous Mode<\/span><\/h3>\n<p>When using the -ac switch, you can display promiscuous mode or refresh the screen every five seconds. It is set to refresh every second by default.<\/p>\n<pre><code># netstat -ac 5 | grep tcp<\/code><\/pre>\n<figure><\/figure>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:sunrpc\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:58642 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:ssh \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 localhost:ipp \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 localhost:smtp\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 1\u00a0 \u00a0 \u00a0 0 192.168.0.2:59447 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 www.gov.com:http\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CLOSE_WAIT<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0 \u00a0 \u00a0 52 192.168.0.2:ssh \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 192.168.0.1:egs \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ESTABLISHED<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:sunrpc\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:ssh \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 localhost:ipp \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 localhost:smtp\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:59482 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN<\/p>\n<h3><span id=\"13_Displaying_Kernel_IP_routing\">13. Displaying Kernel IP routing<\/span><\/h3>\n<p>With the netstat and route commands, you can display the kernel IP routing table.<\/p>\n<pre><code># netstat -r<\/code><\/pre>\n<figure><\/figure>\n<p>Kernel IP routing table<\/p>\n<p>Destination \u00a0 \u00a0 Gateway \u00a0 \u00a0 \u00a0 \u00a0 Genmask \u00a0 \u00a0 \u00a0 \u00a0 Flags \u00a0 MSS Window\u00a0 irtt Iface<\/p>\n<p>192.168.0.0 \u00a0 \u00a0 * \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 255.255.255.0 \u00a0 U \u00a0 \u00a0 \u00a0 \u00a0 0 0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0 eth0<\/p>\n<p>link-local\u00a0 \u00a0 \u00a0 * \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 255.255.0.0 \u00a0 \u00a0 U \u00a0 \u00a0 \u00a0 \u00a0 0 0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0 eth0<\/p>\n<p>default \u00a0 \u00a0 \u00a0 \u00a0 192.168.0.1 \u00a0 \u00a0 0.0.0.0 \u00a0 \u00a0 \u00a0 \u00a0 UG\u00a0 \u00a0 \u00a0 \u00a0 0 0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0 eth0<\/p>\n<h3><span id=\"14_Showing_Network_Interface_Transactions\">14. Showing Network Interface Transactions<\/span><\/h3>\n<p>Displays both the transferring and receiving packet transactions for the network interface.<\/p>\n<pre><code># netstat -i<\/code><\/pre>\n<figure><\/figure>\n<p>rdp<\/p>\n<p>Kernel Interface table<\/p>\n<p>Iface \u00a0 \u00a0 \u00a0 MTU Met\u00a0 \u00a0 RX-OK RX-ERR RX-DRP RX-OVR\u00a0 \u00a0 TX-OK TX-ERR TX-DRP TX-OVR Flg<\/p>\n<p>eth0 \u00a0 \u00a0 \u00a0 1500 \u00a0 0 \u00a0 \u00a0 4459\u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 \u00a0 \u00a0 4057\u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 BMRU<\/p>\n<p>lo\u00a0 \u00a0 \u00a0 \u00a0 16436 \u00a0 0\u00a0 \u00a0 \u00a0 \u00a0 8\u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 \u00a0 8\u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 LRU<\/p>\n<h3><span id=\"15_Showing_Kernel_Interface_Table\">15. Showing Kernel Interface Table<\/span><\/h3>\n<p>Like ifconfig, this command displays the kernel interface table.<\/p>\n<pre><code># netstat -ie<\/code><\/pre>\n<figure><\/figure>\n<p>Kernel Interface table<\/p>\n<p>eth0\u00a0 \u00a0 \u00a0 Link encap:Ethernet\u00a0 HWaddr 00:0C:29:B4:DA:21<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0inet addr:192.168.0.2\u00a0 Bcast:192.168.0.255\u00a0 Mask:255.255.255.0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0inet6 addr: fe80::20c:29ff:feb4:da21\/64 Scope:Link<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0UP BROADCAST RUNNING MULTICAST\u00a0 MTU:1500\u00a0 Metric:1<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0RX packets:4486 errors:0 dropped:0 overruns:0 frame:0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0TX packets:4077 errors:0 dropped:0 overruns:0 carrier:0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0collisions:0 txqueuelen:1000<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0RX bytes:2720253 (2.5 MiB)\u00a0 TX bytes:1161745 (1.1 MiB)<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Interrupt:18 Base address:0x2000<\/p>\n<figure><\/figure>\n<p>lo\u00a0 \u00a0 \u00a0 \u00a0 Link encap:Local Loopback<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0inet addr:127.0.0.1\u00a0 Mask:255.0.0.0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0inet6 addr: ::1\/128 Scope:Host<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0UP LOOPBACK RUNNING\u00a0 MTU:16436\u00a0 Metric:1<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0RX packets:8 errors:0 dropped:0 overruns:0 frame:0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0TX packets:8 errors:0 dropped:0 overruns:0 carrier:0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0collisions:0 txqueuelen:0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0RX bytes:480 (480.0 b)\u00a0 TX bytes:480 (480.0 b)<\/p>\n<h3><span id=\"16_Displaying_IPv4_and_IPv6_Information\">16. Displaying IPv4 and IPv6 Information<\/span><\/h3>\n<p>Information about multicast group membership is displayed for both IPv4 and IPv6.<\/p>\n<pre><code># netstat -g<\/code><\/pre>\n<figure><\/figure>\n<p>IPv6\/IPv4 Group Memberships<\/p>\n<p>Interface \u00a0 \u00a0 \u00a0 RefCnt Group<\/p>\n<p>\u2014\u2014\u2014\u2014\u2014 \u2014\u2014 \u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n<p>lo\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1\u00a0 \u00a0 \u00a0 all-systems.mcast.net<\/p>\n<p>eth0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1\u00a0 \u00a0 \u00a0 224.0.0.251<\/p>\n<p>eth0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1\u00a0 \u00a0 \u00a0 all-systems.mcast.net<\/p>\n<p>lo\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1\u00a0 \u00a0 \u00a0 ff02::1<\/p>\n<p>eth0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1\u00a0 \u00a0 \u00a0 ff02::202<\/p>\n<p>eth0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1\u00a0 \u00a0 \u00a0 ff02::1:ffb4:da21<\/p>\n<p>eth0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1\u00a0 \u00a0 \u00a0 ff02::1<\/p>\n<h3><span id=\"17_Print_Netstat_Information_Continuously\">17. Print Netstat Information Continuously<\/span><\/h3>\n<p>Using the following command will print network statistics every few seconds, so you can get it continuously.<\/p>\n<pre><code># netstat -c<\/code><\/pre>\n<figure><\/figure>\n<p>Active Internet connections (w\/o servers)<\/p>\n<p>Proto Recv-Q Send-Q Local Address \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Foreign Address \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 State<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 tecmint.com:http \u00a0 sg2nlhg007.shr.prod.s:36944 TIME_WAIT<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 tecmint.com:http \u00a0 sg2nlhg010.shr.prod.s:42110 TIME_WAIT<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 132 tecmint.com:ssh\u00a0 \u00a0 115.113.134.3.static-:64662 ESTABLISHED<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 tecmint.com:http \u00a0 crawl-66-249-71-240.g:41166 TIME_WAIT<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 localhost.localdomain:54823 localhost.localdomain:smtp\u00a0 TIME_WAIT<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 localhost.localdomain:54822 localhost.localdomain:smtp\u00a0 TIME_WAIT<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 tecmint.com:http \u00a0 sg2nlhg010.shr.prod.s:42091 TIME_WAIT<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 tecmint.com:http \u00a0 sg2nlhg007.shr.prod.s:36998 TIME_WAIT<\/p>\n<h3><span id=\"18_Finding_non-supportive_Address\">18. Finding non-supportive Address<\/span><\/h3>\n<p>Finding un-configured address families with some useful information.<\/p>\n<pre><code># netstat --verbose<\/code><\/pre>\n<figure><\/figure>\n<p>netstat: no support for `AF IPX\u2019 on this system.<\/p>\n<p>netstat: no support for `AF AX25\u2032 on this system.<\/p>\n<p>netstat: no support for `AF X25\u2032 on this system.<\/p>\n<p>netstat: no support for `AF NETROM\u2019 on this system.<\/p>\n<h3><span id=\"19_Finding_Listening_Programs\">19. Finding Listening Programs<\/span><\/h3>\n<p>You can find out how many programs are listening on a port.<\/p>\n<p># netstat -ap | grep http<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:http\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN\u00a0 \u00a0 \u00a0 9056\/httpd<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 *:https \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 *:* \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LISTEN\u00a0 \u00a0 \u00a0 9056\/httpd<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 tecmint.com:http \u00a0 sg2nlhg008.shr.prod.s:35248 TIME_WAIT \u00a0 \u2013<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 tecmint.com:http \u00a0 sg2nlhg007.shr.prod.s:57783 TIME_WAIT \u00a0 \u2013<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 tecmint.com:http \u00a0 sg2nlhg007.shr.prod.s:57769 TIME_WAIT \u00a0 \u2013<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 tecmint.com:http \u00a0 sg2nlhg008.shr.prod.s:35270 TIME_WAIT \u00a0 \u2013<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 tecmint.com:http \u00a0 sg2nlhg009.shr.prod.s:41637 TIME_WAIT \u00a0 \u2013<\/p>\n<p>tcp\u00a0 \u00a0 \u00a0 \u00a0 0\u00a0 \u00a0 \u00a0 0 tecmint.com:http \u00a0 sg2nlhg009.shr.prod.s:41614 TIME_WAIT \u00a0 \u2013<\/p>\n<p>unix\u00a0 2\u00a0 \u00a0 \u00a0 [ ] \u00a0 \u00a0 \u00a0 \u00a0 STREAM \u00a0 \u00a0 CONNECTED \u00a0 \u00a0 88586726 10394\/httpd<\/p>\n<h3><span id=\"20_Displaying_RAW_Network_Statistics\">20. Displaying RAW Network Statistics<\/span><\/h3>\n<pre><code># netstat --statistics --raw<\/code><\/pre>\n<figure><\/figure>\n<p>Ip:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a062175683 total packets received<\/p>\n<p>\u00a0\u00a0\u00a0\u00a052970 with invalid addresses<\/p>\n<p>\u00a0\u00a0\u00a0\u00a00 forwarded<\/p>\n<figure><\/figure>\n<p>Icmp:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0875519 ICMP messages received<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0destination unreachable: 901671<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0echo request: 8<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0echo replies: 16253<\/p>\n<p>IcmpMsg:<\/p>\n<figure><\/figure>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0InType0: 83<\/p>\n<p>IpExt:<\/p>\n<figure><\/figure>\n<p>\u00a0\u00a0\u00a0\u00a0InMcastPkts: 117<\/p>\n<p>You can further explore the netstat command by consulting the netstat manual docs or using the man netstat command to learn more.<\/p>\n<p>Also Read: How to Set Environment Variables in Linux?<\/p>\n<p>Please let us know of any missing items in the list by contacting . Based on your queries, we can continue to update this list.<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The Management server, DNS server, host name, and default gateway network interfaces are configured. To add the hostname\/IP address automatically to the Management server, use the net set autohost command. It is also possible to set how long it takes before a lost carrier is reported. If you want to check whether your different settings<\/p>\n","protected":false},"author":3,"featured_media":3076,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[17],"tags":[],"class_list":["post-3160","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dedicated-servers"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/foghosting.com\/blog\/wp-json\/wp\/v2\/posts\/3160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/foghosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/foghosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/foghosting.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/foghosting.com\/blog\/wp-json\/wp\/v2\/comments?post=3160"}],"version-history":[{"count":0,"href":"https:\/\/foghosting.com\/blog\/wp-json\/wp\/v2\/posts\/3160\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/foghosting.com\/blog\/wp-json\/wp\/v2\/media\/3076"}],"wp:attachment":[{"href":"https:\/\/foghosting.com\/blog\/wp-json\/wp\/v2\/media?parent=3160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/foghosting.com\/blog\/wp-json\/wp\/v2\/categories?post=3160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/foghosting.com\/blog\/wp-json\/wp\/v2\/tags?post=3160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}