What is IP Forwarding in Linux? How to Enable IP Forwarding?

IP forwarding helps you to set up the OS to work as a router. For example, you can set IP forwarding when you have a system that has two different networks and are looking to pass traffic from one network to another.

It is quite simple to set up IP forwarding on Linux OS, which you can do by implementing the following steps – 

1. Open the /etc/sysctl.conf file in your preferred text editor.

nano /etc/sysctl.conf

2. Uncomment the below line – 


3. Save the file with ctrl + x, press y, and enter.

4. Finally, run this command – 

sysctl -p

Was this answer helpful?

« Back