diff --git a/docs/dev/data_model.md b/docs/dev/data_model.md index 768c33c76a..f4159b1909 100644 --- a/docs/dev/data_model.md +++ b/docs/dev/data_model.md @@ -30,6 +30,7 @@ Example: Imagine the extra programming logic needed to consume structured data w | `CHASSIS_ID` | often represents CDP or LLDP neighbor chassis ID | | `DESCRIPTION` | often used for port or interface descriptions | | `GATEWAY` | gateway address for a subnet | +| `INNER_VLAN` | inner 802.1Q VLAN in relation to dot1Q / Q-in-Q tunneling | | `INTERFACE` | full word instead of IFACE, INTF, INTFC, etc | | `IP_ADDRESS` | for a single IP address, often IPv4 | | `IP_ADDRESSES` | for lists of IPv4 addresses, but in the case of some templates there may be a mix of IP protocol versions | @@ -38,6 +39,8 @@ Example: Imagine the extra programming logic needed to consume structured data w | `IPV6_ADDRESS` | for a single IPv6 address | | `IPV6_ADDRESSES` | for lists of IPv6 addresses | | `IPV6_GATEWAY` | for IPv6 gateway address | +| `IPV6_PREFIX_LENGTH` | for IPv6 prefix length | +| `IPV6_PREFIX_LENGTHS` | for lists of IPv6 prefix lengths | | `LOCAL_INTERFACE` | often represents local interface or port for CDP or LLDP | | `LOCAL_IP_ADDRESS` | local IP address in the case of First Hop Redundancy Protocols (FHRP) | | `MAC_ADDRESS` | instead of MAC or MACADDR | @@ -50,8 +53,10 @@ Example: Imagine the extra programming logic needed to consume structured data w | `NEIGHBOR_INTERFACE` | often represents neighbor or remote interface or port for CDP or LLDP | | `NEIGHBOR_INTERFACE_DESCRIPTION` | represents CDP or LLDP neighbor (remote host) interface or port descriptions (Note: see NEIGHBOR_INTERFACE) | | `NEIGHBOR_NAME` | often represents neighbor name for CDP or LLDP | -| `NETMASK` | for IPv4 dotted quad masks | -| `NETWORK` | for network numbers or subnet address (without the mask or prefix/slash notation); in place of ROUTE | +| `NETMASK` | for IPv4 dotted quad mask (netmask) | +| `NETMASKS` | for lists of IPv4 dotted quad masks (netmasks) | +| `NETWORK` | for network number or subnet address (without the mask or prefix/slash notation); in place of ROUTE | +| `OUTER_VLAN` | outer 802.1Q VLAN in relation to dot1Q / Q-in-Q tunneling | | `PID` | represents Part IDs (PIDs), Stock Keeping Units (SKUs), and in some cases Models or Model Numbers | `PLATFORM` | often represents CDP or LLDP neighbor's platform or model name/number | | `PREFIX_LENGTH` | instead of PREFIX or CIDR for the numbers of a slash notation or CIDR mask | diff --git a/ntc_templates/templates/cisco_xr_show_running-config_interface.textfsm b/ntc_templates/templates/cisco_xr_show_running-config_interface.textfsm new file mode 100644 index 0000000000..fa262338b2 --- /dev/null +++ b/ntc_templates/templates/cisco_xr_show_running-config_interface.textfsm @@ -0,0 +1,59 @@ +Value Required INTERFACE (\S+) +Value DESCRIPTION (.*) +Value BANDWIDTH (\d+) +Value OUTER_VLAN (\d+) +Value INNER_VLAN (\d+) +Value VRF (\S+) +Value MAC_ADDRESS (\S+?) +Value List IP_ADDRESSES (\d+.\d+.\d+.\d+) +Value List NETMASKS (\d+.\d+.\d+.\d+) +Value List IPV6_ADDRESSES ([0-9a-fA-F:]+) +Value List IPV6_PREFIX_LENGTHS (\d+) +Value LOAD_INTERVAL (\d+) +Value MTU (\d+) +Value MTU_IPV4 (\d+) +Value UNICAST_SOURCE (\S+) +Value UNICAST_SOURCE_V6 (\S+) +Value INPUT_POLICY (\S+) +Value OUTPUT_POLICY (\S+) +Value ACCESS_GROUP (\S+) +Value ACCESS_GROUP_V6 (\S+) +Value FLOW_MONITOR (\S+) +Value FLOW_MONITOR_V6 (\S+) +Value FLOW_MPLS (\S+) +Value FLOW_SAMPLER (\S+) +Value FLOW_SAMPLER_V6 (\S+) +Value FLOW_MPLS_SAMPLER (\S+) + +Start + ^interface\s+${INTERFACE} + ^\s+description\s+${DESCRIPTION} + ^\s+bandwidth\s+${BANDWIDTH} + ^\s+service-policy\s+input\s+${INPUT_POLICY} + ^\s+service-policy\s+output\s+${OUTPUT_POLICY} + ^\s+vrf\s+${VRF} + ^\s+ipv4\s+address\s+${IP_ADDRESSES}\s+${NETMASKS}(?:\s+secondary)? + ^\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+ipv(4|6)\s+flowspec\s+disable + ^\s+ipv6\s+verify\s+unicast\s+source\s+reachable-via\s+${UNICAST_SOURCE_V6}\s+allow-self-ping + ^\s+ipv6\s+address\s+${IPV6_ADDRESSES}(?:\/+${IPV6_PREFIX_LENGTHS})?((?:\s+\S)?) + ^\s+mac-address\s+${MAC_ADDRESS} + ^\s+mtu\s+${MTU} + ^\s+ipv4\s+mtu\s+${MTU_IPV4} + ^\s+ipv6\s+enable + ^\s+ipv6\s+mtu\s+\S + ^\s+load-interval\s+${LOAD_INTERVAL} + ^\s+flow\s+ipv4\s+monitor\s+${FLOW_MONITOR}\s+sampler\s+${FLOW_SAMPLER}\s+ingress + ^\s+flow\s+ipv6\s+monitor\s+${FLOW_MONITOR_V6}\s+sampler\s+${FLOW_SAMPLER_V6}\s+ingress + ^\s+flow\s+mpls\s+monitor\s+${FLOW_MPLS}\s+sampler\s+${FLOW_MPLS_SAMPLER}\s+ingress + ^\s+encapsulation\s+(?:untagge|dot1q\s+${OUTER_VLAN})?(?:\s+second-dot1q\s+${INNER_VLAN})? + ^\s+(mac-accounting|satellite-fabric-link|bfd|remote-ports|rewrite|carrier-delay|lacp|!) + ^\s+(bundle|dampening|mpls|shutdown|nv|lldp|l2transport|cdp|negotiation|ethernet|speed|logging) + ^\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 + # date stamp + ^\w+\s+\w+\s+\d+ + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 48f8f88294..ef45c413f4 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -547,6 +547,7 @@ cisco_xr_show_controllers_hundredgige_all.textfsm, .*, cisco_xr, sh[[ow]] contro cisco_xr_show_configuration_commit_list.textfsm, .*, cisco_xr, sh[[ow]] conf[[iguration]] c[[ommit]] l[[ist]] cisco_xr_show_asic-errors_all_location.textfsm, .*, cisco_xr, sh[[ow]] asic-er[[rors]] all loc[[ation]] cisco_xr_show_bgp_instance_all_summary.textfsm, .*, cisco_xr, sh[[ow]] bg[[p]] ins[[tance]] (\S+) sum[[mary]] +cisco_xr_show_running-config_interface.textfsm, .*, cisco_xr, sh[[ow]] run[[ning-config]] int[[erface]] cisco_xr_admin_show_environment_power.textfsm, .*, cisco_xr, adm[[in]] sh[[ow]] env[[ironment]] p[[ower]] cisco_xr_show_dhcp_ipv4_proxy_binding.textfsm, .*, cisco_xr, sh[[ow]] dh[[cp]] ipv4 p[[roxy]] b[[inding]] cisco_xr_show_mpls_ldp_neighbor_brief.textfsm, .*, cisco_xr, sh[[ow]] mp[[ls]] ld[[p]] neigh[[bor]] br[[ief]] diff --git a/tests/cisco_xr/show_running-config_interface/cisco_xr_show_running-config_interface.raw b/tests/cisco_xr/show_running-config_interface/cisco_xr_show_running-config_interface.raw new file mode 100644 index 0000000000..85ada00a7f --- /dev/null +++ b/tests/cisco_xr/show_running-config_interface/cisco_xr_show_running-config_interface.raw @@ -0,0 +1,137 @@ +Thu Nov 6 12:54:14.972 BRA +interface TenGigE2/1/0/0.1234256 + description TESTONE | 50M + bandwidth 50000 + service-policy input IN_BAND_S_50000_V1 + service-policy output OUT_BAND_S_50000_V1 + ipv4 address 10.242.26.65 255.255.255.252 + ipv4 verify unicast source reachable-via rx allow-self-ping + ipv6 verify unicast source reachable-via tx allow-self-ping + ipv6 address fe80:a8:2:b0::309/126 + load-interval 30 + encapsulation dot1q 1234 + ipv4 access-group iACL ingress + ipv6 access-group FilterPackIPv6 ingress +! +interface TenGigE2/4/0/2.22227 + description PEOPLE | 100M + bandwidth 100000 + service-policy input IN_BAND_S_100000_V1 + service-policy output OUT_BAND_S_100000_V1 + ipv4 address 10.23.125.209 255.255.255.252 + ipv4 verify unicast source reachable-via tx allow-self-ping + ipv6 verify unicast source reachable-via rx allow-self-ping + ipv6 address fe80:a8:2:b8::a671/126 + load-interval 30 + encapsulation dot1q 2222 second-dot1q 7 + ipv4 access-group iACL ingress + ipv6 access-group FilterPackIPv6 ingress +! +interface TenGigE2/4/0/2.22229 + description AVENIDA | 100M + bandwidth 100000 + service-policy input IN_BAND_S_100000_V1 + service-policy output OUT_BAND_S_100000_V1 + ipv4 address 10.228.247.93 255.255.255.252 + ipv4 verify unicast source reachable-via any allow-self-ping + ipv6 verify unicast source reachable-via any allow-self-ping + ipv6 address fe80:a8:2:b8::10ed/126 + load-interval 30 + encapsulation dot1q 2222 second-dot1q 9 + ipv4 access-group iACL ingress + ipv6 access-group FilterPackIPv6 ingress +! +interface TenGigE2/4/0/2.10012 + description MONTE EVEREST | 1500K + bandwidth 1500 + service-policy output OUT_SIP_VOICE_1500 + vrf FONE_CLIENT:5341 + ipv4 address 10.86.193.193 255.255.255.252 + ipv4 verify unicast source reachable-via rx allow-self-ping + load-interval 30 + encapsulation dot1q 1001 second-dot1q 2 +! +interface TenGigE2/4/0/2.1002 + description TEST PASS| 100M + bandwidth 100000 + service-policy input IN_100000K_1_0_1_0_0_1_1 + service-policy output OUT_100000K_1_0_1_0_0_1_1 + vrf FEED_HUB:1245 + ipv4 address 10.245.37.157 255.255.255.252 + ipv6 address fe80:a8:2:2b8::751/126 + load-interval 30 + encapsulation dot1q 1002 +! +interface TenGigE2/4/0/2.10023 + description BLUE | 2048K + bandwidth 2048 + service-policy input IN_BLUE_2M_0_0_0_98_0_1_XR_V1 + service-policy output OUT_BLUE_2M_0_0_0_98_0_1_XR_V1 + vrf OBS_CHIN:1236 + ipv4 address 192.168.226.53 255.255.255.252 + ipv6 address fe80:a8:2:2b8::ac5/126 + load-interval 30 + encapsulation dot1q 1002 second-dot1q 3 +! +interface TenGigE3/0/0/0 + description TEST MTU and FLOW + mtu 9216 + ipv4 mtu 9000 + flow ipv4 monitor IPV4-MONITOR sampler IPV4-SAMPLER ingress + flow ipv6 monitor IPV6-MONITOR sampler IPV6-SAMPLER ingress + flow mpls monitor MPLS-MONITOR sampler MPLS-SAMPLER ingress +! +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 +! +interface Bundle-Ether10 + description TEST STRINGS + bfd mode ietf + bfd address-family ipv4 multiplier 3 + bfd address-family ipv4 destination 10.230.130.4 + bfd address-family ipv4 fast-detect + bfd address-family ipv4 minimum-interval 100 + mtu 9208 + lldp + ipv4 flowspec disable + ipv6 flowspec disable + service-policy output SubRate_200 + mac-accounting ingress + encapsulation dot1q 31 exact + rewrite ingress tag pop 1 symmetric + ipv4 mtu 9180 + 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 + ipv6 address fe80:388:129:16::3/64 eui-64 + ipv6 address fe80:388:129:16::24 eui-64 + ipv6 address fe80:0cB8:0:1::/19 + ipv6 address fe80:0D18:0:1::/64 eui-64 + logging events link-status + mpls + mtu 9180 +! +interface Bundle-Ether100 + shutdown + description satellite100 + cdp + carrier-delay up 0 down 0 + lacp period short + load-interval 30 + dampening + ethernet udld + l2transport + speed 1000 + negotiation auto + nv + satellite-fabric-link satellite 100 + remote-ports GigabitEthernet 0/0/0 - 43 + ! + ! +! diff --git a/tests/cisco_xr/show_running-config_interface/cisco_xr_show_running-config_interface.yml b/tests/cisco_xr/show_running-config_interface/cisco_xr_show_running-config_interface.yml new file mode 100644 index 0000000000..79d0d23c42 --- /dev/null +++ b/tests/cisco_xr/show_running-config_interface/cisco_xr_show_running-config_interface.yml @@ -0,0 +1,300 @@ +--- +parsed_sample: + - access_group: "iACL" + access_group_v6: "FilterPackIPv6" + bandwidth: "50000" + description: "TESTONE | 50M" + flow_monitor: "" + flow_monitor_v6: "" + flow_mpls: "" + flow_mpls_sampler: "" + flow_sampler: "" + flow_sampler_v6: "" + inner_vlan: "" + input_policy: "IN_BAND_S_50000_V1" + interface: "TenGigE2/1/0/0.1234256" + ip_addresses: + - "10.242.26.65" + ipv6_addresses: + - "fe80:a8:2:b0::309" + ipv6_prefix_lengths: + - "126" + load_interval: "30" + mac_address: "" + mtu: "" + mtu_ipv4: "" + netmasks: + - "255.255.255.252" + outer_vlan: "1234" + output_policy: "OUT_BAND_S_50000_V1" + unicast_source: "rx" + unicast_source_v6: "" + vrf: "" + - access_group: "iACL" + access_group_v6: "FilterPackIPv6" + bandwidth: "100000" + description: "PEOPLE | 100M" + flow_monitor: "" + flow_monitor_v6: "" + flow_mpls: "" + flow_mpls_sampler: "" + flow_sampler: "" + flow_sampler_v6: "" + inner_vlan: "7" + input_policy: "IN_BAND_S_100000_V1" + interface: "TenGigE2/4/0/2.22227" + ip_addresses: + - "10.23.125.209" + ipv6_addresses: + - "fe80:a8:2:b8::a671" + ipv6_prefix_lengths: + - "126" + load_interval: "30" + mac_address: "" + mtu: "" + mtu_ipv4: "" + netmasks: + - "255.255.255.252" + outer_vlan: "2222" + output_policy: "OUT_BAND_S_100000_V1" + unicast_source: "tx" + unicast_source_v6: "" + vrf: "" + - access_group: "iACL" + access_group_v6: "FilterPackIPv6" + bandwidth: "100000" + description: "AVENIDA | 100M" + flow_monitor: "" + flow_monitor_v6: "" + flow_mpls: "" + flow_mpls_sampler: "" + flow_sampler: "" + flow_sampler_v6: "" + inner_vlan: "9" + input_policy: "IN_BAND_S_100000_V1" + interface: "TenGigE2/4/0/2.22229" + ip_addresses: + - "10.228.247.93" + ipv6_addresses: + - "fe80:a8:2:b8::10ed" + ipv6_prefix_lengths: + - "126" + load_interval: "30" + mac_address: "" + mtu: "" + mtu_ipv4: "" + netmasks: + - "255.255.255.252" + outer_vlan: "2222" + output_policy: "OUT_BAND_S_100000_V1" + unicast_source: "any" + unicast_source_v6: "" + vrf: "" + - access_group: "" + access_group_v6: "" + bandwidth: "1500" + description: "MONTE EVEREST | 1500K" + flow_monitor: "" + flow_monitor_v6: "" + flow_mpls: "" + flow_mpls_sampler: "" + flow_sampler: "" + flow_sampler_v6: "" + inner_vlan: "2" + input_policy: "" + interface: "TenGigE2/4/0/2.10012" + ip_addresses: + - "10.86.193.193" + ipv6_addresses: [] + ipv6_prefix_lengths: [] + load_interval: "30" + mac_address: "" + mtu: "" + mtu_ipv4: "" + netmasks: + - "255.255.255.252" + outer_vlan: "1001" + output_policy: "OUT_SIP_VOICE_1500" + unicast_source: "rx" + unicast_source_v6: "" + vrf: "FONE_CLIENT:5341" + - access_group: "" + access_group_v6: "" + bandwidth: "100000" + description: "TEST PASS| 100M" + flow_monitor: "" + flow_monitor_v6: "" + flow_mpls: "" + flow_mpls_sampler: "" + flow_sampler: "" + flow_sampler_v6: "" + inner_vlan: "" + input_policy: "IN_100000K_1_0_1_0_0_1_1" + interface: "TenGigE2/4/0/2.1002" + ip_addresses: + - "10.245.37.157" + ipv6_addresses: + - "fe80:a8:2:2b8::751" + ipv6_prefix_lengths: + - "126" + load_interval: "30" + mac_address: "" + mtu: "" + mtu_ipv4: "" + netmasks: + - "255.255.255.252" + outer_vlan: "1002" + output_policy: "OUT_100000K_1_0_1_0_0_1_1" + unicast_source: "" + unicast_source_v6: "" + vrf: "FEED_HUB:1245" + - access_group: "" + access_group_v6: "" + bandwidth: "2048" + description: "BLUE | 2048K" + flow_monitor: "" + flow_monitor_v6: "" + flow_mpls: "" + flow_mpls_sampler: "" + flow_sampler: "" + flow_sampler_v6: "" + inner_vlan: "3" + input_policy: "IN_BLUE_2M_0_0_0_98_0_1_XR_V1" + interface: "TenGigE2/4/0/2.10023" + ip_addresses: + - "192.168.226.53" + ipv6_addresses: + - "fe80:a8:2:2b8::ac5" + ipv6_prefix_lengths: + - "126" + load_interval: "30" + mac_address: "" + mtu: "" + mtu_ipv4: "" + netmasks: + - "255.255.255.252" + outer_vlan: "1002" + output_policy: "OUT_BLUE_2M_0_0_0_98_0_1_XR_V1" + unicast_source: "" + unicast_source_v6: "" + vrf: "OBS_CHIN:1236" + - access_group: "" + access_group_v6: "" + bandwidth: "" + description: "TEST MTU and FLOW" + flow_monitor: "IPV4-MONITOR" + flow_monitor_v6: "IPV6-MONITOR" + flow_mpls: "MPLS-MONITOR" + flow_mpls_sampler: "MPLS-SAMPLER" + flow_sampler: "IPV4-SAMPLER" + flow_sampler_v6: "IPV6-SAMPLER" + inner_vlan: "" + input_policy: "" + interface: "TenGigE3/0/0/0" + ip_addresses: [] + ipv6_addresses: [] + ipv6_prefix_lengths: [] + load_interval: "" + mac_address: "" + mtu: "9216" + mtu_ipv4: "9000" + netmasks: [] + outer_vlan: "" + output_policy: "" + unicast_source: "" + unicast_source_v6: "" + vrf: "" + - access_group: "iACL-OUT" + access_group_v6: "FilterPackIPv6-OUT" + bandwidth: "" + description: "TEST EGRESS ACL" + flow_monitor: "" + flow_monitor_v6: "" + flow_mpls: "" + flow_mpls_sampler: "" + flow_sampler: "" + flow_sampler_v6: "" + inner_vlan: "" + input_policy: "" + interface: "TenGigE3/0/0/1" + ip_addresses: [] + ipv6_addresses: [] + ipv6_prefix_lengths: [] + load_interval: "" + mac_address: "" + mtu: "" + mtu_ipv4: "" + netmasks: [] + outer_vlan: "" + output_policy: "" + unicast_source: "" + unicast_source_v6: "" + vrf: "" + - access_group: "" + access_group_v6: "" + bandwidth: "" + description: "TEST STRINGS" + flow_monitor: "" + flow_monitor_v6: "" + flow_mpls: "" + flow_mpls_sampler: "" + flow_sampler: "" + flow_sampler_v6: "" + inner_vlan: "" + input_policy: "" + interface: "Bundle-Ether10" + ip_addresses: + - "10.230.130.5" + ipv6_addresses: + - "2804:a8:2:b8::13a9" + - "fe80::1000:16:3" + - "fe80::1000:16:2" + - "fe80:388:129:16::3" + - "fe80:388:129:16::24" + - "fe80:0cB8:0:1::" + - "fe80:0D18:0:1::" + ipv6_prefix_lengths: + - "126" + - "126" + - "None" + - "64" + - "None" + - "19" + - "64" + load_interval: "" + mac_address: "" + mtu: "9180" + mtu_ipv4: "9180" + netmasks: + - "255.255.255.254" + outer_vlan: "31" + output_policy: "SubRate_200" + unicast_source: "" + unicast_source_v6: "" + vrf: "" + - access_group: "" + access_group_v6: "" + bandwidth: "" + description: "satellite100" + flow_monitor: "" + flow_monitor_v6: "" + flow_mpls: "" + flow_mpls_sampler: "" + flow_sampler: "" + flow_sampler_v6: "" + inner_vlan: "" + input_policy: "" + interface: "Bundle-Ether100" + ip_addresses: [] + ipv6_addresses: [] + ipv6_prefix_lengths: [] + load_interval: "30" + mac_address: "" + mtu: "" + mtu_ipv4: "" + netmasks: [] + outer_vlan: "" + output_policy: "" + unicast_source: "" + unicast_source_v6: "" + vrf: ""