Example of using iptables to disable and restore ping in CentOS

Source: Internet
Author: User
Tags centos iptables

This evening, I opened the Online server and went to the previously installed DA. I was so upset to see a bunch of Brute force attack alarms. I followed the online tutorial to set iptables. In the future, I can block IP addresses directly. The command in the tutorial also disables ping, so that other clients cannot ping my server, and automatically shield the brute-force cracking IP address. Ping is disabled, and Online immediately prompts "Service alert: ping down on Dedibox", and the local test cannot be pinged. The following describes how to disable or enable ping for iptables.

The command for iptables to disable ping is as follows:

Iptables-I input-I eth0-p icmp-s 0/0-d 0/0-j DROP

The command for restoring ping is as follows:

Iptables-I input-I eth0-p icmp-s 0/0-d 0/0-j ACCEPT

All of the above is an example of how CentOS uses iptables to prohibit and resume ping. I hope this article will help you.

Related Article

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.