Debian Codegraph @

upstream/debian-unstable/man7/icmp.7

raw
1 '\" t
2 .\" Copyright 1999, Andi Kleen <[email protected]>
3 .\" Copyright, the authors of the Linux man-pages project
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-1-para
6 .\"
7 .TH icmp 7 2026-02-08 "Linux man-pages 6.18"
8 .SH NAME
9 icmp \- Linux IPv4 ICMP kernel module.
10 .SH DESCRIPTION
11 This kernel protocol module implements the Internet Control
12 Message Protocol defined in RFC\ 792.
13 It is used to signal error conditions and for diagnosis.
14 The user doesn't interact directly with this module;
15 instead it communicates with the other protocols in the kernel
16 and these pass the ICMP errors to the application layers.
17 The kernel ICMP module also answers ICMP requests.
18 .P
19 A user protocol may receive ICMP packets for all local sockets by opening
20 a raw socket with the protocol
21 .BR IPPROTO_ICMP .
22 See
23 .BR raw (7)
24 for more information.
25 The types of ICMP packets passed to the socket can be filtered using the
26 .B ICMP_FILTER
27 socket option.
28 ICMP packets are always processed by the kernel too, even
29 when passed to a user socket.
30 .P
31 Linux limits the rate of ICMP error packets to each destination.
32 .B ICMP_REDIRECT
33 and
34 .B ICMP_DEST_UNREACH
35 are also limited by the destination route of the incoming packets.
36 .SS /proc interfaces
37 ICMP supports a set of
38 .I /proc
39 interfaces to configure some global IP parameters.
40 The parameters can be accessed by reading or writing files in the directory
41 .IR /proc/sys/net/ipv4/ .
42 Most of these parameters are rate limitations for specific ICMP types.
43 Linux 2.2 uses a token bucket filter to limit ICMPs.
44 .\" FIXME . better description needed
45 The value is the timeout in jiffies until the token bucket filter is
46 cleared after a burst.
47 A jiffy is a system dependent unit, usually 10ms on i386 and
48 about 1ms on alpha and ia64.
49 .TP
50 .IR icmp_destunreach_rate " (Linux 2.2 to Linux 2.4.9)"
51 .\" Precisely: from Linux 2.1.102
52 Maximum rate to send ICMP Destination Unreachable packets.
53 This limits the rate at which packets are sent to any individual
54 route or destination.
55 The limit does not affect sending of
56 .B ICMP_FRAG_NEEDED
57 packets needed for path MTU discovery.
58 .TP
59 .IR icmp_echo_ignore_all " (since Linux 2.2)"
60 .\" Precisely: 2.1.68
61 If this value is nonzero, Linux will ignore all
62 .B ICMP_ECHO
63 requests.
64 .TP
65 .IR icmp_echo_ignore_broadcasts " (since Linux 2.2)"
66 .\" Precisely: from Linux 2.1.68
67 If this value is nonzero, Linux will ignore all
68 .B ICMP_ECHO
69 packets sent to broadcast addresses.
70 .TP
71 .IR icmp_echoreply_rate " (Linux 2.2 to Linux 2.4.9)"
72 .\" Precisely: from Linux 2.1.102
73 Maximum rate for sending
74 .B ICMP_ECHOREPLY
75 packets in response to
76 .B ICMP_ECHOREQUEST
77 packets.
78 .TP
79 .IR icmp_errors_use_inbound_ifaddr " (Boolean; default: disabled; since Linux 2.6.12)"
80 If disabled, ICMP error messages are sent with the primary address of
81 the exiting interface.
82 .IP
83 If enabled, the message will be sent with the primary address of
84 the interface that received the packet that caused the ICMP error.
85 This is the behavior that many network administrators will expect from
86 a router.
87 And it can make debugging complicated network layouts much easier.
88 .IP
89 Note that if no primary address exists for the interface selected,
90 then the primary address of the first non-loopback interface that
91 has one will be used regardless of this setting.
92 .TP
93 .IR icmp_ignore_bogus_error_responses " (Boolean; default: disabled; since Linux 2.2)"
94 .\" precisely: since Linux 2.1.32
95 Some routers violate RFC1122 by sending bogus responses to broadcast frames.
96 Such violations are normally logged via a kernel warning.
97 If this parameter is enabled, the kernel will not give such warnings,
98 which will avoid log file clutter.
99 .TP
100 .IR icmp_paramprob_rate " (Linux 2.2 to Linux 2.4.9)"
101 .\" Precisely: from Linux 2.1.102
102 Maximum rate for sending
103 .B ICMP_PARAMETERPROB
104 packets.
105 These packets are sent when a packet arrives with an invalid IP header.
106 .TP
107 .IR icmp_ratelimit " (integer; default: 1000; since Linux 2.4.10)"
108 Limit the maximum rates for sending ICMP packets whose type matches
109 .I icmp_ratemask
110 (see below) to specific targets.
111 0 to disable any limiting,
112 otherwise the minimum space between responses in milliseconds.
113 .TP
114 .IR icmp_ratemask " (integer; default: see below; since Linux 2.4.10)"
115 Mask made of ICMP types for which rates are being limited.
116 .IP
117 Significant bits: IHGFEDCBA9876543210
118 .br
119 Default mask: 0000001100000011000 (0x1818)
120 .IP
121 Bit definitions (see the Linux kernel source file
122 .IR include/linux/icmp.h ):
123 .RS 12
124 .TS
125 l l.
126 0 Echo Reply
127 3 Destination Unreachable *
128 4 Source Quench *
129 5 Redirect
130 8 Echo Request
131 B Time Exceeded *
132 C Parameter Problem *
133 D Timestamp Request
134 E Timestamp Reply
135 F Info Request
136 G Info Reply
137 H Address Mask Request
138 I Address Mask Reply
139 .TE
140 .RE
141 .P
142 The bits marked with an asterisk are rate limited by default
143 (see the default mask above).
144 .TP
145 .IR icmp_timeexceed_rate " (Linux 2.2 to Linux 2.4.9)"
146 Maximum rate for sending
147 .B ICMP_TIME_EXCEEDED
148 packets.
149 These packets are
150 sent to prevent loops when a packet has crossed too many hops.
151 .TP
152 .IR ping_group_range " (two integers; default: see below; since Linux 2.6.39)"
153 Range of the group IDs (minimum and maximum group IDs, inclusive)
154 that are allowed to create ICMP Echo sockets.
155 The default is "1 0", which
156 means no group is allowed to create ICMP Echo sockets.
157 .SH VERSIONS
158 Support for the
159 .B ICMP_ADDRESS
160 request was removed in Linux 2.2.
161 .P
162 Support for
163 .B ICMP_SOURCE_QUENCH
164 was removed in Linux 2.2.
165 .SH NOTES
166 As many other implementations don't support
167 .B IPPROTO_ICMP
168 raw sockets, this feature
169 should not be relied on in portable programs.
170 .\" not really true ATM
171 .\" .P
172 .\" Linux ICMP should be compliant to RFC 1122.
173 .P
174 .B ICMP_REDIRECT
175 packets are not sent when Linux is not acting as a router.
176 They are also accepted only from the old gateway defined in the
177 routing table and the redirect routes are expired after some time.
178 .P
179 The 64-bit timestamp returned by
180 .B ICMP_TIMESTAMP
181 is in milliseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
182 .P
183 Linux ICMP internally uses a raw socket to send ICMPs.
184 This raw socket may appear in
185 .BR netstat (8)
186 output with a zero inode.
187 .SH SEE ALSO
188 .BR ip (7),
189 .BR rdisc (8)
190 .P
191 RFC\ 792 for a description of the ICMP protocol.