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 1678111 - ip rule list doesn't support sport/dport/ipproto
Summary: ip rule list doesn't support sport/dport/ipproto
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: iproute
Version: 8.0
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: 8.1
Assignee: Andrea Claudi
QA Contact: Jaroslav Aster
URL:
Whiteboard:
Depends On: 1679662
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-02-18 06:54 UTC by Jianlin Shi
Modified: 2020-11-14 15:49 UTC (History)
3 users (show)

Fixed In Version: iproute-4.18.0-12.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-05 22:26:40 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2019:3602 0 None None None 2019-11-05 22:26:57 UTC

Description Jianlin Shi 2019-02-18 06:54:46 UTC
Description of problem:
ip rule list doesn't support sport/dport/ipproto

Version-Release number of selected component (if applicable):
iproute-4.18.0-11.el8.x86_64

How reproducible:
Always

Steps to Reproduce:
1. ip rule list sport 12345
2.
3.

Actual results:
Error: inet prefix is expected rather than "sport".

Expected results:
the command should pass

Additional info:

[root@kvm-01-guest14 func]# rpm -q iproute     
iproute-4.18.0-11.el8.x86_64
[root@kvm-01-guest14 func]# ip rule help
Usage: ip rule { add | del } SELECTOR ACTION
       ip rule { flush | save | restore }
       ip rule [ list [ SELECTOR ]]
SELECTOR := [ not ] [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark FWMARK[/MASK] ]
            [ iif STRING ] [ oif STRING ] [ pref NUMBER ] [ l3mdev ]
            [ uidrange NUMBER-NUMBER ]
            [ ipproto PROTOCOL ]
            [ sport [ NUMBER | NUMBER-NUMBER ]
            [ dport [ NUMBER | NUMBER-NUMBER ] ]

<=== help shows that ip rule list supports sport/dport/ipproto

ACTION := [ table TABLE_ID ]
          [ protocol PROTO ]
          [ nat ADDRESS ]
          [ realms [SRCREALM/]DSTREALM ]
          [ goto NUMBER ]
          SUPPRESSOR
SUPPRESSOR := [ suppress_prefixlength NUMBER ]
              [ suppress_ifgroup DEVGROUP ]
TABLE_ID := [ local | main | default | NUMBER ]

[root@kvm-01-guest14 func]# ip rule list sport 12345                                          
Error: inet prefix is expected rather than "sport".

Comment 1 Hangbin Liu 2019-02-18 13:06:10 UTC
We need

commit b2e8bf158460568ec5b48cba69f657f95891c901
Author: David Ahern <dsahern>
Date:   Tue Oct 30 15:03:30 2018 -0700

    ip rule: Add ipproto and port range to filter list

    Allow ip rule dumps and flushes to filter based on ipproto, sport
    and dport. Example:

    $ ip ru ls ipproto udp
    99:     from all to 8.8.8.8 ipproto udp dport 53 lookup 1001
    $ ip ru ls dport 53
    99:     from all to 8.8.8.8 ipproto udp dport 53 lookup 1001

    Signed-off-by: David Ahern <dsahern>

Comment 2 Phil Sutter 2019-02-18 13:46:26 UTC
Hey Hangbin,

(In reply to Hangbin Liu from comment #1)
> We need
> 
> commit b2e8bf158460568ec5b48cba69f657f95891c901
> Author: David Ahern <dsahern>
> Date:   Tue Oct 30 15:03:30 2018 -0700

I was about to note just that, you were faster! :)

Thanks, Phil

Comment 7 errata-xmlrpc 2019-11-05 22:26:40 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://access.redhat.com/errata/RHEA-2019:3602


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