From SpectLog
Jump to: navigation, search

: sysctl, forwarding

IP forwarding is provided by the kernel.

As usual for kernel parameters, it may be enabled temporarily (until reboot) via /proc filesystem or persistently through /etc/sysctl.conf configuration file.

Enable/disable parameter temporarily:

echo "1" > /proc/sys/net/ipv4/ip_forward
echo "0" > /proc/sys/net/ipv4/ip_forward

Persistent changes

Modify/add the following parameter in /etc/sysctl.conf to enable (1) or disable (0) IP forwarding:

net.ipv4.ip_forward = 1

Apply the changes without rebooting:

sysctl -p

See also