Bug 552653 - Network service scripts shows "IP forwarding" as disabled when restarting the service even after enabling it
Summary: Network service scripts shows "IP forwarding" as disabled when restarting the...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: initscripts
Version: 5.4
Hardware: i386
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: initscripts Maintenance Team
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 552785
TreeView+ depends on / blocked
 
Reported: 2010-01-05 19:40 UTC by Abbas Khan
Modified: 2010-01-06 11:22 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 552785 (view as bug list)
Environment:
Last Closed: 2010-01-06 06:31:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
CentOS 4120 0 None None None Never

Description Abbas Khan 2010-01-05 19:40:17 UTC
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

Comment 1 Bill Nottingham 2010-01-05 19:43:43 UTC
The disabling message comes from the shutdown of the network service that's done as part of the restart.

Comment 2 Abbas Khan 2010-01-06 04:35:52 UTC
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?

Comment 3 Bill Nottingham 2010-01-06 05:07:57 UTC
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.

Comment 4 Bill Nottingham 2010-01-06 05:08:53 UTC
Furthermore, having to have separate 'Enabling...' printouts for any setting that might be in sysctl.conf is impractical.

Comment 5 Abbas Khan 2010-01-06 05:16:40 UTC
That's what my point is! If you cannot print 'Enabling....' for a setting in sysctl.conf then why 'Disabling..' was printed out?

Comment 6 Bill Nottingham 2010-01-06 06:31:41 UTC
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.

Comment 7 Abbas Khan 2010-01-06 06:42:28 UTC
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.

Comment 8 sarwan.jassi 2010-01-06 11:18:53 UTC
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

Comment 9 Abbas Khan 2010-01-06 11:21:41 UTC
Yea, I've already edited it on my systems but I was looking for a release level fix!

Comment 10 sarwan.jassi 2010-01-06 11:22:34 UTC
thats why Mr Khan you're great :)


Note You need to log in before you can comment on or make changes to this bug.