In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article, the editor introduces in detail how to use the SS command of the network status tool, with detailed content, clear steps and proper handling of the details. I hope that this article on how to use the SS command of the network status tool can help you solve your doubts.
The ss command is used to display the socket status. It can display statistics such as PACKET sockets, TCP sockets, UDP sockets, DCCP sockets, RAW sockets, Unix domain sockets, etc. It displays more tcp and state information than other tools. It is a very practical, fast, and effective new tool for tracking IP connections and sockets.
Enter ss directly, which will display the same content as netstat by default, and enter similar parameters to get the similar output you want. For example:
$ss-tState Recv-Q Send-Q Local Address:Port Peer Address:PortESTAB 00 127.0.0.1:postgresql 127.0.0.1:48154ESTAB 00 192.168.0.136 127.0.0.1:postgresql 127.0.0.1:48154ESTAB 35296 192.168.0.120:8009ESTAB 0 192.168.0.136 173.194.74.189:https […]
Ss-t shows only TCP connections. Ss-u is used to display UDP connections, and the-l parameter shows only the port on which it is listening, and can further filter to any desired information.
I didn't test all the available parameters, but you can even use-K to force socket off.
What really shines about ss is its built-in filtering capabilities. Let's list all connections with port 22 (ssh):
$ss state all sport =: sshNetid State Recv-Q Send-Q Local Address:Port Peer Address:Porttcp LISTEN 0 128 *: ssh *: * tcp ESTAB 0 0 192.168.0.136:ssh 192.168.0.102:46540tcp LISTEN 0 128:: ssh: *
If you only want to see the established socket (excluding listening and closed):
$ss state connected sport =: sshNetid State Recv-Q Send-Q Local Address:Port Peer Address:Porttcp ESTAB 0 192.168.0.136:ssh 192.168.0.102 pur46540
Similarly, you can list the specified host or ip segments. For example, list the connections that reach the 74.125.0.0ax 16 subnet, which belongs to Google:
$ss state all dst 74.125.0.0/16Netid State Recv-Q Send-Q Local Address:Port Peer Address:Porttcp ESTAB 0 0192.168.0.136 33616 74.125.142.189:httpstcp ESTAB 0 192.168.0.136purl 42034 74.125.70.189: Httpstcp ESTAB 0 0 192.168.0.136:57408 74.125.202.189:https
The syntax of ss is very similar to that of iptables, and ss is very easy to use if you are already familiar with its syntax. You can also install the iproute2-doc package and get the complete documentation through / usr/share/doc/iproute2-doc/ss.html.
After reading this, the article "how to use the SS command of the network status tool" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to follow the industry information channel.
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.