dainok / netdoc

Automatic Network Documentation plugin for NetBox
GNU General Public License v3.0
89 stars 13 forks source link

Invalid Route Type Error - BGP NXOS #31

Closed Lurick73 closed 1 year ago

Lurick73 commented 1 year ago

When attempting to ingest a NXOS device with BGP routes it seems to keep erroring on the route type, Originally it was erroring because BGP route type was showing as type bgp-(ASN) external so I tried tweaking the textfms to account for that but that didn't seem to solve it since it still errors because it's grabbing the external portion of the show ip route as well.

An exception occurred: ValueError: Invalid route type bgp external Traceback (most recent call last):   
File "/opt/netbox/netbox/extras/scripts.py", line 476, in _run_script     
script.output = script.run(data=data, commit=commit)   File "/opt/netbox/netbox/scripts/NetDoc.py", line 290, in run log_ingest(log)   File "/opt/netbox/venv/lib/python3.10/site-packages/netdoc/utils.py", line 384, in log_ingest     module.ingest(log)
File "/opt/netbox/venv/lib/python3.10/site-packages/netdoc/ingestors/netmiko_cisco_nxos_show_ip_route_vrf_all.py", line 29, in ingest     protocol = utils.normalize_route_type(protocol)
File "/opt/netbox/venv/lib/python3.10/site-packages/netdoc/utils.py", line 693, in normalize_route_type     raise ValueError(f"Invalid route type {route_type}") ValueError: Invalid route type bgp external
dainok commented 1 year ago

Hi @Lurick73!

NTC templates should be modified only if the parsing fails. Customization of NTC templates is not possible because will be dropped.

Depend on the vendor/model, the "show ip route" could report different protocols. Every time users report a new exception, I update normalize_route_type in utils.py:

    if route_type in ["b", "bgp"]:

Can you paste here the "show ip route" from your nexus? (only relevant lines) Or just send me the log via private email.

Lurick73 commented 1 year ago

Hi @Lurick73!

NTC templates should be modified only if the parsing fails. Customization of NTC templates is not possible because will be dropped.

Depend on the vendor/model, the "show ip route" could report different protocols. Every time users report a new exception, I update normalize_route_type in utils.py:

    if route_type in ["b", "bgp"]:

Can you paste here the "show ip route" from your nexus? (only relevant lines) Or just send me the log via private email.

Yah, I reverted the template back I was just testing to see if that was the trigger.

show ip route vrf all
0.0.0.0/0, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 5w6d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 5w6d, bgp-65504, external, tag 64000
1.1.1.0/24, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 5w5d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 5w5d, bgp-65504, external, tag 64000
1.1.1.1/32, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 5w5d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 5w5d, bgp-65504, external, tag 64000
1.1.2.0/31, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 5w6d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 5w6d, bgp-65504, external, tag 64000
1.1.99.0/30, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 5w6d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 5w6d, bgp-65504, external, tag 64000
dainok commented 1 year ago

