.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.
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.
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
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.