Linux

You would like to enable IPv4 forwarding in the kernel, how would you do it?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

sudo sysctl net.ipv4.ip_forward=1

To make it persistent (applied after reboot for example): insert net.ipv4.ip_forward = 1 into /etc/sysctl.conf

Another way to is to run echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward