Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the special uses of the ping command in Linux

Shulou Source: shulou.com Published: 2022-06-01 15:23:01 09月19日 Update

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!

Tags: Commands representatives articles configurations situations special again platforms files permanent testing security for this one line image above host value interest and at the same time commonly used Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Xiaomi Shulou Technology vpn Apple