I am using Fedora 20 after running this command:
"sysctl -w net.inet.ip.forwarding=1"
it is giving this error:
"sysctl: cannot stat /proc/sys/net/inet/ip/forwarding: No such file or directory"
I think you have to type:
sysctl -w net.ipv4.ip_forward=1
This works on fedora 21 for me
try this
echo "1" > /proc/sys/net/ipv4/ip_forward
su - # sudo su - if Ubuntu
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p /etc/sysctl.conf
This way even when you reboot the machine the setting will stay.
For Ubuntu:
sudo sysctl net.ipv4.conf.all.forwarding=1
echo "net.ipv4.conf.all.forwarding=1" | sudo tee -a /etc/sysctl.conf