Bug 2031521

Summary: RFE: Support Routing Tables in static routes in Network Role
Product: Red Hat Enterprise Linux 8 Reporter: Wen Liang <wenliang>
Component: rhel-system-rolesAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: Jon Trossbach <jtrossba>
Severity: unspecified Docs Contact: Eliane Ramos Pereira <elpereir>
Priority: unspecified    
Version: 8.6CC: djez, elpereir, ferferna, fge, jtrossba, nhosoi, pkettman, rbobek, rmeggins, spetrosi, till, zhguan
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: role:network
Fixed In Version: rhel-system-roles-1.13.0-1.el8 Doc Type: Enhancement
Doc Text:
.The `network` RHEL System Role now supports both `named` and `numeric` routing tables in static routes. This update adds support for both the `named` and `numeric` routing tables in static routes, which is a prerequisite for supporting the policy routing (for example, source routing). The users can define policy routing rules later to instruct the system which table to use to determine the correct route. As a result, after the user specifies the `table` attribute in the `route`, the system can add routes into the routing table.
Story Points: ---
Clone Of:
: 2049798 (view as bug list) Environment:
Last Closed: 2022-05-10 14:12:46 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:    
Bug Blocks: 2049798    

Description Wen Liang 2021-12-12 14:17:25 UTC
Description of problem:

General Requirement (User Story) 
As a user, I can use the policy routing, so that I can forward the packet based on other criteria except the destination address in the packet. (e.g. Source Routing)

Acceptance Criteria: 
- Given a Linux system, 
  when a user applies the following playbook,
  ```
    network_connections:
      - name: eth0
        state: up
        type: ethernet
        ip:
          dhcp4: no
          address:
           - 198.51.100.3/26
          route:
           - network: 198.51.100.128
             prefix: 26
             gateway: 198.51.100.1
             metric: 2
  +	     table: 30400  
           - network: 198.51.100.64
             prefix: 26
             gateway: 198.51.100.6
             metric: 4
  +	     table: 30200
  ```
  then `ip route` will show "198.51.100.128/26 via 198.51.100.1 dev eth0 metric 2 table 30400" and "198.51.100.64/26 via 198.51.100.6 dev eth0 metric 4 table 30200"

- Given a Linux system, 
  when a user applies the following playbook,
  ```
  hosts: all
  tasks:
    - name: Add a new routing table
      lineinfile:
        path: /etc/iproute2/rt_tables
        line: "200 custom"

    - name: Set up the network connection
      import_role:
        name: linux-system-roles.network
      vars:
        network_connections:
          - name: eth0
            state: up
            type: ethernet
            ip:
              dhcp4: no
              address:
               - 198.51.100.3/26
              route:
               - network: 198.51.100.128
                 prefix: 26
                 gateway: 198.51.100.1
                 metric: 2
  +	         table: custom 
               - network: 198.51.100.64
                 prefix: 26
                 gateway: 198.51.100.6
                 metric: 4
  +	         table: custom
  ```
  then `ip route` will show "198.51.100.128/26 via 198.51.100.1 dev eth0 metric 2 table custom" and "198.51.100.64/26 via 198.51.100.6 dev eth0 metric 4 table custom"


Notice that the Network role will support both the named and numeric tables. 

How to test:
`ip route` will list the routes and the associated routing tables.

Comment 1 Wen Liang 2021-12-13 12:22:05 UTC
*** Bug 2020243 has been marked as a duplicate of this bug. ***

Comment 6 Fernando F. Mancera 2022-01-27 17:19:42 UTC
I have tested this manually with different VM images. In addition, I have run the integration tests and they are not finding any regression.

Comment 21 errata-xmlrpc 2022-05-10 14:12:46 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 (rhel-system-roles 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-2022:1896