-
Notifications
You must be signed in to change notification settings - Fork 48
interfaces_ip primary IP check #206
base: develop
Are you sure you want to change the base?
interfaces_ip primary IP check #206
Conversation
For IPv4 addresses, look to add check for primary IP. This method should be backwards compatible with current implementation.
napalm_base/base.py
Outdated
'primary_ip': True | ||
}, | ||
u'10.66.50.1': { | ||
'prefix_length': 24 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the primary key here as well, please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the field in the test models & both old and new testing framework.
As this is a API change, we'll need to apply the changes for the following drivers:
So it might take a while to introduce this. |
Could you create a label and tag all the issues/PRs related to this with it so it's easier to track with zenhub? Thanks! |
Yeah.. lemme install it first and play :) |
Hi @itdependsnetworks - would you be able to provide an implementation for one or more drivers? Here you can see the issues linked to the parent: #207. Thanks! |
Apologies for not getting back. Yea, Should be able to on ios, nxos, junos, and eos. Give me a week or two. |
@itdependsnetworks @mirceaulinic Any update on this enhancement wrt updating the individual drivers? |
Been crazy busy, will try to get to this on the weekend... But I have said that before :( |
@itdependsnetworks Sounds good! In case you are unable to get some of it done by early next week, let me know and maybe I can help out. |
@mirceaulinic @itdependsnetworks I have implemented the changes for napalm_base, eos, and iosxr. Pending merge to base, for the other PR's to pass the checks. |
}, | ||
u'2001:DB8:1::1': { | ||
'prefix_length': 64 | ||
'prefix_length': 64, | ||
'primary_ip': True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no concept of primary or secondary ip on IPv6 so I'd hardcode this to True
for simplicity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, so even when a router needs to source an IP, how does it choose which one?
Does it make sense not to include on IPv6 at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a whole RFC for that (surprise!): https://tools.ietf.org/html/rfc6724
Actually, IPv4 doesn't have the concept at all either. AFAICT only Cisco has the "secondary" keyword. Juniper certainly doesn't.
Does it make sense not to include on IPv6 at all?
You are probably right. You will have to slightly adapt the test so it uses two different models; one for IPv4 and one for IPv6.
For IPv4 addresses, look to add check for primary IP. This method should be backwards compatible with current implementation.