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 ?


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.

  • no, it doesn't work – Bingo Apr 28 '14 at 13:17
  • what doesn't work? – Spack Apr 28 '14 at 13:18
  • The value for eth0, eth1 and other interfaces doesn't change – Bingo Apr 28 '14 at 13:20
  • That's "normal", I've updated my answer. – Spack Apr 28 '14 at 13:31
  • So if i modify those parameters, new interfaces will habe the new values ? – Bingo Apr 28 '14 at 14:30

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.