Create or edit a custom config file in /etc/sysctl.d/
sudo nano /etc/sysctl.d/99-custom.conf
Add your settings, e.g.:
net.ipv4.ip_forward = 1
vm.swappiness = 10
Apply the changes:
sudo sysctl --system
Verify:
sysctl net.ipv4.ip_forward
sysctl vm.swappiness
I changed my raspberry pi5 from Bookworm to Trixie and I was unable to configure my VPN’s /etc/sysctl.conf file to set “net.ipv4.ip_forward = 1” and “net.ipv6.conf.all.forwarding=1” until I have found your solution – IT WORKS – SUPERB ! Thanks from Italy.
You are welcome 🙂