Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1136801 - a rule added into IN_<zone>_allow chain with 'permanent direct' interface doesn't exist after reload
a rule added into IN_<zone>_allow chain with 'permanent direct' interface doe...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: firewalld (Show other bugs)
7.1
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Thomas Woerner
Tomas Dolezal
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-03 06:39 EDT by Mario Gamboa
Modified: 2016-11-03 17:00 EDT (History)
5 users (show)

See Also:
Fixed In Version: firewalld-0.4.2-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 17:00:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2597 normal SHIPPED_LIVE Moderate: firewalld security, bug fix, and enhancement update 2016-11-03 08:11:47 EDT

  None (edit)
Comment 3 Jiri Popelka 2014-09-03 08:19:39 EDT
(In reply to Mario Gamboa from comment #0)
> Expected results:
> The rule must be works if we add in the gui via passthrough or via shell
> with the permanent option in the firewall-cmd

The '--permanent' option in firewall-cmd (shell) or
the 'Permanent' view in firewall-config (gui) modifies *only* permanent configuration, not the runtime.

To do a change in 'runtime' as well as 'permanent' configuration you either have to run the firewall-cmd twice, once with '--permanent' and once without it, for example:

# firewall-cmd --permanent --direct --passthrough ipv4 -A IN_drop_allow -p icmp --icmp-type=8 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
# firewall-cmd --direct --passthrough ipv4 -A IN_drop_allow -p icmp --icmp-type=8 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT

*or* add it to permanent configuration and then reload firewalld, i.e.
# firewall-cmd --permanent --direct --passthrough ipv4 -A IN_drop_allow -p icmp --icmp-type=8 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
# firewall-cmd --reload

See also 'Permanent Options' in firewall-cmd(1) man page.
Comment 4 Mario Gamboa 2014-09-03 21:50:42 EDT
Hi jiri

This is the problem actually when the customer try this on the "drop zone" is not working as expected the same happen if he try to open the service of ssh 

# firewall-cmd --permanent --direct --passthrough ipv4 -A IN_drop_allow -p icmp --icmp-type=8 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
# firewall-cmd --reload

only work in runtime for the drop zone and we can't make permanent the rule for this zone, 

if the customer run like this the command works fine but is not permanent for the drop zone 

# firewall-cmd  --direct --passthrough ipv4 -A IN_drop_allow -p icmp --icmp-type=8 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
# firewall-cmd --reload


In the public zone works ok
Comment 5 Mario Gamboa 2014-09-03 21:51:56 EDT
Just to be clear this is happen when the customer change to the zone drop in the zone public is works as expected.
Comment 6 Jiri Popelka 2014-09-04 05:54:46 EDT
Ok, I see it now. But I can see the same even with 'public' zone.

The reason is that when you reload firewalld, firewalld adds the direct rules *before* the chains for zones are created. The chains for zones are first created in a moment when a interface is associated with a zone.

So it fails because IN_drop_allow (or even IN_public_allow in my case) does not yet exist in that moment.
Comment 11 Thomas Woerner 2015-11-05 12:43:50 EST
Besides fixing the issue with being able to add rules to chains of zones, there is also another idea to use icmp-block more like an icmp-filter, that is rejecting for zones using the default or ACCEPT target and that is accepting icmp types for zones using the reject or drop targets.

Is there interest in a change like this?
Comment 14 Mike McCune 2016-03-28 19:42:22 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 15 Tomas Dolezal 2016-04-07 11:30:40 EDT
Thomas, Mario's account has been closed.

Personally I like function behind the idea but this implementation might be very confusing. I mean that function of this field would invisibly depend on default-target which is not shown even in --zone-info=<zone>.
Instead, I suggest 'icmp-filter' (backward compatibile with icmp-block) and added notation like '!' before the list. What do you think?
Comment 17 Tomas Dolezal 2016-04-08 09:13:01 EDT
idea from comments 11 and 15 now has a separate bug 1325335
Comment 21 errata-xmlrpc 2016-11-03 17:00:06 EDT
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://rhn.redhat.com/errata/RHSA-2016-2597.html

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