As a security best practice, verify that the host system ignores IPv4 Internet Control Message Protocol (ICMP) redirect messages. A malicious ICMP redirect message can allow a man-in-the-middle attack to occur. Routers use ICMP redirect messages to notify hosts that a more direct route exists for a destination. These messages modify the host's route table and are unauthenticated.
Procedure
- Run the # grep [01] /proc/sys/net/ipv4/conf/*/accept_redirects|egrep "default|all" command on the host system to check whether the host system ignores IPv4 redirect messages.
- Configure the host system to ignore IPv4 ICMP redirect messages.
- Open the /etc/sysctl.conf file.
- If the values are not set to
0
, add the following entries to the file or update the existing entries accordingly. Set the value to0
.net.ipv4.conf.all.accept_redirects=0 net.ipv4.conf.default.accept_redirects=0
- Save the changes and close the file.
- Run
# sysctl -p
to apply the configuration.