I am trying to 'man in the middle' a device on my wifi network. I have configured it to use my Linux machine (also in the wifi network) as a default gateway.

On the Linux (attack) host, I switched on IPv4 forwarding using

# sysctl -w net.ipv4.ip_forward=1

Then I start looking at the traffic from the victim device using wireshark. I then saw that the attack machine sends ICMP redirect packets to the victim device, pointing it to the actual default gateway in the network. That is, obviously, not what I want it to do.

Then I tried disabling ICMP redirects using

# sysctl -w net.ipv4.conf.all.send_redirects=0

That seemed to work, but after a while the redirect packets started to appear again...

Any clues to what I can do to fix?


In my experience this

sysctl -w net.ipv4.conf.all.send_redirects=0

will not work properly on some systems what works for me is

echo 0 | tee /proc/sys/net/ipv4/conf/*/send_redirects
  • Yes this seems to work, instead of setting this for all interfaces I need to set it for the wifi interface specifically. Linux kernel bug? – Mark Koek Jan 12 '16 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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