sysctl, ip_forward[ing], Configure.help

Andries.Brouwer@cwi.nl
Mon, 5 Jan 1998 11:19:02 +0100 (MET)


Yesterday evening I wasted a few hours setting up IP masquerading
on a 2.0.33 kernel. In the process, I found a few unrelated bugs.
More details later.

Configure.help told me that
Details on how to set things up are contained in the
IP Masquerading FAQ, available at http://www.indyramp.com/masq/
Unfortunately, the mini-HOWTO found there does not mention
an essential detail, namely that IP forwarding must be enabled.
It would probably save others some source-reading time if this
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;
cc to Ambrose: please update the HOWTO).

The source told me that this variable could be accessed in two
ways: via /proc and via a sysctl() call. Moreover, that accessing
it in the first way would produce a printk() logging the fact that
IP forwarding was turned on or off, while the sysctl() way is silent.
Hmm. Intentional?

In the meantime I also ftp'ed a 2.1.77 source to this machine.
The file is now called /proc/sys/net/ipv4/ip_forwarding,
and a nontrivial action is associated to changing the associated
value via the proc fs, but not to changing it via sysctl()
(because there is no corresponding strategy routine).
If this is not intentional, the strategy slot of the corresponding
entry should perhaps be filled. Similar remarks apply elsewhere -
maybe very few people actually use sysctl().

Andries

P.S. I do not read linux-kernel. If you want me to see your reply,
cc to aeb@cwi.nl .