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.

Bug 1182671

Summary: Can`t delete direct rule using firewall-cmd
Product: Red Hat Enterprise Linux 7 Reporter: Thomas Woerner <twoerner>
Component: firewalldAssignee: Thomas Woerner <twoerner>
Status: CLOSED ERRATA QA Contact: Tomas Dolezal <todoleza>
Severity: unspecified Docs Contact:
Priority: high    
Version: 7.0CC: extras-qa, jpopelka, jscotka, pvrabec, sergei.solomonov, todoleza, twoerner
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: An already removed permanent direct rule has been re-applied while reloading if it was applied in runtime before. Consequence: It was not possible to simply remove a permanent direct rule with a reload without removing the rule also in the runtime environment. Fix: Only direct rules added to runtime only are automatically re-applied while reloading. Direct rules in the permanent environment are also applied as before. Result: No already removed permenent direct rules after reload.
Story Points: ---
Clone Of: 1182641 Environment:
Last Closed: 2015-11-19 12:59:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1182641    
Bug Blocks:    

Description Thomas Woerner 2015-01-15 16:53:40 UTC
+++ This bug was initially created as a clone of Bug #1182641 +++

Description of problem:
Can`t delete direct rule using firewall-cmd tool

Version-Release number of selected component (if applicable):
version 0.3.13

How reproducible:


Steps to Reproduce:
# firewall-cmd --permanent --direct --add-rule ipv4 nat OUTPUT 0 -s 127.0.0.1 -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 81
# firewall-cmd --reload
# firewall-cmd --permanent --direct --remove-rule ipv4 nat OUTPUT 0 -s 127.0.0.1 -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 81
# firewall-cmd --permanent --direct --add-rule ipv4 nat OUTPUT 0 -s 127.0.0.1 -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 82
# firewall-cmd --reload
# firewall-cmd --direct --get-all-rules
Actual results:
ipv4 nat OUTPUT 0 -s 127.0.0.1 -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 81
ipv4 nat OUTPUT 0 -s 127.0.0.1 -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 82

Expected results:
ipv4 nat OUTPUT 0 -s 127.0.0.1 -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 82

Additional info:
Also tested on Oracle Enterprise Linux 7, version 0.3.9

--- Additional comment from Thomas Woerner on 2015-01-15 11:48:38 EST ---

Fixed upstream: https://git.fedorahosted.org/cgit/firewalld.git/commit/?id=133e8e7cc77dfe10269ac146f3c03810f50062dd

--- Additional comment from Thomas Woerner on 2015-01-15 11:52:36 EST ---

Permanent direct settings are not recognized as such while reloading firewalld after adding the settings to the permanent environment if firewalld has been reloaded after adding the settings in the first place and after they have been removed again from the permanent environment.

A new test has been added to firewall-cmd_test.sh for verification.

Comment 4 errata-xmlrpc 2015-11-19 12:59:45 UTC
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/RHBA-2015-2422.html