Description of problem: Enabling the IPv4 forwarding in /etc/sysctl.conf and reloading the kernel parameters with sysctl -p, enables ip forwarding as /proc/sys/net/ipv4/ip_forward equals "1". But restarting network service still shows message "Disabling IPv4 packet forwarding". At line# 269 of /etc/init.d/network, should not this "!= 0" be "=0" ? Version-Release number of selected component (if applicable): # rpm -qf /etc/init.d/network initscripts-8.45.30-2.el5.centos How reproducible: Enable ipv4 forwarding in /etc/sysctl.conf, sysctl -p, service network restart. Actual results: Shutting down interface eth0: [ OK ] Shutting down loopback interface: [ OK ] Disabling IPv4 packet forwarding: net.ipv4.ip_forward = 0 [ OK ] Expected results: Shouldn't disabling notice be there? Additional info: 267 if [ -d /proc/sys/net/ipv4 ]; then 268 if [ -f /proc/sys/net/ipv4/ip_forward ]; then 269 if [ `cat /proc/sys/net/ipv4/ip_forward` != 0 ]; then 270 action $"Disabling IPv4 packet forwarding: " sysctl -w net.ipv4.ip_forward=0 271 fi 272 fi
The disabling message comes from the shutdown of the network service that's done as part of the restart.
That doesn't make sense. The message only appears when ip forwarding is enabled. If stoppage shows disabling message then why does not it show enabling message on network service start?
It shows the message when the network service is shut down, because you want to disable it when shutting down the network. It does not explicitly show any setting in sysctl.conf that it may apply when starting the network, because that would be a lot of noise.
Furthermore, having to have separate 'Enabling...' printouts for any setting that might be in sysctl.conf is impractical.
That's what my point is! If you cannot print 'Enabling....' for a setting in sysctl.conf then why 'Disabling..' was printed out?
The disabling of ip forwarding and the corresponding printout predates the use of sysctl to set parameters by a few years. At this point, it's sort of pointless to make the change to remove the echo statements for RHEL 5 (and, in fact, removing them mid-release could confuse people.) We can look to remove them in a later major release.
Echoing of a single disablement does create confusion on the first place because you see it when service is stopped and not when its started back. Please consider either removing or changing message notifications.
Mr. Khan, You can edit /etc/init.d/network file and change it. [root ~]# cat /etc/redhat-release CentOS release 5.4 (Final) [root@ ~]# /etc/init.d/network restart Shutting down interface eth0: [ OK ] Shutting down loopback interface: [ OK ] Enabling IPv4 packet forwarding: net.ipv4.ip_forward = 1 [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ] I have changed net.ipv4.ip_forward = 1 and also changed disabling echo to enabling. I hope it helps. Thanks
Yea, I've already edited it on my systems but I was looking for a release level fix!
thats why Mr Khan you're great :)