【CentOS】ping sysctl.conf

來源:互聯網
上載者:User

標籤:centos ping sysctl.conf

// 查看設定

[[email protected] etc]# cat /proc/sys/net/ipv4/icmp_echo_ignore_all 

0


// 測試

HuangChao-MacBookPro:~ hchao$ ping a.b.c.d

PING a.b.c.d (a.b.c.d): 56 data bytes

64 bytes from a.b.c.d: icmp_seq=0 ttl=55 time=6.690 ms

64 bytes from a.b.c.d: icmp_seq=1 ttl=55 time=5.536 ms

64 bytes from a.b.c.d: icmp_seq=2 ttl=55 time=23.421 ms

64 bytes from a.b.c.d: icmp_seq=3 ttl=55 time=8.740 ms

^C

--- a.b.c.d ping statistics ---

4 packets transmitted, 4 packets received, 0.0% packet loss

round-trip min/avg/max/stddev = 5.536/11.097/23.421/7.207 ms

HuangChao-MacBookPro:~ hchao$ 


// 修改配置

[[email protected] etc]# vi /etc/sysctl.conf 

[[email protected] etc]# 

# System default settings live in /usr/lib/sysctl.d/00-system.conf.

# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file


# disable ping

net.ipv4.icmp_echo_ignore_all=1


# For more information, see sysctl.conf(5) and sysctl.d(5).


// 生效

[[email protected] etc]# sysctl -p

net.ipv4.icmp_echo_ignore_all = 1

[[email protected] etc]# 


// 測試

HuangChao-MacBookPro:~ hchao$ ping a.b.c.d

PING a.b.c.d (a.b.c.d): 56 data bytes

Request timeout for icmp_seq 0

Request timeout for icmp_seq 1

Request timeout for icmp_seq 2

Request timeout for icmp_seq 3

Request timeout for icmp_seq 4

Request timeout for icmp_seq 5

Request timeout for icmp_seq 6

Request timeout for icmp_seq 7

Request timeout for icmp_seq 8

^C

--- a.b.c.d ping statistics ---

10 packets transmitted, 0 packets received, 100.0% packet loss

HuangChao-MacBookPro:~ hchao$


本文出自 “黃超的IT筆記” 部落格,請務必保留此出處http://huangchao.blog.51cto.com/10446378/1680794

【CentOS】ping sysctl.conf

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.