Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have several Debian Squeeze (6.0.6 up to date) used as routers.
When a link is down, they send ICMP redirects to local hosts. This is the default behaviour of Debian and several others. So once the link comes back to life, the hosts can't reach it until reboot.

I don't want any ICMP redirect to be sent from those routers.

I tested echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects and sysctl -w net.ipv4.conf.all.send_redirects=0 and putting net.ipv4.conf.all.send_redirects=0 into /etc/sysctl.d/local.conf
Every of those solution put the right value into /proc/sys/net/ipv4/conf/all/send_redirects

the kernel keep sending ICMP redirects. Even after a reboot :

$ tcpdump -n -i eth0
00:56:17.186995 IP > ICMP redirect to host, length 68

And the routing table of local hosts (Windows computers) are polluted.

I can prevent this with netfilter :
iptables -t mangle -A POSTROUTING -p icmp --icmp-type redirect -j DROP

Any idea about why the usual method doesn't work ?
And how to prevent ICMP redirect to be sent, without using netfilter ?

share|improve this question
up vote 11 down vote accepted

The right command is : echo 0 | tee /proc/sys/net/ipv4/conf/*/send_redirects
Because you must have 0 on 'all' and on 'interface_name' to disable it.

Into /etc/sysctl.conf or similar file, you have to set 'all' + 'default' (or 'all' + 'interface' but the interface may not exists already when this file is processed).

share|improve this answer
Nice ! Thanks ! – Bertrand SCHITS Dec 10 '12 at 18:53
What's the point of the "all" directory then? I had the vague impression, it would overwrite the values of all other entries? – Elrond Jun 12 '15 at 13:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.