Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Netstat to check the Linux network connection

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

1. Netstat installation

# yum install net-tools

2. # netstat-nlp

-n is displayed in numbers

-l lists only services in the Listen state

-p displays the program name of the connection

The Proto (protocol type) column indicates the protocol type. The common ones are tcp and udp.

The Local Address (current address) column represents the listening address and port, 0.0.0.0 represents all addresses on the host, and 127.0.0.1 represents the local address.

The State column indicates the status of the connection, and if the status value is LISTEN, the port / program / service has started normally.

The PID/Program name (process number / process name) column is the process number and program / service name of the program.

3. For example, to check whether the mysql service starts normally, you can execute the following command:

# netstat-nlp | grep mysql

4.-t option to filter out tcp connections, because mysql uses tcp protocol to connect: # netstat-ntlp | grep

Mysql

-u View udp protocol connection: # netstat-nulp | grep mysql

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report