napalm-automation / napalm

Network Automation and Programmability Abstraction Layer with Multivendor support
Apache License 2.0
2.23k stars 551 forks source link

vrf `default` in vrf list twice #1919

Closed jlixfeld closed 1 year ago

jlixfeld commented 1 year ago

Description of Issue/Question

Note: Please check https://guides.github.com/features/mastering-markdown/ to see how to properly format your request.

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

(Place an x between the square brackets where applicable)

Setup

napalm version

(Paste verbatim output from pip freeze | grep napalm between quotes below)

root ➜ /workspaces/python $ pip freeze | grep napalm
napalm==4.0.0
root ➜ /workspaces/python $ 

Network operating system version

(Paste verbatim output from show version - or equivalent - between quotes below)

Arista DCS-7280SR3-48YC8-F
Hardware version: 11.02
Serial number: JPE21101297
Hardware MAC address: 948e.d351.f8aa
System MAC address: 948e.d351.f8aa

Software image version: 4.25.5M
Architecture: i686
Internal build version: 4.25.5M-23663359.4255M
Internal build ID: b866497b-0134-4bb1-b262-a6aedd8cf7c6

Uptime: 1 weeks, 2 days, 2 hours and 27 minutes
Total memory: 8147232 kB
Free memory: 4597344 kB

Steps to Reproduce the Issue

driver = get_network_driver('eos')
device = driver("arista", "admin", "admin")
device.open()
device.get_route_to("10.0.9.1")

Error Traceback

(Paste the complete traceback of the exception between quotes below)

Output for VRF default is returned twice by get_route_to():

{'10.0.9.1/32': [{'current_active': True,
   'last_active': True,
   'age': 0,
   'next_hop': '100.2.9.9',
   'protocol': 'ISISLevel2',
   'outgoing_interface': 'Ethernet1/1',
   'preference': 115,
   'inactive_reason': '',
   'routing_table': 'default',
   'selected_next_hop': True,
   'protocol_attributes': {}},
  {'current_active': True,
   'last_active': True,
   'age': 0,
   'next_hop': '100.2.9.9',
   'protocol': 'ISISLevel2',
   'outgoing_interface': 'Ethernet1/1',
   'preference': 115,
   'inactive_reason': '',
   'routing_table': 'default',
   'selected_next_hop': True,
   'protocol_attributes': {}}]}

The function to get the route - https://github.com/napalm-automation/napalm/blob/cb4845c40017a3e8e3c2b4e57838de2fd31a1348/napalm/eos/eos.py#L1450

... calls _show_vrf -

https://github.com/napalm-automation/napalm/blob/cb4845c40017a3e8e3c2b4e57838de2fd31a1348/napalm/eos/eos.py#L2121-L2138

which, regardless whether or not default is returned by the system, added to the list of VRFs.

bewing commented 1 year ago

I am slightly confused here -- Do you have a vrf literally named "default" on your router? default in this output means "no VRF", IE the default routing table. Do newer versions of EOS explicitly list the default VRF in the "show vrf" output?

jlixfeld commented 1 year ago

I can't speak to anything < 4.25.5M, but on that version, yes default is in there by... default:

cdv459-9.10:10:40#show vrf
Maximum number of vrfs allowed: 1023
   VRF              RD              Protocols       State            Interfaces
---------------- --------------- --------------- ------------------- ---------------------------
   default          <not set>       ipv4,ipv6       v4:routing,      Ethernet1, Ethernet2,
                                                    v6:no routing    Ethernet3, Ethernet4,
                                                                     Ethernet49/1, Ethernet5,
                                                                     Ethernet50/1, Ethernet52/1,
                                                                     Ethernet53/1, Ethernet54/1,
                                                                     Ethernet55/1, Ethernet56/1,
                                                                     Loopback0
   management       <not set>       ipv4,ipv6       v4:routing,      Management1
                                                    v6:no routing

cdv459-9.10:10:46#
cdv459-9.10:14:57#show run | i vrf instance
vrf instance management
cdv459-9.10:15:02#
bewing commented 1 year ago

Ack, playing with the above show vrf, there might be a bug in the TextFSM template as well. :/

bewing commented 1 year ago

@jlixfeld, can you relate what the return value of get_network_instances when ran against the device in question, and open a new issue if it's not as expected (I suspect default will have a v6:no "interface" in it