3

netstat command is useful to,

Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.

Now, I was reading about the Linux performance which is depicted in a nice pictorial view from here.

How is netstat command used in various levels of networking as depicted in the performance diagram in the referenced question?

Ramesh
  • 39,297

1 Answers1

2

Let us look into the performance diagram to understand the various layers in which netstat command is useful for debugging.

enter image description here

Ethernet

netstat -in command is used in this layer where -i flag is used to display a table of all network interfaces, or the specified iface.

IP

netstat -an command is used in this layer where -a flag is used to show both listening and non-listening (for TCP this means established connections) sockets.

TCP/UDP

netstat -at is used to display either TCP or UDP connections. TCP and UDP protocols are used in the transport layer.

Sockets

netstat -p is used to show which processes are using which sockets.

Ramesh
  • 39,297