当前位置:网站首页>Netstat command – displays network status

Netstat command – displays network status

2022-06-25 05:59:00 ProYuan28

netstat The command is used to display various network related information , Such as network connection , Routing table , Interface status (Interface Statistics),masquerade Connect , Multicast members (Multicast Memberships) wait .

On the whole ,netstat The output of can be divided into two parts : One is Active Internet connections, Called active TCP Connect , among ”Recv-Q” and ”Send-Q” finger %0A The receiving and sending queues . These numbers should generally be 0. If not, the package is piling up in the queue . This can only be seen in very few cases ; The other is Active UNIX domain sockets, Called active Unix Domain socket interface ( Like a network socket , But only for native communication , Performance can be doubled ).

Grammar format :netstat [ Parameters ]

Common parameters :

-a Show... In all connections Socket
-p Display in use Socket Program identification code and program name
-u Show UDP The connection status of the transport protocol
-i Display the web interface information form
-n Use it directly IP Address , Not through the domain name server

Reference examples

Show detailed network status :

[[email protected] ~]# netstat -a

Display registered residence UDP Connection status :

[[email protected] ~]# netstat -nu

Show UDP Usage of port number :

[[email protected] ~]# netstat -apu 
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address  Foreign Address  State  PID/Program name    
udp        0      0 0.0.0.0:bootpc          0.0.0.0:*      4000/dhclient       
udp        0      0 localhost:323           0.0.0.0:*      3725/chronyd        
udp6       0      0 localhost:323           [::]:*         3725/chronyd 

Show network card list :

[[email protected] ~]# 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 
eth0 1500   0  181864   0      0       0     141278   0     0     0    BMRU 
lo   16436  0   3362    0      0       0     3362     0     0     0    LRU

Show multicast group relationships :

[[email protected] ~]# netstat -g 
IPv6/IPv4 Group Memberships Interface    
RefCnt Group 
--------------- ------ --------------------- 
lo        1   ALL-SYSTEMS.MCAST.NET 
eth0      1   ALL-SYSTEMS.MCAST.NET lo       1   ff02::1 
eth0      1   ff02::1:ff0a:b0c eth0          1   ff02::1
原网站

版权声明
本文为[ProYuan28]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202201251057194.html