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

What are the special uses of the ping command in Linux

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

Share

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

This article mainly introduces the special usage of the ping command in Linux, which can be used for reference by interested friends. I hope you will gain a lot after reading this article.

No matter in windows platform or in linux platform, ping is a very commonly used network command; ping command works through ICMP (Internet Control message Protocol); ping can be used to test whether the local machine is connected with the target host, how fast the connection is, and how stable it is.

The Linux system allows ping by default, but in some cases we set the server to disable ping for security reasons. Temporarily allow the ping command to use the command:

Echo 0 > / proc/sys/net/ipv4/icmp_ignore_all: 0: allow; 1: disable viewing current settings:

0, so we can try ping for this.

Use the ping command

Continuous ping can be achieved using-t

Permanently allow or disable ping, modify configuration file / etc/sysctl.conf

Add a row, net.ipv4.icmp_echo_ignore_all=1, as shown in the figure above

1 is prohibited, 0 is allowed to save and exit after the modification is completed.

Execute sysctl-p to make the new configuration effective and test the ping again

As shown in the figure, the ping command cannot ping the same IP again after the configuration takes effect. If you want to permanently allow the ping command, you only need to change the configuration file 1 to 0.

Thank you for reading this article carefully. I hope the article "what are the special uses of ping commands in Linux" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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

Development

Wechat

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

12
Report