Red Hat Bugzilla – Bug 10199
unknown key when configuring kernel parms with sysctl
Last modified: 2014-03-16 22:13:03 EDT
When including an "net.ipv4.conf.eth0.proxy_arp = 1" entry in
/etc/sysctl.conf an "sysctl: error: 'net.ipv4.conf.eth0.proxy_arp' is an
unknown key" entry shows up in /var/log/messages after a reboot.
sysctl -p /etc/sysctl.conf will do the job without difficulties means
the keywort 'net.ipv4.conf.eth0.proxy_arp' is known when the system is up.
Hmm... it doesn't know it on the first try because there is no
eth0 interface at that time, and you probably don't want to
set proxy arp on *all* the interfaces, correct?
Right, only on eth0 should be proxy arp. My colleague discovered (one sun
complaint very loud...) that our firewall did proxy arp on all devices so I
worked around it with
echo 0 > /proc/sys/net/ipv4/conf/all/proxy_arp
echo 0 > /proc/sys/net/ipv4/conf/default/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
echo 0 > /proc/sys/net/ipv4/conf/eth1/proxy_arp
echo 0 > /proc/sys/net/ipv4/conf/eth2/proxy_arp
in the rc.local script.
There might be more keys which aren't recognized at this startup timepoint.
Maybe sysctl should find another place in the bootup sequence...
I see sysctl is run once from inittab (where eth* are undefined)
then again from /etc/rc.d/init.d/network (where they become defined).
Hmm. Maybe one could move the call in init.d/network a bit lower down
after the interfaces are brought up.
Incidentally, I couldn't find much documentation on how to set this
up properly - manpages, kernel docs, etc. Maybe I didn't look hard enough..
The problem is that for some cases (i.e., IP forwarding), you want
to run it before you bring up any interfaces, while for others
(such as the proxy arp case mentioned), you want to bring it up
after the interface is up.
I solved the problem by modifying the /etc/init.d/network file (in
initscripts-6.40-1 of Red Hat 7.2)
-- the patch is below. It's a generic solution for all related problems: setups
some parameters that need to be set before the interfaces are brought up
and some that need to be set afterwards.
I simply added a second call to sysctl once the interfaces are brought up. So
/etc/init.d/network start now gives the following output:
Setting network parameters: [ OK ]
Bringing up interface lo: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth1: [ OK ]
Setting network parameters (2nd pass): [ OK ]
*** network.orig Fri Jan 25 20:20:02 2002
--- network Fri Jan 25 20:05:38 2002
*** 133,138 ****
--- 133,144 ----
sysctl -w kernel.hotplug=$oldhotplug > /dev/null 2>&1
+ # some of the sysctl parameters might refer to parameters
+ # only created once the interfaces are brought up.
+ # /proc/sys/net/ipv4/conf/eth1/proxy_arp is such a parameter.
+ # Peter Urban, 25 Jan 2002
+ action "Setting network parameters (2nd pass): " sysctl -e -p
# Add non interface-specific static-routes.
if [ -f /etc/sysconfig/static-routes ]; then
grep "^any" /etc/sysconfig/static-routes | while read ignore args ;
Something similar to what was suggested is in 6.63-1 (basically, we just don't
output the message that we are running a second pass.)