[lug] RedHat 6.2 broken network script
Bonnell, Doug
DBonnell at BreeceHill.com
Thu May 18 14:18:33 MDT 2000
I've been setting up a machine with RH 6.2 as a bridge
between two networks. I could manually activate IPv4
packet forwarding, but it wouldn't come up automatically
when I admin'd /etc/sysconfig/network.
Turns out that changes have been made to the 6.2 version
of /etc/rc.d/init.d/network. This script now only turns off
ip forwarding, never turns it on under the "start" option.
Below are my changes for automatic startup of ip forwarding:
++++++++++++++++++++++++++++ Old script +++++++++++++++++++++++++++++++++++
# See how we were called.
case "$1" in
start)
action "Setting network parameters" sysctl -p /etc/sysctl.conf
action "Bringing up interface lo" ./ifup ifcfg-lo
++++++++++++++++++++++++++++ New script +++++++++++++++++++++++++++++++++++
# See how we were called.
case "$1" in
start)
action "Setting network parameters" sysctl -p /etc/sysctl.conf
if [ -d /proc/sys/net/ipv4 ]; then
if [ -f /proc/sys/net/ipv4/ip_forward ]; then
if [ "$FORWARD_IPV4" = "no" -o "$FORWARD_IPV4"
= "false" ]; then
action "Disabling IPv4 packet
forwarding" sysctl -w net.ipv4.ip_forward=0
else
action "Enabling IPv4 packet
forwarding" sysctl -w net.ipv4.ip_forward=1
fi
fi
fi
action "Bringing up interface lo" ./ifup ifcfg-lo
A minor annoyance, to be sure. At least the file
/etc/sysconfig/static-routes is now being processed
by the network script in 6.2 (unlike 6.0).
Regards,
Doug Bonnell
Software Engineer
BreeceHill Technologies Inc.
More information about the LUG
mailing list