服务器禁ping

DevOps Tool评论1,638字数 803阅读2分40秒阅读模式

ping是通的

[root@nginx-2 ~]# ping 192.168.1.227
PING 192.168.1.227 (192.168.1.227) 56(84) bytes of data.
64 bytes from 192.168.1.227: icmp_seq=1 ttl=64 time=0.477 ms
64 bytes from 192.168.1.227: icmp_seq=2 ttl=64 time=0.139 ms
64 bytes from 192.168.1.227: icmp_seq=3 ttl=64 time=0.132 ms
64 bytes from 192.168.1.227: icmp_seq=4 ttl=64 time=0.101 ms
64 bytes from 192.168.1.227: icmp_seq=5 ttl=64 time=0.119 ms
64 bytes from 192.168.1.227: icmp_seq=6 ttl=64 time=0.119 ms
^C
--- 192.168.1.227 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 4999ms
rtt min/avg/max/mdev = 0.101/0.181/0.477/0.133 ms

禁用ping

[root@nginx-1 ~]# vim /etc/sysctl.conf 

net.ipv4.icmp_echo_ignore_all=1

使其生效

[root@nginx-1 ~]# sysctl -p
net.ipv4.icmp_echo_ignore_all = 1

1代表禁止,0代表允许 修改完成后保存退出

测试

[root@nginx-2 ~]# ping 192.168.1.227
PING 192.168.1.227 (192.168.1.227) 56(84) bytes of data.

想要开启ping,直接改配置文件或者删除哪一行即可。

服务器禁ping

继续阅读
历史上的今天
11 月
10
DevOps
  • 本文由 发表于 2022年11月10日 17:03:04
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
SSL私有证书配置 Tool

SSL私有证书配置

一、生成证书 1.1 简述 一键生成私有证书脚本,兼容CentOS 7.9系统和Ubuntu 20.04.6以上系统,运行脚本加IP地址即可。 1.2 生成 在CentOS或U...
Mac安装jenkins Jenkins

Mac安装jenkins

安装brew命令 如之前安装过则跳过 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew...
部署NFS服务 NFS

部署NFS服务

部署 NFS 服务 服务端: 192.168.100.11 安装依赖 yum -y install epel-release 安装 NFS yum -y install nfs-...
git clone代码报文件名过长 Tool

git clone代码报文件名过长

简述 由于工程路径过长导致克隆代码时会出现文件名过长的问题不能clone代码中断 打开git Bash窗口执行 git config --global core.longpaths tr...
评论  0  访客  0

发表评论