What is the kernel parameter net.ipv4.conf.all.log_martians for?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux
  • IPv4 networking

Issue

What is the kernel parameter net.ipv4.conf.all.log_martians for?
How to disable martin log creation?

Resolution

The kernel parameter net.ipv4.conf.all.log_martians is used to control logging when the kernel receives a packet with an impossible source or destination address.

The log_martians parameter can also be controlled for all current interfaces with all, or per-interface for example net.ipv4.conf.eth0.log_martians

To make the changing of this tunable permanent, it can be set in /etc/sysctl.conf such as:

Below sysctl parameter will enable the martians logs for all interfaces

net.ipv4.conf.all.log_martians = 1    

If you want to disable martian logs for all interfaces then add the below parameter into "/etc/sysctl.conf"

net.ipv4.conf.all.log_martians = 0    

If you want to disable martian logs for only particular interfaces then add the below parameter into "/etc/sysctl.conf"

## Syntax:

net.ipv4.conf.<interfacename>.log_martians = 0       

## Note:

0 --> Indicate disable martians logs 

1 --> Indicate enable martians logs

## Example:

net.ipv4.conf.eth0.log_martians = 0

This will be applied at system boot and can be applied during runtime with the sysctl -p command.

Root Cause

The concept of a martian source is described further at:

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.