Wednesday, 15 June 2011

Use /proc/sys and sysctl to modify and set kernel run-time parameters

This is a fairly simply objective, discussed in the previous post.
The kernel run-time parameters can be listed with:
sysctl -a
In order to change a setting temporarily:
sysctl net.ipv4.ip_forward=1
echo 1 > /proc/sys/net/ipv4/ip_forward
In order to make the changes permanent you need to edit the /etc/sysctl.conf file. Simply add the value you want, e.g. net.ipv4.ip_forward=1, save it and then issue the following command:
sysctl -p

No comments:

Post a Comment