Linux allow, disable ping packets

Source: Internet
Author: User

The Linux system allows pings by default, but in some cases we set the server to no ping for security reasons

Temporarily allow the ping command to use the command:

echo 0 >/proc/sys/net/ipv4/icmp_ignore_all:0, delegate allowed; 1, delegate Forbidden

1. View current settings:

For 0, so we can ping it and try

2, use the ping command to test

Use-T to ping continuously

3, permanently allow or disallow ping, modify configuration file/etc/sysctl.conf

Add a row as shown, net.ipv4.icmp_echo_ignore_all=1

1 is forbidden, 0 means allow the modification to be completed after saving exit

4, execute sysctl-p to make the new configuration take effect

5, re-test the ping situation

, after the configuration takes effect again the ping command cannot ping the same IP, if you want to permanently allow the ping command, just change the configuration file 1 to 0

Linux allow, disable ping packets

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.