ICMP redirect
termKept in this browser · My desk
The ICMP message, type 5 in RFC 792, with which a router tells a host on the same subnet to send traffic for a destination to a better first-hop router; forged, it diverts the host's traffic to the sender.
RFC 1122 obliges hosts to act on redirects and asks them to discard only those whose new gateway is off their subnet or whose source is not their current gateway. Both checks rest on addresses an attacker on the same link can write, so they stop distant forgers but not neighbours. Routers must ignore redirects, so a classic forged redirect diverts one direction; Zimperium's DoubleDirect (2014) got both by redirecting DNS first. Linux and Windows hosts accept redirects by default; hardening guides switch them off.
What it is. Jon Postel's RFC 792 (September 1981) defines the Redirect Message as ICMP type 5 with codes 0 (redirect for the network), 1 (for the host), 2 and 3 (the same for a type of service). After type, code and checksum come the Gateway Internet Address, the router to use instead, and 'the internet header plus the first 64 bits of the original datagram's data', which ties the advice to the packet that prompted it. The RFC's scenario: gateway G1 receives a datagram, finds the next gateway G2 on the same network as the sender, forwards the datagram and tells the host to send traffic for that destination 'directly to gateway G2 as this is a shorter path'.
How hosts and routers must treat it. RFC 1122 (October 1989) says 'A host receiving a Redirect message MUST update its routing information accordingly' and that a redirect 'SHOULD be silently discarded if the new gateway address it specifies is not on the same connected (sub-) net through which the Redirect arrived, or if the source of the Redirect is not the current first-hop gateway'; since hosts rarely know remote masks, network redirects are treated as host redirects (3.3.1.2). RFC 1812 (June 1995) tells routers when they may send one (same interface in and out, source on the next hop's subnet, no source route) and that a router running a routing protocol 'MUST NOT consider paths learned from ICMP Redirects', because believing them 'would likely create routing loops'.
Worked example. A host 10.20.30.57 with gateway 10.20.30.1 sends a DNS query to 198.51.100.10. A neighbour at 10.20.30.66 sends a redirect with IP source 10.20.30.1: bytes 05 01, checksum, gateway 0A 14 1E 42, then the 20-byte quoted header and 8 bytes of the original UDP header, 36 bytes in all. The new gateway is on the host's subnet and the source is the current gateway, so both RFC 1122 checks pass and the host's route cache now sends that destination to the neighbour.
IPv6 and security history. RFC 4861 kept redirects in Neighbor Discovery and requires a link-local source, a hop limit of 255 and a source equal to the current first-hop router, which keeps off-link senders out; but RFC 3756 (2004) notes that an attacker 'uses the link-local address of the current first-hop router' and the host 'accepts the Redirect'. In November 2014 Zimperium reported redirect attacks 'in the wild' in 31 countries, named DoubleDirect: older tools were half duplex because the router will not accept redirects, while the new variant redirected the victim's DNS first and then each address it was about to contact. It found iOS 8.1.1, most Android devices tested and OS X Yosemite accepting redirects by default.
In practice. Linux documents accept_redirects TRUE by default for hosts, with secure_redirects (only to listed gateways) overridden by shared_media, also TRUE; distributions often ship their own values, which may explain Zimperium's finding that most Linux desktops did not accept them. Windows' IcmpRedirectsEnabled is true by default for IPv4 and IPv6, and the Windows Server 2025 STIG requires EnableICMPRedirect = 0. On the network, RA Guard's host role drops IPv6 redirects at the port, and the binding table behind ARP inspection and IP source guard exposes an IPv4 redirect carrying the gateway's IP with another hardware address. On subnets with a single gateway, any redirect is worth an alert.
Defaults by platform, as documented. Linux distinguishes IPv4 and IPv6: for IPv4, accept_redirects is enabled on an interface when at least one of the all or interface settings is true on a host, and only when both are on a router; for IPv6 its functional default is enabled when the machine is not forwarding and disabled when it is. Microsoft's IcmpRedirectsEnabled governs the IPv4 and IPv6 path caches together, with true as the default for both; the Windows Server 2025 STIG's rationale is that 'Allowing ICMP redirect of routes can lead to traffic not being routed properly'. Zimperium's 2014 test for exposure on macOS was the drop_redirect setting. The practical rule on managed networks is the same everywhere: hosts with one gateway gain nothing from redirects, so turn acceptance off and let the routing design, not ICMP advice, decide paths.
Neighbours. ICMP and ICMPv6, the default gateway and route cache, Neighbor Discovery, RA Guard, ARP poisoning (the usual partner for the router's direction) and the Router Advertisement.
Also known as: icmp redirect message, icmp type 5, redirect for host, doubledirect, icmp redirect attack
Sources
- Jon Postel, RFC 792, Internet Control Message Protocol, September 1981: the Redirect Message, type 5, codes 0 to 3, Gateway Internet Address, quoted header (read 2026-11-23)
- Robert Braden (editor), RFC 1122, Requirements for Internet Hosts, October 1989: hosts MUST update on redirects; SHOULD discard off-subnet or non-gateway redirects (3.2.2.2); network redirects treated as host redirects (3.3.1.2) (read 2026-11-23)
- Fred Baker (editor), RFC 1812, Requirements for IP Version 4 Routers, June 1995: conditions for sending redirects; routers running a routing protocol MUST NOT use redirect-learned paths (4.3.3.2, 5.2.7.2) (read 2026-11-23)
- Thomas Narten and others, RFC 4861, Neighbor Discovery for IP version 6, September 2007: RA format and Router Lifetime (4.2); Redirect validation (8.1) (read 2026-11-23)
- Pekka Nikander, James Kempf and Erik Nordmark, RFC 3756, IPv6 ND Trust Models and Threats, May 2004, section 4.2.4: a Redirect sent with the first-hop router's link-local address is accepted (read 2026-11-23)
- Zimperium, DoubleDirect: Full-Duplex ICMP Redirect Attacks in the Wild, 20 November 2014: 31 countries; half versus full duplex; iOS 8.1.1, Android and OS X Yosemite accepted redirects; most Linux and Windows desktops did not (read 2026-11-23)
- Linux kernel documentation, IP Sysctl: accept_redirects TRUE for hosts; secure_redirects overridden by shared_media (TRUE); send_redirects; accept_ra (read 2026-11-23)
- Microsoft Learn, Microsoft-Windows-TCPIP IcmpRedirectsEnabled: whether IPv4 and IPv6 path caches are updated by redirects; true is the default (read 2026-11-23)
- STIG Viewer, Windows Server 2025 STIG, V-278084, 20 February 2026: EnableICMPRedirect must be 0 (MSS legacy policy) (read 2026-11-23)