In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail what the basic usage of netstat 1 is. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Show all current links
Root@ts:~# netstat-aActive Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 localhost:domain *: * LISTEN tcp 0 0 testforpaas.21vi:domain *: * LISTEN tcp 0 0 localhost:5433 *: * LISTEN tcp 0 0 localhost:smtp *: * LISTEN tcp 0 0 localhost:6010 *: * LISTEN only shows tcp and duproot@ts:~# netstat-tau disables reverse domain name resolution Speed up query speed
By default, netstat uses reverse domain name resolution technology to find the hostname for each IP address. This slows down the search. If you think the IP address is enough and you don't need to know the hostname, use the-n option to disable domain name resolution
Root@ts:~# netstat-antActive Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0127.0.0.1 servers and established 53 0.0.0.0 LISTEN tcp 0 172.16.16.1 Fringe 53 0.0.0.0 * LISTEN Tcp 0 0127.0.0.1 LISTEN tcp 5433 0.0.0.0 * LISTEN tcp 0 0127.0.0.1 LISTEN tcp 6010 0.0.0.0 * LISTEN Tcp 0 0 0.0.0.0 8123 0.0.0.0 * only the connections in the monitor are listed.
The background process of any network service opens a port to listen for access requests. These listening sockets, like connected sockets, can also be listed by netstat. Use the-l option to list the sockets you are listening to
Root@ts:~# netstat-tnlActive Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0127.0.0.1 only servers 53 0.0.0.0 LISTEN tcp 0 172.16.16.1 Fringe 53 0.0.0.0 * LISTEN tcp 0 0 127.0.1 LISTEN 5433 0.0.0.0 LISTEN tcp 0 0 127.0.1 10 0.0.0 LISTEN Tcp 0 0 0.0 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0 Process number and user IDroot@ts:~# netstat-tlpActive Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nametcp 0 0 localhost:domain *: * LISTEN 1080/dnsmasq tcp 0 0 testforpaas.21vi:domain *: * LISTEN 1080/dnsmasq tcp 0 localhost:5433 *: * LISTEN 11237/postgres tcp 0 0 localhost:smtp *: * LISTEN 1371/sendmail: MTA:tcp 0 0 localhost:6010 *: * LISTEN 9389On6 get the process name and user name root@ts:~# Netstat-tlpeActive Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program nametcp 0 0 localhost:domain *: * LISTEN root 15870 1080/dnsmasq tcp 0 0 testforpaas.21vi:domain *: * LISTEN root 15868 1080/dnsmasq tcp 00 localhost:5433 *: * LISTEN postgres 130080 11237/postgres tcp 00 localhost:smtp *: * LISTEN root 17826 1371/sendmail: MTA displays the process name and user IDroot@ts:~# netstat-tlpenActive Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program nametcp 0 0 127.0.0.1 1080/dnsmasq tcp 53 0.0.0.0 * LISTEN 0 15870 1080/dnsmasq tcp 0 172.16.16. 1 LISTEN 0 15868 1080/dnsmasq tcp 00 127.0.0.1 LISTEN 5433 0.0.0.0 LISTEN 130080 11237/postgres tcp 00 127.0.0.1 11237/postgres tcp 25 0.0.0.0 LISTEN 0 17826 1371/sendmail: print statistics
Netstat can print out network statistics, including the number of packets sent and received under a certain protocol.
Root@ts:~# netstat-tnsIcmpMsg: InType0: 93 InType3: 14674 InType11: 27391 OutType3: 18230 OutType8: 38060Tcp: 23583 active connections openings 139747 passive connection openings 21350 failed connection attempts 1512 connection resets received 4 connections established 4263613 segments received 47164772 segments send out 171992 segments retransmited 55 bad segments received. 151266 resets sent displays kernel routing information root@ts:~# netstat-rnKernel IP routing tableDestination Gateway Genmask Flags MSS Window irtt Iface0.0.0.0 172.16.16.62 0.0.0.0 UG 00 ens16010.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 br-9547a5f0faec10.20.0.0 10.20.101.9 255.255.0.0 UG 2000 ppp0 print network interface
Netstat can also print network interface information, and the-I option is created for this function.
Root@ts:~# netstat-iKernel Interface tableIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flgbr-9547a5f0faec 1500 0 55883292 00 0 89519216 00 0 BMRUdocker0 1500 0 49 00 0 160 00 BMUens160 1500 0 152552760 0611 0 60254997 0 BMRUlo 65536 0 583345 00 0 583345 00 0 LRUppp0 1354 0 2157 00 0 1679 00 0 MOPRUveth6dd978f 1500 0 12751092 00 0 18590019 00 0 BMRU
Output friendly information
Root@ts:~# netstat-eiKernel Interface tablebr-9547a5f0faec Link encap:Ethernet HWaddr 02:42:ee:4b:21:05 inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::42:eeff:fe4b:2105/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:55883460 errors:0 dropped:0 overruns:0 frame:0 TX packets:89519456 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:7839329499 (7.8 GB) TX bytes:199950345292 (199.9 GB) docker0 Link encap:Ethernet HWaddr 02:42:8f:b2:de:7a inet addr:172.17.0.1 Bcast:172.17.255.255 Mask:255.255.0.0 inet6 addr: fe80::42:8fff:feb2 : de7a/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:49 errors:0 dropped:0 overruns:0 frame:0 TX packets:16 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1372 (1.3KB) TX bytes:1368 (1.3KB) netstat continuously output root@ts:~# netstat-cuActive Internet connections (wUnip o servers) Proto Recv -Q Send-Q Local Address Foreign Address State udp6 00 localhost:37429 localhost:37429 ESTABLISHED print active status connection netstat-atnp | grep ESTA monitors active status connection watch-d-n0 "netstat-atnp | grep ESTA" about what are the basic uses of netstat 1? this article ends here. Hope that the above content can be helpful to you, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.