Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
The _iptables-services_ package now support `/etc/sysctl.d`
With this update, the init scripts of the `iptables` or `ip6tables` services now recognize the configuration files in the `/etc/sysctl.d` directory as well as the `/etc/sysctl.conf` file itself. As a result, the user-provided sysctl settings stored in `/etc/sysctl.d/` are now correctly taken into account when the `iptables` service is restarted.
DescriptionDavide F Bragalone
2017-06-07 18:48:39 UTC
Description of problem:
The init script for iptables /etc/init.d/iptables doesn't support /etc/sysctl.d .
load_sysctl() {
# load matched sysctl values
if [ -n "$IPTABLES_SYSCTL_LOAD_LIST" ]; then
echo -n $"Loading sysctl settings: "
ret=0
for item in $IPTABLES_SYSCTL_LOAD_LIST; do
fgrep $item /etc/sysctl.conf | sysctl -p - >/dev/null <=========
let ret+=$?;
done
[ $ret -eq 0 ] && success || failure
echo
fi
return $ret
}
That means that if you edit a kernel parameter related to iptables via /etc/sysctl.d/foo.conf , this won't be applied on iptables restart.
Version-Release number of selected component (if applicable):
kernel 2.6.32-696.3.1.el6.x86_64
iptables-1.4.7-16.el6.x86_64
How reproducible:
100%
Steps to Reproduce:
1. edit parameter net.nf_conntrack_max via /etc/sysctl.d/iptables.conf
2. restart iptables
3. verify if /proc/sys/net/nf_conntrack_max has been modified
Actual results:
never updated
Expected results:
always updated
Comment 2Davide F Bragalone
2017-06-07 19:01:18 UTC
I've forgot this in the bugzilla's description:
initscripts-9.03.58-1.el6_9.1.x86_64
(In reply to Lukáš Nykrýn from comment #4)
> The mentioned code is inside a initscript provided by the iputils package.
I think it's provided by iptables package.
This patch work for us:
--- iptables.old 2017-06-08 13:18:26.680973312 +0200
+++ iptables 2017-06-08 13:18:39.896022411 +0200
@@ -187,7 +187,7 @@
echo -n $"Loading sysctl settings: "
ret=0
for item in $IPTABLES_SYSCTL_LOAD_LIST; do
- fgrep $item /etc/sysctl.conf | sysctl -p - >/dev/null
+ fgrep -hs $item /etc/sysctl.conf /etc/sysctl.d/*.conf | sysctl -p - >/dev/null
let ret+=$?;
done
[ $ret -eq 0 ] && success || failure
The same code exists in rhel7, iptables-services package, /usr/libexec/iptables/iptables.init file.
Comment 7Sergi Jimenez Romero
2017-06-08 15:31:31 UTC
(In reply to Carlos Peón from comment #5)
> (In reply to Lukáš Nykrýn from comment #4)
> > The mentioned code is inside a initscript provided by the iputils package.
>
> I think it's provided by iptables package.
I confirm that:
$ rpm -qf /etc/init.d/iptables
iptables-1.4.7-16.el6.x86_64
Already fixed in RHEL7 via bz#1402021. Same solution applies here with one exception: RHEL6 doesn't ship a symlink from /etc/sysctl.d/99-sysctl.conf to /etc/sysctl.conf, so the grep command needs to explicitly search /etc/sysctl.conf as well.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2018:1859
Description of problem: The init script for iptables /etc/init.d/iptables doesn't support /etc/sysctl.d . load_sysctl() { # load matched sysctl values if [ -n "$IPTABLES_SYSCTL_LOAD_LIST" ]; then echo -n $"Loading sysctl settings: " ret=0 for item in $IPTABLES_SYSCTL_LOAD_LIST; do fgrep $item /etc/sysctl.conf | sysctl -p - >/dev/null <========= let ret+=$?; done [ $ret -eq 0 ] && success || failure echo fi return $ret } That means that if you edit a kernel parameter related to iptables via /etc/sysctl.d/foo.conf , this won't be applied on iptables restart. Version-Release number of selected component (if applicable): kernel 2.6.32-696.3.1.el6.x86_64 iptables-1.4.7-16.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. edit parameter net.nf_conntrack_max via /etc/sysctl.d/iptables.conf 2. restart iptables 3. verify if /proc/sys/net/nf_conntrack_max has been modified Actual results: never updated Expected results: always updated