IP forwarding helps you to set up the OS to work as a router. You can set IP forwarding when you have a system set up that has two different networks and you are looking to pass traffic from one network to another one. It is very easy to set up IP forwarding on Linux OS. Please refer to the following steps to enable IP forwarding on Linux OS.
- Open the file /etc/sysctl.conf in your favorite text editor.
- Uncomment the below line.
- Save the file with ctrl+x, then press y, and then press enter. Finally, run this command.