diff --git a/docs/panos-upgrade-assurance/api/firewall_proxy.md b/docs/panos-upgrade-assurance/api/firewall_proxy.md index aad6406..9909fbf 100644 --- a/docs/panos-upgrade-assurance/api/firewall_proxy.md +++ b/docs/panos-upgrade-assurance/api/firewall_proxy.md @@ -504,7 +504,7 @@ Get route table entries, either retrieved from DHCP or configured manually. The actual API command is `show routing route`. -In the returned `dict` the key is made of three route properties delimited with an underscore (`_`) in the following +In the returned `dict` the key is made of four route properties delimited with an underscore (`_`) in the following order: * virtual router name, @@ -1230,6 +1230,16 @@ Get the information from the forwarding information table (FIB). The actual API command run is `show routing fib`. +In the returned `dict` the key is made of three route properties delimited with an underscore (`_`) in the following +order: + +* destination CIDR, +* network interface name, +* next-hop address or name. + +The key does not provide any meaningful information, it's there only to introduce uniqueness for each entry. All +properties that make a key are also available in the value of a dictionary element. + __Returns__ @@ -1237,7 +1247,7 @@ __Returns__ ```python showLineNumbers title="Sample output" { - '0.0.0.0/0_ethernet1/1': { + '0.0.0.0/0_ethernet1/1_10.10.11.1': { 'Destination': '0.0.0.0/0', 'Interface': 'ethernet1/1', 'Next Hop Type': '0', @@ -1245,7 +1255,7 @@ __Returns__ 'Next Hop': '10.10.11.1', 'MTU': '1500' }, - '1.1.1.1/32_loopback.10': { + '1.1.1.1/32_loopback.10_0.0.0.0': { 'Destination': '1.1.1.1/32', 'Interface': 'loopback.10', 'Next Hop Type': '3', diff --git a/examples/readiness_checks/run_readiness_snapshot.py b/examples/readiness_checks/run_readiness_snapshot.py index fa80872..ae52d51 100755 --- a/examples/readiness_checks/run_readiness_snapshot.py +++ b/examples/readiness_checks/run_readiness_snapshot.py @@ -82,6 +82,7 @@ # 'all', "nics", "routes", + "fib_routes", "license", "arp_table", "content_version", diff --git a/panos_upgrade_assurance/firewall_proxy.py b/panos_upgrade_assurance/firewall_proxy.py index 808e250..1a81d6c 100644 --- a/panos_upgrade_assurance/firewall_proxy.py +++ b/panos_upgrade_assurance/firewall_proxy.py @@ -556,7 +556,7 @@ def get_routes(self) -> dict: The actual API command is `show routing route`. - In the returned `dict` the key is made of three route properties delimited with an underscore (`_`) in the following + In the returned `dict` the key is made of four route properties delimited with an underscore (`_`) in the following order: * virtual router name, @@ -1415,13 +1415,23 @@ def get_fib(self) -> dict: The actual API command run is `show routing fib`. + In the returned `dict` the key is made of three route properties delimited with an underscore (`_`) in the following + order: + + * destination CIDR, + * network interface name, + * next-hop address or name. + + The key does not provide any meaningful information, it's there only to introduce uniqueness for each entry. All + properties that make a key are also available in the value of a dictionary element. + # Returns dict: Status of the route entries in the FIB ```python showLineNumbers title="Sample output" { - '0.0.0.0/0_ethernet1/1': { + '0.0.0.0/0_ethernet1/1_10.10.11.1': { 'Destination': '0.0.0.0/0', 'Interface': 'ethernet1/1', 'Next Hop Type': '0', @@ -1429,7 +1439,7 @@ def get_fib(self) -> dict: 'Next Hop': '10.10.11.1', 'MTU': '1500' }, - '1.1.1.1/32_loopback.10': { + '1.1.1.1/32_loopback.10_0.0.0.0': { 'Destination': '1.1.1.1/32', 'Interface': 'loopback.10', 'Next Hop Type': '3', @@ -1455,7 +1465,7 @@ def get_fib(self) -> dict: for entry in entries if isinstance(entries, list) else [entries]: if isinstance(entry, dict): - key = f'{entry["dst"]}_{entry["interface"]}' + key = f'{entry["dst"]}_{entry["interface"]}_{entry["nexthop"]}' result_entry = { "Destination": entry.get("dst"), "Interface": entry.get("interface"), diff --git a/tests/test_firewall_proxy.py b/tests/test_firewall_proxy.py index 856491d..f80c81a 100644 --- a/tests/test_firewall_proxy.py +++ b/tests/test_firewall_proxy.py @@ -1821,7 +1821,7 @@ def test_get_fib_routes(self, fw_proxy_mock): fw_proxy_mock.op.return_value = raw_response assert fw_proxy_mock.get_fib() == { - "0.0.0.0/0_ethernet1/1": { + "0.0.0.0/0_ethernet1/1_10.10.11.1": { "Destination": "0.0.0.0/0", "Interface": "ethernet1/1", "Next Hop Type": "0", @@ -1829,7 +1829,7 @@ def test_get_fib_routes(self, fw_proxy_mock): "Next Hop": "10.10.11.1", "MTU": "1500", }, - "1.1.1.1/32_loopback.10": { + "1.1.1.1/32_loopback.10_1.2.3.4": { "Destination": "1.1.1.1/32", "Interface": "loopback.10", "Next Hop Type": "3",