netstat command
Netstat Command : The netstat command is a Command Prompt command used to display very detailed information about how your computer is communicating with other computers or network devices.
Specifically, the netstat command can show details about individual network connections, overall and protocol-specific networking statistics, and much more, all of which could help troubleshoot certain kinds of networking issues.
mukhtar@mukhtar-Lenovo-B490:~$ netstat -s -p tcp -f
netstat: invalid option -- 'f'
usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}
netstat [-vWnNcaeol] [<Socket> ...]
netstat { [-vWeenNac] -i | [-cWnNe] -M | -s }
-r, --route display routing table
-i, --interfaces display interface table
-g, --groups display multicast group memberships
-s, --statistics display networking statistics (like SNMP)
-M, --masquerade display masqueraded connections
-v, --verbose be verbose
-W, --wide don't truncate IP addresses
-n, --numeric don't resolve names
--numeric-hosts don't resolve host names
--numeric-ports don't resolve port names
--numeric-users don't resolve user names
-N, --symbolic resolve hardware names
-e, --extend display other/more information
-p, --programs display PID/Program name for sockets
-c, --continuous continuous listing
-l, --listening display listening server sockets
-a, --all, --listening display all sockets (default: connected)
-o, --timers display timers
-F, --fib display Forwarding Information Base (default)
-C, --cache display routing cache instead of FIB
<Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom
<AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: inet
List of possible address families (which support routing):
inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
x25 (CCITT X.25)
mukhtar@mukhtar-Lenovo-B490:~$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default 172.16.16.1 0.0.0.0 UG 0 0 0 enp3s0
default 192.168.0.1 0.0.0.0 UG 0 0 0 wlp2s0
link-local * 255.255.0.0 U 0 0 0 wlp2s0
172.16.0.0 * 255.255.0.0 U 0 0 0 enp3s0
192.168.0.0 * 255.255.255.0 U 0 0 0 wlp2s0
mukhtar@mukhtar-Lenovo-B490:~$ netstat -i
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
enp3s0 1500 0 282610 0 754 0 5994 0 0 0 BMRU
lo 65536 0 2342 0 0 0 2342 0 0 0 LRU
wlp2s0 1500 0 5563 0 0 0 4631 0 0 0 BMRU
mukhtar@mukhtar-Lenovo-B490:~$ netstat -g
IPv6/IPv4 Group Memberships
Interface RefCnt Group
--------------- ------ ---------------------
lo 1 all-systems.mcast.net
enp3s0 2 224.0.0.251
enp3s0 1 all-systems.mcast.net
wlp2s0 2 224.0.0.251
wlp2s0 1 all-systems.mcast.net
lo 1 ip6-allnodes
lo 1 ff01::1
enp3s0 2 ff02::fb
enp3s0 1 ff02::1:ff40:8aaf
enp3s0 1 ip6-allnodes
enp3s0 1 ff01::1
wlp2s0 2 ff02::fb
wlp2s0 1 ff02::1:ff98:b9a9
wlp2s0 1 ip6-allnodes
wlp2s0 1 ff01::1
mukhtar@mukhtar-Lenovo-B490:~$ netstat -s
Ip:
200485 total packets received
1678 with invalid addresses
0 forwarded
37 with unknown protocol
0 incoming packets discarded
170772 incoming packets delivered
12785 requests sent out
268 outgoing packets dropped
2 dropped because of missing route
Icmp:
813 ICMP messages received
20 input ICMP message failed.
ICMP input histogram:
destination unreachable: 704
timeout in transit: 77
echo replies: 32
797 ICMP messages sent
0 ICMP messages failed
ICMP output histogram:
destination unreachable: 709
echo request: 88
IcmpMsg:
InType0: 32
InType3: 704
InType11: 77
OutType3: 709
OutType8: 88
Tcp:
342 active connections openings
1 passive connection openings
3 failed connection attempts
87 connection resets received
17 connections established
8574 segments received
7743 segments send out
236 segments retransmited
7 bad segments received.
79 resets sent
Udp:
149553 packets received
656 packets to unknown port received.
0 packet receive errors
4023 packets sent
IgnoredMulti: 46892
UdpLite:
TcpExt:
75 TCP sockets finished time wait in fast timer
322 delayed acks sent
1 delayed acks further delayed because of locked socket
Quick ack mode was activated 103 times
31 packets directly queued to recvmsg prequeue.
1517 bytes directly received in process context from prequeue
5513 packet headers predicted
3 packets header predicted and directly queued to user
1105 acknowledgments not containing data payload received
244 predicted acknowledgments
7 congestion windows recovered without slow start after partial ack
39 other TCP timeouts
TCPLossProbes: 36
TCPLossProbeRecovery: 1
103 DSACKs sent for old packets
74 connections reset due to early user close
10 connections aborted due to timeout
IPReversePathFilter: 3353
TCPRcvCoalesce: 602
TCPOFOQueue: 341
TCPChallengeACK: 6
TCPSYNChallenge: 7
TCPSpuriousRtxHostQueues: 2
TCPAutoCorking: 50
TCPSynRetrans: 24
TCPOrigDataSent: 1315
TCPACKSkippedChallenge: 1
TCPKeepAlive: 267
IpExt:
InMcastPkts: 110590
OutMcastPkts: 297
InBcastPkts: 47042
OutBcastPkts: 8
InOctets: 36772201
OutOctets: 1816672
InMcastOctets: 19331339
OutMcastOctets: 47657
InBcastOctets: 4005758
OutBcastOctets: 624
InNoECTPkts: 201065
InECT0Pkts: 8
mukhtar@mukhtar-Lenovo-B490:~$ netstat -M
netstat: no support for `ip_masquerade' on this system.
mukhtar@mukhtar-Lenovo-B490:~$ netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 mukhtar-Lenovo-B:domain *:* LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 ip6-localhost:ipp [::]:* LISTEN
udp 0 0 *:mdns *:*
udp 0 0 *:mdns *:*
udp 0 0 *:mdns *:*
udp 0 0 *:45082 *:*
udp 0 0 mukhtar-Lenovo-B:domain *:*
udp 0 0 *:bootpc *:*
udp 0 0 *:ipp *:*
udp 0 0 *:37588 *:*
udp 0 0 *:50243 *:*
udp6 0 0 [::]:mdns [::]:*
udp6 0 0 [::]:mdns [::]:*
udp6 0 0 [::]:mdns [::]:*
udp6 0 0 [::]:39048 [::]:*
raw6 0 0 [::]:ipv6-icmp [::]:* 7
raw6 0 0 [::]:ipv6-icmp [::]:* 7
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 28743 @/tmp/.ICE-unix/2475
unix 2 [ ACC ] STREAM LISTENING 27165 /run/user/1000/systemd/private
unix 2 [ ACC ] SEQPACKET LISTENING 14539 /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 23418 /run/user/1000/keyring/control
unix 2 [ ACC ] STREAM LISTENING 22840 /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 28744 /tmp/.ICE-unix/2475
unix 2 [ ACC ] STREAM LISTENING 26280 /run/user/1000/keyring/pkcs11
unix 2 [ ACC ] STREAM LISTENING 26282 /run/user/1000/keyring/ssh
unix 2 [ ACC ] STREAM LISTENING 47866 @mukhtar-com.canonical.Unity.Scope.scopes.T43203933616972
unix 2 [ ACC ] STREAM LISTENING 27574 /run/user/1000/pulse/native
unix 2 [ ACC ] STREAM LISTENING 40686 /tmp/.com.google.Chrome.gDe0Au/SingletonSocket
unix 2 [ ACC ] STREAM LISTENING 22839 @/tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 47865 @mukhtar-com.canonical.Unity.Scope.applications.T43203919412597
unix 2 [ ACC ] STREAM LISTENING 14523 /run/systemd/private
unix 2 [ ACC ] STREAM LISTENING 14537 /run/systemd/journal/stdout
unix 2 [ ACC ] STREAM LISTENING 14553 /run/systemd/fsck.progress
unix 2 [ ACC ] STREAM LISTENING 47063 @mukhtar-com.canonical.Unity.Scope.files.T43197782704404
unix 2 [ ACC ] STREAM LISTENING 20563 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 20564 /var/run/avahi-daemon/socket
unix 2 [ ACC ] STREAM LISTENING 20565 /run/snapd.socket
unix 2 [ ACC ] STREAM LISTENING 20566 /run/snapd-snap.socket
unix 2 [ ACC ] STREAM LISTENING 20567 /run/acpid.socket
unix 2 [ ACC ] STREAM LISTENING 20568 /var/run/cups/cups.sock
unix 2 [ ACC ] STREAM LISTENING 20569 /run/uuidd/request
unix 2 [ ACC ] STREAM LISTENING 24492 @/tmp/dbus-JRJ6EcCaOG
unix 2 [ ACC ] STREAM LISTENING 23447 @/com/ubuntu/upstart-session/1000/2207
unix 2 [ ACC ] STREAM LISTENING 23537 /home/mukhtar/.gnupg/S.gpg-agent
unix 2 [ ACC ] STREAM LISTENING 47851 @mukhtar-com.canonical.Unity.Master.Scope.files.T43196890137003
unix 2 [ ACC ] STREAM LISTENING 23527 /var/run/NetworkManager/private-dhcp
unix 2 [ ACC ] STREAM LISTENING 26308 @/tmp/ibus/dbus-D3vI1Ach
unix 2 [ ACC ] STREAM LISTENING 47850 @mukhtar-com.canonical.Unity.Master.Scope.applications.T43196882157128
unix 2 [ ACC ] STREAM LISTENING 23466 @/tmp/dbus-awTkDi4hED
Specifically, the netstat command can show details about individual network connections, overall and protocol-specific networking statistics, and much more, all of which could help troubleshoot certain kinds of networking issues.
mukhtar@mukhtar-Lenovo-B490:~$ netstat -s -p tcp -f
netstat: invalid option -- 'f'
usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}
netstat [-vWnNcaeol] [<Socket> ...]
netstat { [-vWeenNac] -i | [-cWnNe] -M | -s }
-r, --route display routing table
-i, --interfaces display interface table
-g, --groups display multicast group memberships
-s, --statistics display networking statistics (like SNMP)
-M, --masquerade display masqueraded connections
-v, --verbose be verbose
-W, --wide don't truncate IP addresses
-n, --numeric don't resolve names
--numeric-hosts don't resolve host names
--numeric-ports don't resolve port names
--numeric-users don't resolve user names
-N, --symbolic resolve hardware names
-e, --extend display other/more information
-p, --programs display PID/Program name for sockets
-c, --continuous continuous listing
-l, --listening display listening server sockets
-a, --all, --listening display all sockets (default: connected)
-o, --timers display timers
-F, --fib display Forwarding Information Base (default)
-C, --cache display routing cache instead of FIB
<Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom
<AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: inet
List of possible address families (which support routing):
inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
x25 (CCITT X.25)
mukhtar@mukhtar-Lenovo-B490:~$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default 172.16.16.1 0.0.0.0 UG 0 0 0 enp3s0
default 192.168.0.1 0.0.0.0 UG 0 0 0 wlp2s0
link-local * 255.255.0.0 U 0 0 0 wlp2s0
172.16.0.0 * 255.255.0.0 U 0 0 0 enp3s0
192.168.0.0 * 255.255.255.0 U 0 0 0 wlp2s0
mukhtar@mukhtar-Lenovo-B490:~$ netstat -i
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
enp3s0 1500 0 282610 0 754 0 5994 0 0 0 BMRU
lo 65536 0 2342 0 0 0 2342 0 0 0 LRU
wlp2s0 1500 0 5563 0 0 0 4631 0 0 0 BMRU
mukhtar@mukhtar-Lenovo-B490:~$ netstat -g
IPv6/IPv4 Group Memberships
Interface RefCnt Group
--------------- ------ ---------------------
lo 1 all-systems.mcast.net
enp3s0 2 224.0.0.251
enp3s0 1 all-systems.mcast.net
wlp2s0 2 224.0.0.251
wlp2s0 1 all-systems.mcast.net
lo 1 ip6-allnodes
lo 1 ff01::1
enp3s0 2 ff02::fb
enp3s0 1 ff02::1:ff40:8aaf
enp3s0 1 ip6-allnodes
enp3s0 1 ff01::1
wlp2s0 2 ff02::fb
wlp2s0 1 ff02::1:ff98:b9a9
wlp2s0 1 ip6-allnodes
wlp2s0 1 ff01::1
mukhtar@mukhtar-Lenovo-B490:~$ netstat -s
Ip:
200485 total packets received
1678 with invalid addresses
0 forwarded
37 with unknown protocol
0 incoming packets discarded
170772 incoming packets delivered
12785 requests sent out
268 outgoing packets dropped
2 dropped because of missing route
Icmp:
813 ICMP messages received
20 input ICMP message failed.
ICMP input histogram:
destination unreachable: 704
timeout in transit: 77
echo replies: 32
797 ICMP messages sent
0 ICMP messages failed
ICMP output histogram:
destination unreachable: 709
echo request: 88
IcmpMsg:
InType0: 32
InType3: 704
InType11: 77
OutType3: 709
OutType8: 88
Tcp:
342 active connections openings
1 passive connection openings
3 failed connection attempts
87 connection resets received
17 connections established
8574 segments received
7743 segments send out
236 segments retransmited
7 bad segments received.
79 resets sent
Udp:
149553 packets received
656 packets to unknown port received.
0 packet receive errors
4023 packets sent
IgnoredMulti: 46892
UdpLite:
TcpExt:
75 TCP sockets finished time wait in fast timer
322 delayed acks sent
1 delayed acks further delayed because of locked socket
Quick ack mode was activated 103 times
31 packets directly queued to recvmsg prequeue.
1517 bytes directly received in process context from prequeue
5513 packet headers predicted
3 packets header predicted and directly queued to user
1105 acknowledgments not containing data payload received
244 predicted acknowledgments
7 congestion windows recovered without slow start after partial ack
39 other TCP timeouts
TCPLossProbes: 36
TCPLossProbeRecovery: 1
103 DSACKs sent for old packets
74 connections reset due to early user close
10 connections aborted due to timeout
IPReversePathFilter: 3353
TCPRcvCoalesce: 602
TCPOFOQueue: 341
TCPChallengeACK: 6
TCPSYNChallenge: 7
TCPSpuriousRtxHostQueues: 2
TCPAutoCorking: 50
TCPSynRetrans: 24
TCPOrigDataSent: 1315
TCPACKSkippedChallenge: 1
TCPKeepAlive: 267
IpExt:
InMcastPkts: 110590
OutMcastPkts: 297
InBcastPkts: 47042
OutBcastPkts: 8
InOctets: 36772201
OutOctets: 1816672
InMcastOctets: 19331339
OutMcastOctets: 47657
InBcastOctets: 4005758
OutBcastOctets: 624
InNoECTPkts: 201065
InECT0Pkts: 8
mukhtar@mukhtar-Lenovo-B490:~$ netstat -M
netstat: no support for `ip_masquerade' on this system.
mukhtar@mukhtar-Lenovo-B490:~$ netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 mukhtar-Lenovo-B:domain *:* LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 ip6-localhost:ipp [::]:* LISTEN
udp 0 0 *:mdns *:*
udp 0 0 *:mdns *:*
udp 0 0 *:mdns *:*
udp 0 0 *:45082 *:*
udp 0 0 mukhtar-Lenovo-B:domain *:*
udp 0 0 *:bootpc *:*
udp 0 0 *:ipp *:*
udp 0 0 *:37588 *:*
udp 0 0 *:50243 *:*
udp6 0 0 [::]:mdns [::]:*
udp6 0 0 [::]:mdns [::]:*
udp6 0 0 [::]:mdns [::]:*
udp6 0 0 [::]:39048 [::]:*
raw6 0 0 [::]:ipv6-icmp [::]:* 7
raw6 0 0 [::]:ipv6-icmp [::]:* 7
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 28743 @/tmp/.ICE-unix/2475
unix 2 [ ACC ] STREAM LISTENING 27165 /run/user/1000/systemd/private
unix 2 [ ACC ] SEQPACKET LISTENING 14539 /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 23418 /run/user/1000/keyring/control
unix 2 [ ACC ] STREAM LISTENING 22840 /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 28744 /tmp/.ICE-unix/2475
unix 2 [ ACC ] STREAM LISTENING 26280 /run/user/1000/keyring/pkcs11
unix 2 [ ACC ] STREAM LISTENING 26282 /run/user/1000/keyring/ssh
unix 2 [ ACC ] STREAM LISTENING 47866 @mukhtar-com.canonical.Unity.Scope.scopes.T43203933616972
unix 2 [ ACC ] STREAM LISTENING 27574 /run/user/1000/pulse/native
unix 2 [ ACC ] STREAM LISTENING 40686 /tmp/.com.google.Chrome.gDe0Au/SingletonSocket
unix 2 [ ACC ] STREAM LISTENING 22839 @/tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 47865 @mukhtar-com.canonical.Unity.Scope.applications.T43203919412597
unix 2 [ ACC ] STREAM LISTENING 14523 /run/systemd/private
unix 2 [ ACC ] STREAM LISTENING 14537 /run/systemd/journal/stdout
unix 2 [ ACC ] STREAM LISTENING 14553 /run/systemd/fsck.progress
unix 2 [ ACC ] STREAM LISTENING 47063 @mukhtar-com.canonical.Unity.Scope.files.T43197782704404
unix 2 [ ACC ] STREAM LISTENING 20563 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 20564 /var/run/avahi-daemon/socket
unix 2 [ ACC ] STREAM LISTENING 20565 /run/snapd.socket
unix 2 [ ACC ] STREAM LISTENING 20566 /run/snapd-snap.socket
unix 2 [ ACC ] STREAM LISTENING 20567 /run/acpid.socket
unix 2 [ ACC ] STREAM LISTENING 20568 /var/run/cups/cups.sock
unix 2 [ ACC ] STREAM LISTENING 20569 /run/uuidd/request
unix 2 [ ACC ] STREAM LISTENING 24492 @/tmp/dbus-JRJ6EcCaOG
unix 2 [ ACC ] STREAM LISTENING 23447 @/com/ubuntu/upstart-session/1000/2207
unix 2 [ ACC ] STREAM LISTENING 23537 /home/mukhtar/.gnupg/S.gpg-agent
unix 2 [ ACC ] STREAM LISTENING 47851 @mukhtar-com.canonical.Unity.Master.Scope.files.T43196890137003
unix 2 [ ACC ] STREAM LISTENING 23527 /var/run/NetworkManager/private-dhcp
unix 2 [ ACC ] STREAM LISTENING 26308 @/tmp/ibus/dbus-D3vI1Ach
unix 2 [ ACC ] STREAM LISTENING 47850 @mukhtar-com.canonical.Unity.Master.Scope.applications.T43196882157128
unix 2 [ ACC ] STREAM LISTENING 23466 @/tmp/dbus-awTkDi4hED
Comments
Post a Comment