Tuesday, January 31, 2006

Ubuntu enable ipv4 forwarding

Check the current state can use
cat /proc/sys/net/ipv4/ip_forward
or
sysctl net | grep ip_forward

0=disabled
1=enabled

To get Ubuntu to enable the forward on boot I edited /etc/sysctl.conf
By running sysctl net | grep ip_forward you find the key is net.ipv4.ip_forward
So add this to the /etc/sysctl.conf file
net.ipv4.ip_forward=1
then run
sudo sysctl -p
So should now see new forward state using
cat /proc/sys/net/ipv4/ip_forward
or
sysctl net | grep ip_forward
and the change should persist after reboot.

This procedure will obviously work for any of the values under sysctl control.

Comments:
Thanks! Just what I was looking for...
 
Thanks for the tip there! I was looking that up xD
 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?