Add cisco_xr_show_running-config_interface#2241
Conversation
….textfsm Co-authored-by: matt852 <vitale.matt@gmail.com>
….textfsm Co-authored-by: matt852 <vitale.matt@gmail.com>
….textfsm Co-authored-by: matt852 <vitale.matt@gmail.com>
….textfsm Co-authored-by: matt852 <vitale.matt@gmail.com>
- Normalize to NETMASK - Change file format/line ending to unix format
- Make capture groups more self-describing - Establish an normalization standard - Add the capture group names to data model
- Update the recording pattern to be the exclamation mark ! - Match the date stamp more (to avoid inadvertent matches)
|
@mjbear I think adding a plural "NETMASKS" to keep it consistent with singluar/plural IP_ADDRESS(ES) is a good idea. I have a separate PR I'm working to update the data models, and can add this suggestion to it. |
|
@mjbear , I noticed that template still marked as open/WIP. Some more input needed? |
Yes, it's still open. There were varying thoughts on the singular vs plural capture group names which stalled merging this one. Specifically netmasks (despite what I wrote below). Update: I notice my mention contradicts a pattern that has been started in the data model and in templates with IP_ADDRESSES and IPV6_ADDRESSES ... so forget what I wrote, there are precedents. 🫣 👉 I will update the capture group names.
🆕 In looking at this template again, I see that none of the IPv4 lists have more than one value. I have added an IPv4 secondary address by referencing some XR documentation that has an example. And all of the IPv6 lists only have one value as well. @jorlandobr Would you please test this eui-64 configuration on a lab/development XR device? |
* Change NETMASK to be plural * Change IPV6_PREFIX_LENGTH to be plural * Update data_model.md with capture group names and definitions * Regenerate structured test data
matt852
left a comment
There was a problem hiding this comment.
Thanks @jorlandobr, one suggestion before merge:
Add test coverage for the egress ACLs and the swallow-keyword rule. Every fixture interface uses only ingress ACLs, so access_group_out / access_group_v6_out are empty in every record, and the ^\s+(lacp|bundle|dampening|mpls|shutdown|!) rule never fires against the test data. One extra interface covers both. Append to cisco_xr_show_running-config_interface.raw:
+interface TenGigE3/0/0/1
+ description TEST EGRESS ACL
+ shutdown
+ ipv4 access-group iACL-IN ingress
+ ipv4 access-group iACL-OUT egress
+ ipv6 access-group FilterPackIPv6-IN ingress
+ ipv6 access-group FilterPackIPv6-OUT egress
+!Then regenerate the .yml with gen-yaml-folder / clean-yaml-folder and commit both.
|
since are many modifications I tested the new template against a newer box (over 900 interfaces, including bundle ones, that I hadn't before). I had to add new modifications. Please, take a look before I commit them. |
This took a bit to adjust as the output above doesn't base off the latest commit on this branch with the name changes. We need the related raw output to support and test modifications. Important My suggestion would be to This is my attempt at a diff after updating some of the capture group names to match, but it's not precise and can't be easily referenced by line number on GH.
@jorlandobr Please share the raw cli test data to see and explain the changes. Please work off the latest commit 8feb15d and layer on your changes. Thank you! 6a7
> Value MAC_ADDRESS (\S+?)
9c10
< Value List IPV6_ADDRESSES (\S+)
---
> Value List IPV6_ADDRESSES (\S+?)
18,21c19,20
< Value ACCESS_GROUP_IN (\S+)
< Value ACCESS_GROUP_OUT (\S+)
< Value ACCESS_GROUP_V6_IN (\S+)
< Value ACCESS_GROUP_V6_OUT (\S+)
---
> Value ACCESS_GROUP (\S+)
> Value ACCESS_GROUP_V6 (\S+)
37c36,42
< ^\s+ipv4\s+verify\s+unicast\s+source\s+reachable-via\s+${UNICAST_SOURCE}\s+allow-self-ping
---
> ^\s+ipv4\s+verify\s+unicast\s+source\s+reachable-via\s+${UNICAST_SOURCE}(?:\s+allow\S)?
> ^\s+ipv4\s+unnumbered\s+\S
> ^\s+ipv6\s+(nd|verify)\s+\S
> ^\s+logging\s+\S
> ^\s+(mac-accounting|satellite-fabric-link|bfd|remote-ports|rewrite|carrier-delay|negotiation|ethernet|speed)\s+\S
> ^\s+ipv4\s+flowspec\s+disable
> ^\s+ipv6\s+flowspec\s+disable
39c44,45
< ^\s+ipv6\s+address\s+${IPV6_ADDRESSES}\/+${IPV6_PREFIX_LENGTHS}\s*(eui-64)?$$
---
> ^\s+ipv6\s+address\s+${IPV6_ADDRESSES}((?:\s+link-local)?|(?:\/+${IPV6_PREFIX_LENGTHS}\s*$$)?)
> ^\s+mac-address\s+${MAC_ADDRESS}
42a49
> ^\s+ipv6\s+mtu\s+\S
47,55c54,58
< ^\s+encapsulation\s+dot1q\s+${OUTER_VLAN}(?:\s+second-dot1q\s+${INNER_VLAN})?
< ^\s+(lacp|bundle|dampening|mpls|shutdown|!)
< ^\s+ipv4\s+access-group\s+${ACCESS_GROUP_IN}\s+ingress
< ^\s+ipv4\s+access-group\s+${ACCESS_GROUP_OUT}\s+egress
< ^\s+ipv6\s+access-group\s+${ACCESS_GROUP_V6_IN}\s+ingress
< ^\s+ipv6\s+access-group\s+${ACCESS_GROUP_V6_OUT}\s+egress
< ^!$$ -> Record
< # date stamp
< ^\w+\s+\w+\s+\d+
---
> ^\s+encapsulation\s+(?:untagge|dot1q\s+${OUTER_VLAN})?(?:\s+second-dot1q\s+${INNER_VLAN})?
> ^\s+(lacp|bundle|dampening|mpls|shutdown|nv|lldp|l2transport|cdp|!)
> ^\s+ipv4\s+access-group\s+${ACCESS_GROUP}\s+(ingress|egress)
> ^\s+ipv6\s+access-group\s+${ACCESS_GROUP_V6}\s+(ingress|egress)
> ^\S+ -> Record |
Added configuration for new interfaces and updated existing settings.
Updated interface configurations with new attributes and values.
| ipv4 address 10.230.130.5 255.255.255.254 | ||
| ipv6 address 2804:a8:2:b8::13a9/126 | ||
| ipv6 address fe80::1000:16:3/126 link-local | ||
| ipv6 address fe80::1000:16:2 link-local |
There was a problem hiding this comment.
The missing prefix length on raw file line 111, and 113 likely resulted in the None as seen in the parsed yaml file on lines 259 and 261.
The /19 prefix length on line 114 may seem off, but is otherwise valid.
Thank you @jorlandobr I updated a couple of capture group names to match the data_model.md I also added a note about some lines in the raw file that show up with a prefix length of |
|
Dumping a xr box I had IPv6 lines ending with link-local and eui-64 without prefix lengths, so I added these lines. It's not an exercise, it's a real value. The /19 line was an exercise 🙂 |
Glad I asked - thank you @jorlandobr! |
Template and test files for Cisco XR command
show running-config interface.