Thank you @Lurick73. Could you also paste what is parsed in NetDoc? (NetDoc -> Logs -> choose your log, paste a couple of relevant entry from Parsed output.

Lurick73 commented 1 year ago
[{'distance': '20',
  'encap': '',
  'mask': '0',
  'metric': '0',
  'network': '0.0.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.9',
  'nexthop_vrf': '',
  'protocol': 'bgp-64000',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '5w6d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '0',
  'metric': '0',
  'network': '0.0.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.15',
  'nexthop_vrf': '',
  'protocol': 'bgp-64000',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '5w6d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '24',
  'metric': '0',
  'network': '1.1.1.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.9',
  'nexthop_vrf': '',
  'protocol': 'bgp-64000',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '5w5d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '24',
  'metric': '0',
  'network': '1.1.1.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.15',
  'nexthop_vrf': '',
  'protocol': 'bgp-64000',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '5w5d',
  'vrf': 'default'},
dainok commented 1 year ago

Can you test this? https://github.com/dainok/netdoc/pull/32 I don't get why your error is reporting Invalid route type bgp external. It should report bgp-64000

Lurick73 commented 1 year ago

Can you test this? #32 I don't get why your error is reporting Invalid route type bgp external. It should report bgp-64000

Ah, I think that was from when I had modified the textfsm, on a run after that but before trying your fix it did show as you mentioned. I'm currently running the ingest job now and will update shortly after applying the fix.

Lurick73 commented 1 year ago

I was able to get past BGP with a small tweak, I'm a bit stuck on OSPF type-1 and type-2 routes but for now I got past it all with this:

    if re.match(r"^ospf-\S.*$", route_type):  
        # Nexus OSPF Type-1 Area with process
        return "oia"
    if re.match(r"^bgp-\S.*$", route_type):
        # Nexus BGP with process
        return "b"

Other attempts would yield results similar to this:

An exception occurred: ValueError: Invalid route type ospf-1 type-2

Traceback (most recent call last):
  File "/opt/netbox/netbox/extras/scripts.py", line 476, in _run_script
    script.output = script.run(data=data, commit=commit)
  File "/opt/netbox/netbox/scripts/NetDoc.py", line 290, in run
    log_ingest(log)
  File "/opt/netbox/venv/lib/python3.10/site-packages/netdoc/utils.py", line 384, in log_ingest
    module.ingest(log)
  File "/opt/netbox/venv/lib/python3.10/site-packages/netdoc/ingestors/netmiko_cisco_nxos_show_ip_route_vrf_all.py", line 29, in ingest
    protocol = utils.normalize_route_type(protocol)
  File "/opt/netbox/venv/lib/python3.10/site-packages/netdoc/utils.py", line 695, in normalize_route_type
    #    if re.match(r"^ospf-\S.* type-2$", route_type):
ValueError: Invalid route type ospf-1 type-2

or

An exception occurred: ValueError: Invalid route type ospf-1 type-2

Traceback (most recent call last):
  File "/opt/netbox/netbox/extras/scripts.py", line 476, in _run_script
    script.output = script.run(data=data, commit=commit)
  File "/opt/netbox/netbox/scripts/NetDoc.py", line 290, in run
    log_ingest(log)
  File "/opt/netbox/venv/lib/python3.10/site-packages/netdoc/utils.py", line 384, in log_ingest
    module.ingest(log)
  File "/opt/netbox/venv/lib/python3.10/site-packages/netdoc/ingestors/netmiko_cisco_nxos_show_ip_route_vrf_all.py", line 29, in ingest
    protocol = utils.normalize_route_type(protocol)
  File "/opt/netbox/venv/lib/python3.10/site-packages/netdoc/utils.py", line 695, in normalize_route_type
    raise ValueError(f"Invalid route type {route_type}")
ValueError: Invalid route type ospf-1 type-2

Relevant output and pared data:

IP Route Table for VRF "default"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>

0.0.0.0/0, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 6w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 6w0d, bgp-65504, external, tag 64000
1.1.1.0/24, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 5w6d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 5w6d, bgp-65504, external, tag 64000
1.1.1.1/32, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 5w6d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 5w6d, bgp-65504, external, tag 64000
1.1.2.0/31, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 6w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 6w0d, bgp-65504, external, tag 64000
1.1.99.0/30, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 6w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 6w0d, bgp-65504, external, tag 64000
1.2.3.0/24, ubest/mbest: 1/0
    *via 10.11.10.1, Eth5/19, [110/101], 3w4d, ospf-1, intra
1.2.3.4/32, ubest/mbest: 1/0
    *via Null0, [1/0], 6w0d, static
1.10.0.0/24, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.50.12.9/32, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.50.12.198/32, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.50.13.29/32, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.50.13.65/32, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.50.13.131/32, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.50.13.246/32, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.50.14.118/32, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.50.14.232/32, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.50.15.48/32, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.50.19.10/32, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.101.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 6w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 6w0d, bgp-65504, external, tag 64000
1.102.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.103.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.104.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.105.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.106.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.107.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.108.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.109.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.110.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.111.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.112.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.113.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.114.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.115.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.116.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.117.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.118.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.119.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.120.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.121.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.122.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.123.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.124.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.125.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.126.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.127.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.128.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.129.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.130.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.131.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.132.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.133.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.134.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.135.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
1.155.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 2w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 2w0d, bgp-65504, external, tag 64000
2.0.0.0/8, ubest/mbest: 4/0
    *via 10.14.0.1, Eth5/13, [110/101], 3w4d, ospf-1, intra
    *via 10.14.1.1, Eth6/13, [110/101], 3w4d, ospf-1, intra
    *via 10.14.4.1, Eth5/14, [110/101], 3w4d, ospf-1, intra
    *via 10.14.5.1, Eth6/14, [110/101], 3w4d, ospf-1, intra
2.2.2.2/32, ubest/mbest: 1/0
    *via 20.1.1.0, [20/0], 5w6d, bgp-65504, external, tag 100
2.101.0.0/22, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 6w0d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 6w0d, bgp-65504, external, tag 64000
4.4.4.0/24, ubest/mbest: 1/0, attached
    *via 4.4.4.4, Lo4, [0/0], 6w0d, direct
4.4.4.4/32, ubest/mbest: 1/0, attached
    *via 4.4.4.4, Lo4, [0/0], 6w0d, local
5.0.0.0/30, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 5w6d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 5w6d, bgp-65504, external, tag 64000
5.0.1.0/30, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 5w6d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 5w6d, bgp-65504, external, tag 64000
5.0.2.0/30, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 5w6d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 5w6d, bgp-65504, external, tag 64000
5.0.3.0/30, ubest/mbest: 2/0
    *via 10.20.0.9, [20/0], 5w6d, bgp-65504, external, tag 64000
    *via 10.20.0.15, [20/0], 5w6d, bgp-65504, external, tag 64000
5.5.5.0/24, ubest/mbest: 2/0
    *via 10.11.10.1, Eth5/19, [110/20], 3w4d, ospf-1, type-2, tag 12345
    *via 10.11.11.1, Eth6/19, [110/20], 3w4d, ospf-1, type-2, tag 12345
 {'distance': '20',
  'encap': '',
  'mask': '22',
  'metric': '0',
  'network': '1.131.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.15',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '2w0d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '22',
  'metric': '0',
  'network': '1.132.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.9',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '2w0d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '22',
  'metric': '0',
  'network': '1.132.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.15',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '2w0d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '22',
  'metric': '0',
  'network': '1.133.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.9',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '2w0d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '22',
  'metric': '0',
  'network': '1.133.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.15',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '2w0d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '22',
  'metric': '0',
  'network': '1.134.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.9',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '2w0d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '22',
  'metric': '0',
  'network': '1.134.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.15',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '2w0d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '22',
  'metric': '0',
  'network': '1.135.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.9',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '2w0d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '22',
  'metric': '0',
  'network': '1.135.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.15',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '2w0d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '22',
  'metric': '0',
  'network': '1.155.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.9',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '2w0d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '22',
  'metric': '0',
  'network': '1.155.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.15',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '2w0d',
  'vrf': 'default'},
 {'distance': '110',
  'encap': '',
  'mask': '8',
  'metric': '101',
  'network': '2.0.0.0',
  'nexthop_if': 'Eth5/13',
  'nexthop_ip': '10.14.0.1',
  'nexthop_vrf': '',
  'protocol': 'ospf-1',
  'segid': '',
  'tag': '',
  'tunnelid': '',
  'type': 'intra',
  'uptime': '3w4d',
  'vrf': 'default'},
 {'distance': '110',
  'encap': '',
  'mask': '8',
  'metric': '101',
  'network': '2.0.0.0',
  'nexthop_if': 'Eth6/13',
  'nexthop_ip': '10.14.1.1',
  'nexthop_vrf': '',
  'protocol': 'ospf-1',
  'segid': '',
  'tag': '',
  'tunnelid': '',
  'type': 'intra',
  'uptime': '3w4d',
  'vrf': 'default'},
 {'distance': '110',
  'encap': '',
  'mask': '8',
  'metric': '101',
  'network': '2.0.0.0',
  'nexthop_if': 'Eth5/14',
  'nexthop_ip': '10.14.4.1',
  'nexthop_vrf': '',
  'protocol': 'ospf-1',
  'segid': '',
  'tag': '',
  'tunnelid': '',
  'type': 'intra',
  'uptime': '3w4d',
  'vrf': 'default'},
 {'distance': '110',
  'encap': '',
  'mask': '8',
  'metric': '101',
  'network': '2.0.0.0',
  'nexthop_if': 'Eth6/14',
  'nexthop_ip': '10.14.5.1',
  'nexthop_vrf': '',
  'protocol': 'ospf-1',
  'segid': '',
  'tag': '',
  'tunnelid': '',
  'type': 'intra',
  'uptime': '3w4d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '32',
  'metric': '0',
  'network': '2.2.2.2',
  'nexthop_if': '',
  'nexthop_ip': '20.1.1.0',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '100',
  'tunnelid': '',
  'type': 'external',
  'uptime': '5w6d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '22',
  'metric': '0',
  'network': '2.101.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.9',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '6w0d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '22',
  'metric': '0',
  'network': '2.101.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.15',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '6w0d',
  'vrf': 'default'},
 {'distance': '0',
  'encap': '',
  'mask': '24',
  'metric': '0',
  'network': '4.4.4.0',
  'nexthop_if': 'Lo4',
  'nexthop_ip': '4.4.4.4',
  'nexthop_vrf': '',
  'protocol': 'direct',
  'segid': '',
  'tag': '',
  'tunnelid': '',
  'type': '',
  'uptime': '6w0d',
  'vrf': 'default'},
 {'distance': '0',
  'encap': '',
  'mask': '32',
  'metric': '0',
  'network': '4.4.4.4',
  'nexthop_if': 'Lo4',
  'nexthop_ip': '4.4.4.4',
  'nexthop_vrf': '',
  'protocol': 'local',
  'segid': '',
  'tag': '',
  'tunnelid': '',
  'type': '',
  'uptime': '6w0d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '30',
  'metric': '0',
  'network': '5.0.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.9',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '5w6d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '30',
  'metric': '0',
  'network': '5.0.0.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.15',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '5w6d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '30',
  'metric': '0',
  'network': '5.0.1.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.9',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '5w6d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '30',
  'metric': '0',
  'network': '5.0.1.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.15',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '5w6d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '30',
  'metric': '0',
  'network': '5.0.2.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.9',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '5w6d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '30',
  'metric': '0',
  'network': '5.0.2.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.15',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '5w6d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '30',
  'metric': '0',
  'network': '5.0.3.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.9',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '5w6d',
  'vrf': 'default'},
 {'distance': '20',
  'encap': '',
  'mask': '30',
  'metric': '0',
  'network': '5.0.3.0',
  'nexthop_if': '',
  'nexthop_ip': '10.20.0.15',
  'nexthop_vrf': '',
  'protocol': 'bgp-65504',
  'segid': '',
  'tag': '64000',
  'tunnelid': '',
  'type': 'external',
  'uptime': '5w6d',
  'vrf': 'default'},
 {'distance': '110',
  'encap': '',
  'mask': '24',
  'metric': '20',
  'network': '5.5.5.0',
  'nexthop_if': 'Eth5/19',
  'nexthop_ip': '10.11.10.1',
  'nexthop_vrf': '',
  'protocol': 'ospf-1',
  'segid': '',
  'tag': '12345',
  'tunnelid': '',
  'type': 'type-2',
  'uptime': '3w4d',
  'vrf': 'default'},
 {'distance': '110',
  'encap': '',
  'mask': '24',
  'metric': '20',
  'network': '5.5.5.0',
  'nexthop_if': 'Eth6/19',
  'nexthop_ip': '10.11.11.1',
  'nexthop_vrf': '',
  'protocol': 'ospf-1',
  'segid': '',
  'tag': '12345',
  'tunnelid': '',
  'type': 'type-2',
  'uptime': '3w4d',
  'vrf': 'default'},