Re: sysctl, ip_forward[ing], Configure.help

Andries.Brouwer@cwi.nl
Mon, 5 Jan 1998 20:03:44 +0100 (MET)


From andi@zero.aec.at Mon Jan 5 19:13:43 1998

alan@lxorguk.ukuu.org.uk (Alan Cox) writes:

> > fact was documented somewhere, e.g. by adding a sentence like
> > You have to enable IP forwarding by doing
> > echo "1" > /proc/sys/net/ipv4/ip_forward
> > (cc to Axel, just in case there will be a 2.0.34;
>
> This isnt correct. In 2.0.x you have to set forwarding at compile time
> unless using some vendors magically tuned krnel

Someone incorporated my old ip_forward sysctl patch into 2.0.30 (it
wasn't me, I'm not to blame). The compile time option selects only the
default too, so if the kernel is compiled with IP_FORWARD it'll do the
right thing at runtime. Setting of the sysctl is only needed when
CONFIG_IP_FORWARD isn't enabled.

Quite. We are leaving the territory of linux-kernel here,
but for the education of HOWTO writers and others I might
remark that I was setting up masquerading on a RedHat 5.0
box, and it so happens that there /etc/rc.d/init.d/network
contains the line
echo "$value" > /proc/sys/net/ipv4/ip_forward
so that the forwarding status of a kernel that is compiled
with CONFIG_IP_FORWARD is not determined by the options
given at kernel compile time, but by the answers given
at distribution install time. Here value is set from
FORWARD_IPV4, which is defined in /etc/sysconfig/network .
Easy to change, once you know that the variable exists.

Andries