Tous les articles

Blog personnel · EN

Enable IP forwarding on a Debian system

sudo mkdir -p /etc/sysctl.d
sudo tee /etc/sysctl.d/99-forwarding.conf >/dev/null <<'EOF'
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1
EOF
sudo sysctl --system # load conf

OR

sudo sysctl -w net.ipv4.ip_forward=1
sudo sysctl -w net.ipv6.conf.all.forwarding=1
# Check config
sysctl -p

To persist after reboot for a specific interface / tool:

sudo tee /etc/sysctl.d/99-tailscale.conf >/dev/null <<EOF
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
EOF