sysctl.si › Parameters › net.ipv4.conf.all.rp_filter

net.ipv4.conf.all.rp_filter

Drops packets whose source could not be reached via the interface they came from.

Default
0 to 2
Typical value
1 (strict), 2 with asymmetric routing

When to change it

Strict mode blocks spoofed packets but can drop legitimate traffic with asymmetric routing, where 2 (loose) is safer.

Check the current value

sysctl net.ipv4.conf.all.rp_filter

Change it until the next reboot

sudo sysctl -w net.ipv4.conf.all.rp_filter=1

Make it permanent

echo "net.ipv4.conf.all.rp_filter = 1" | sudo tee /etc/sysctl.d/99-custom.conf
sudo sysctl --system

Related parameters

net.core.somaxconn · net.ipv4.tcp_max_syn_backlog · net.core.netdev_max_backlog · net.core.rmem_max · net.core.wmem_max · net.ipv4.tcp_congestion_control · net.core.default_qdisc · net.ipv4.tcp_tw_reuse

Generate a full sysctl config for your server

Values are starting points. Test on a staging machine and measure before and after.