Skip to content

By Administrator in All, Linux administration

Every Linux machine that has at least two networking interfaces can be configured to route network packets between these interfaces. Whether or not a Linux box will be capable of routing is determined by the value of the ip_forward kernel parameter. Most modern Linux systems would come with this value set to 0 which means that routing is disabled by default.

In order to enable routing, you can do the following:

[email protected]:~$ echo 1 > /proc/sys/net/ipv4/ip_forward

The above would only set the value until the next system reboot. In order to make the changes stick after a reboot, you can use the sysctl system utility. Make sure that the following line is present in the /etc/sysctl.conf file:

net.ipv4.ip_forward = 1

Then, run the following command to apply the changes immediately:

[email protected]:~$ /sbin/sysctl -p

That’s it.

Note: Keep in mind that configuring even a simple home Linux router will usually require a number of additional steps besides turning on IP forwarding in the kernel.

Tags: , ,

Comment Feed

One Response

  1. Paul ReiberJune 11, 2012 @ 12:59 amReply

    You wrote:

    > Note: Keep in mind that configuring even a simple home Linux router will usually
    > require a number of additional steps besides turning on IP forwarding in the kernel.

    This article would be immensely more useful if it listed out what those other required steps are.



Some HTML is OK

or, reply to this post via trackback.