I'm trying to activate ip forwarding at boot-time on my ubuntu core image. I can run the command:

sudo sysctl -w net.ipv4.ip_forward=1

It works. Then I reboot the machine, the forwarding is gone. On ubuntu server I can update the file /etc/sysctl.conf .

This file is "read only" in ubuntu-core.

What is the "prefered" way to add ip forwarding in ubuntu core?

// Micke


If you have superuser permissions you can edit any file with any permissions. Open /etc/sysctl.conf with your favourite editor (vi, nano etc) find string #net.ipv4.ip_forward=1, remove the leading # symbol, save the changes. And run sudo sysctl -p.

Also, you can reboot your machine to make sure the changes are in place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.