Hi,
Adding a route using IPRoute module. Route addition just works fine.
However, we are observing one specific behavior. Looks like route addition is not considering priority.
'raw' NLA notation:
ip.route("add", dst="
10.0.0.0/24", gateway="192.168.58.1",
metrics={'attrs': [('RTA_PRIORITY', 123)]})
[{'header': {'pid': 11458, 'length': 36, 'flags': 0, 'error': None, 'type': 2, 'sequence_number': 257}, 'event': 'NLMSG_ERROR'}]
or
Simplified way:
ip.route("add", dst="
10.0.0.0/24", gateway="192.168.58.1", metrics={"priority": 123})
[{'header': {'pid': 11458, 'length': 36, 'flags': 0, 'error': None, 'type': 2, 'sequence_number': 257}, 'event': 'NLMSG_ERROR'}]
There is no error while adding the route. However we don't view the metric in the route dump.
>ip r
10.0.0.0/24 via 192.168.58.1 dev eth0 proto static
>>> ip.route('dump')[2]
{'family': 2, 'dst_len': 24, 'proto': 4, 'tos': 0, 'event': 'RTM_NEWROUTE', 'header': {'pid': 11458, 'length': 60, 'flags': 2, 'error': None, 'type': 24, 'sequence_number': 261}, 'flags': 0, 'attrs': [('RTA_TABLE', 254), ('RTA_DST', '10.0.0.0'), ('RTA_GATEWAY', '192.168.58.1'), ('RTA_OIF', 2)], 'table': 254, 'src_len': 0, 'type': 1, 'scope': 0}
Kindly let us know if we are missing anything here.
Thanks in advance.
Br,
Ragan