In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about several methods of temporarily or permanently disabling ping commands in Centos7, which may not be well understood by many people. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something from this article.
Some friends may find that when ping the IP of a server, the ping may not work, but it can be accessed normally. What's going on?
In fact, this server is set up with the ping command. If you are using a centos7 system and do not want others to ping, you can also set the disable ping command to achieve this.
Temporarily disable ping
Change the 0 in the / proc/sys/net/ipv4/icmp_echo_ignore_all file to 1 temporarily, so as to realize all requests to prohibit ICMP messages and achieve the effect of prohibiting Ping.
In this way, other hosts in the network will display a "request timeout" error when Ping the host, but the server can Ping other hosts at this time.
Permanently disable ping
# Editing configuration
Vim / etc/sysctl.conf
# set the ban on ping (if there is no need to add it repeatedly)
Net.ipv4.icmp_echo_ignore_all = 1
# refresh configuration
Sysctl-p
# enable ping
Net.ipv4.icmp_echo_ignore_all = 0
IPTABLES Firewall forbids ping
Classics ping
Iptables-An INPUT-p icmp--icmp-type 8-s 0 DROP 0-j DROP
Enable ping
Iptables-D INPUT-p icmp--icmp-type 8-s 0 DROP 0-j DROP
# Parameter remarks
-A: add firewall rules
INPUT: inbound rule
-p icmp: specifies that the protocol for packet inspection is ICMP protocol
-- icmp-type 8: specifies that the ICMP type is 8
-s: specify IP and mask, and "0 IP 0" indicates that this rule is for all CPMs and masks
After the above configuration, the internal ping will also become invalid, and after you disable ping through the firewall, you can ping your own internal network.
Once set up, another command to ping my IP or www.appjzw.com domain name will produce an error similar to the following figure.
After reading the above, do you have any further understanding of Centos7's methods of temporarily or permanently disabling the ping command? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.