Netstat Command In Linux

Chapter: Linux Commands Last Updated: 13-08-2019 12:47:05 UTC

Program:

            /* ............... START ............... */
                
/* netstat -r used to get kernel routing information. */
$ netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
default         _gateway        0.0.0.0         UG        0 0          0 eth0
192.168.72.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0


/* netstat -i Show the list of network interfaces */
$ netstat -i
Kernel Interface table
Iface        MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0        1500   194689      0      0 0         75486      0      0      0 BMRU
lo          65536      194      0      0 0           194      0      0      0 LRU
                /* ............... END ............... */
        

Output


            Netstat Command In Linux
        

Notes:

  • Linux netstat is a command-line tool that displays network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.
  • netstat -r is the commonly used command to get the kernel routing information.
  • netstat -a will show both listening and non-listening sockets.
  • netstat -au command will show all UDP ports.
  • netstat -at will provide the active TCP connection port.
  • netstat -l is used to list only the listening ports.
  • netstat -lt is used to list only the listening tcp ports.
  • netstat -s linux command list the statistics for all ports.
Similar Programs Chapter Last Updated
Linux Version Command Linux Commands 01-12-2020
Unzip Command In Linux Linux Commands 20-11-2019
Process Command In Linux Linux Commands 16-11-2019
Linux Command To Create Link Linux Commands 15-11-2019
Linux Command To View File Content Linux Commands 25-10-2019
Linux Command To Check OS Version Linux Commands 25-10-2019
Telnet Command In Linux Linux Commands 13-08-2019
Linux Command To Create A File Linux Commands 23-05-2019
Linux echo Command Linux Commands 05-05-2018
Linux Ping Command Linux Commands 05-05-2018
Linux ls (List Directory) Command Linux Commands 17-03-2018

1