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 2128415 - [RFE] Support all possible formats supported by 'ip rule' command
Summary: [RFE] Support all possible formats supported by 'ip rule' command
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: nmstate
Version: 9.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Gris Ge
QA Contact: Mingyu Shi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-20 13:29 UTC by Karthik Sundaravel
Modified: 2023-05-09 08:22 UTC (History)
5 users (show)

Fixed In Version: nmstate-2.2.2-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-09 07:31:48 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github nmstate nmstate pull 2156 0 None open route rule: Add support of `iif` and `action`. 2022-12-13 11:48:41 UTC
Red Hat Issue Tracker RHELPLAN-141975 0 None None None 2022-12-13 11:04:38 UTC
Red Hat Product Errata RHBA-2023:2190 0 None None None 2023-05-09 07:32:03 UTC

Description Karthik Sundaravel 2022-09-20 13:29:22 UTC
os-net-config supports setting route rules as supported by 'ip rule' command [1]. NetworkManager also supports the same format (ip rule). Its found that nmstate supports only a minimal subset of the possible rules [2]. We would like to have the complete 'ip rule' [3] format supported in nmstate as well. 

[1] https://github.com/openstack/os-net-config/blob/012b58ccc1623945c4428e82eec80b2f3f22d6b7/etc/os-net-config/samples/routes.yaml#L29  
[2] https://github.com/nmstate/nmstate/blob/base/rust/src/python/libnmstate/schema.py#L58
[3] https://man7.org/linux/man-pages/man8/ip-rule.8.html

Comment 2 Gris Ge 2022-12-13 11:48:10 UTC
Patch posted to upstream: https://github.com/nmstate/nmstate/pull/2156


Example yaml:

```yml
---
routes:
  config:
  - destination: 192.168.2.0/24
    metric: 108
    next-hop-address: 192.168.1.3
    next-hop-interface: eth1
    table-id: 200
  - destination: 2001:db8:a::/64
    metric: 108
    next-hop-address: 2001:db8:1::2
    next-hop-interface: eth1
    table-id: 200
route-rules:
  config:
    - iif: eth1
      family: ipv4
      route-table: 200
    - iif: eth1
      ip-from: 192.168.3.3/32
      action: prohibit
    - ip-from: 2001:db8:b::/64
      action: blackhole
    - ip-from: 2001:db8:c::/64
      action: unreachable
interfaces:
  - name: eth1
    type: ethernet
    state: up
    mtu: 1500
    ipv4:
      enabled: true
      dhcp: false
      address:
      - ip: 192.168.1.1
        prefix-length: 24
    ipv6:
      enabled: true
      dhcp: false
      autoconf: false
      address:
      - ip: 2001:db8:1::1
        prefix-length: 64
```

Comment 5 Mingyu Shi 2023-01-13 05:41:22 UTC
Verified with:
nmstate-2.2.3-2.el9.x86_64
nispor-1.2.9-1.el9.x86_64
NetworkManager-1.41.7-2.el9.x86_64
DISTRO=RHEL-9.2.0-20230102.0

Added new configurable items(not all in ip-rule command): iff, action(blackhole, prohibit, unreachable)

Comment 7 errata-xmlrpc 2023-05-09 07:31:48 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 (nmstate bug fix and enhancement update), 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-2023:2190


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