-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for static route yang model #11499
Conversation
Please update setup.py and sample_config_db.json, for example, #10642 |
|
} | ||
leaf ifname { | ||
type string { | ||
pattern "(Ethernet([1-3][0-9]{3}|[1-9][0-9]{2}|[1-9][0-9]|[0-9])+,)*(Ethernet([1-3][0-9]{3}|[1-9][0-9]{2}|[1-9][0-9]|[0-9])+)"; |
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.
We need the pattern matching for Ethernet, Portchannel, sub-interfaces and VLAN..etc..please check all possible interfaces and do the pattern matching OR leave as string for now and add a custom validation later.
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.
Okay. I will leave it as String & add custom validation later.
} | ||
leaf nexthop-vrf { | ||
type string { | ||
pattern "(((Vrf[a-zA-Z0-9_-]+)|(default)),)*((Vrf[a-zA-Z0-9_-]+)|(default))"; |
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.
How about mgmt VRF?
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.
You mean, "mgmt" as a string?
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.
Yes
} | ||
leaf nexthop { | ||
type string { | ||
pattern '^((((25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)),)*((25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0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){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])))))$'; |
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.
I'm not sure this covers all combinations of IP addresses, we can better have customer validations.
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.
What combinations of IP addresses? 0.0.0.0 is covered. and I tested for couple of IP addresses. Anything else you have in mind?
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.
Will this regexp work for ipv4 embeded ipv6 addresses e.g " ::ffff:192.168.0.1" ? I'm ok if you have covered all combinations in the test cases.
@UmaMaven If you could push the changes for the last few comments, we can merge this PR. |
Hi Venkat, I have uploaded the files with the last few comments as well. |
type union { | ||
type string { | ||
pattern 'default'; | ||
} |
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 'mgmt' string here as well.
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.
@venkatmahalingam Please approve. Thanks
Signed-off-by: Uma Ramanathan uma.ramanathan@mavenir.com
Why I did it
Support yang model for static route
How I did it
Added a yang file for static route configuration
How to verify it
Add static routes with gateway/interface/blackhole as nexthop with VRF capability
#11498
A picture of a cute animal (not mandatory but encouraged)