Change sysctl parameters for all interfaces

sysctlsystemd

How can i change a parameter for all interfaces in systemd ?

For example:

sysctl -w "net.ipv4.conf.eth0.rp_filter=0"
sysctl -w "net.ipv4.conf.eth1.rp_filter=0"

How can change it for all interfaces ?

Best Answer

Try all and default:

# sysctl -w "net.ipv4.conf.all.rp_filter=0"
# sysctl -w "net.ipv4.conf.default.rp_filter=0"

This is explained in the Kernel documentation:

conf/default/*:    Change the interface-specific default settings.
conf/all/*:        Change all the interface-specific settings.

However note that putting a new value in all doesn't change the value you read from the interface, but it only gets computed and used internally. See this email for more details.