IP forwarding also known as Internet routing is a process used to determine which path a packet or datagram can be sent. The process uses routing information to make decisions and is designed to send a packet over multiple networks.
Ideally, algorithms that are used for IP forwarding would take into account a packet/datagram’s length, the type of service specified in the datagram’s header, and the network load to determine the best path to send a packet to its intended destination. However, in general most routing software determines its route through a shortest path algorithm. More…
By default any modern Linux distributions will have IP Forwarding disabled. This is normally a good idea, as most peoples will not need IP Forwarding, but if we are setting up a Linux router/gateway or other service then we will need to enable forwarding. This can be done in several ways that I will present bellow.
Check if IP forwarding is enabled:
# sudo sysctl -a |grep ip_forward
Enable IP Forwarding:
To keep IP Forwarding enabled, you will have to edit /etc/sysctl.conf file using your favorite text editor.
# sudo nano /etc/sysctl.conf
You will find a line which says:
# net.ipv4.ip_forward = 1
You need to uncomment this line to enable IP Forwarding, so that it reads:
net.ipv4.ip_forward = 1
To load the settings that we made to /etc/sysctl.conf file, run the following command:
# sudo sysctl -p
That is all…