diff --git a/ntc_templates/templates/hp_comware_display_ip_vpn-instance_instance-name.textfsm b/ntc_templates/templates/hp_comware_display_ip_vpn-instance_instance-name.textfsm new file mode 100644 index 0000000000..547bc7edde --- /dev/null +++ b/ntc_templates/templates/hp_comware_display_ip_vpn-instance_instance-name.textfsm @@ -0,0 +1,113 @@ +Value Required NAME ([^,]+) +Value Required ID (\d+) +Value RD (\d+:\d+) +Value List IPV4_EXPORT_RTS (\d+:\d+) +Value List IPV4_IMPORT_RTS (\d+:\d+) +Value List IPV6_EXPORT_RTS (\d+:\d+) +Value List IPV6_IMPORT_RTS (\d+:\d+) +Value DESCRIPTION (.*) +Value IPV4_EXPORT_POLICY (\S+) +Value IPV4_IMPORT_POLICY (\S+) +Value IPV4_TUNNEL_POLICY (\S+) +Value IPV6_EXPORT_POLICY (\S+) +Value IPV6_IMPORT_POLICY (\S+) +Value IPV6_TUNNEL_POLICY (\S+) +Value List INTERFACES ([^,]+) + + +Start + ^\s*VPN-Instance\s+Name\s+and\s+(Index|ID)\s*:\s+${NAME}, ${ID} + ^\s*Route\s+Distinguisher\s*:\s+${RD} + ^\s*Description\s*:\s*${DESCRIPTION} + # IPv4 targets (block) + ^\s*Address-family|s+IPv4 -> AFIPv4 + # Export IPv4 targets (inline) + ^\s*Export\s+VPN\s+Targets\s*:\s+${IPV4_EXPORT_RTS} -> Continue + ^\s*Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){1}\s+${IPV4_EXPORT_RTS},* -> Continue + ^\s*Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){2}\s+${IPV4_EXPORT_RTS},* -> Continue + ^\s*Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){3}\s+${IPV4_EXPORT_RTS},* -> Continue + ^\s*Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){4}\s+${IPV4_EXPORT_RTS},* -> Continue + ^\s*Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){5}\s+${IPV4_EXPORT_RTS},* -> Continue + ^\s*Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){6}\s+${IPV4_EXPORT_RTS},* -> Continue + ^\s*Export\s+VPN\s+Targets\s*: + # Import IPv4 targets + ^\s*Import\s+VPN\s+Targets\s*:\s+${IPV4_IMPORT_RTS} -> Continue + ^\s*Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){1}\s+${IPV4_IMPORT_RTS},* -> Continue + ^\s*Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){2}\s+${IPV4_IMPORT_RTS},* -> Continue + ^\s*Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){3}\s+${IPV4_IMPORT_RTS},* -> Continue + ^\s*Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){4}\s+${IPV4_IMPORT_RTS},* -> Continue + ^\s*Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){5}\s+${IPV4_IMPORT_RTS},* -> Continue + ^\s*Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){6}\s+${IPV4_IMPORT_RTS},* -> Continue + ^\s*Import\s+VPN\s+Targets\s*: + # IPv4 policies + ^\s*Import\s+Route\s+Policy\s*:\s+${IPV4_IMPORT_POLICY} + ^\s*Export\s+Route\s+Policy\s*:\s+${IPV4_EXPORT_POLICY} + ^\s*Tunnel\s+Policy\s*:\s+${IPV4_TUNNEL_POLICY} + # Export IPv6 targets + ^\s*IPv6\s+Export\s+VPN\s+Targets\s*:\s+${IPV6_EXPORT_RTS} -> Continue + ^\s*IPv6\s+Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){1}\s+${IPV6_EXPORT_RTS},* -> Continue + ^\s*IPv6\s+Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){2}\s+${IPV6_EXPORT_RTS},* -> Continue + ^\s*IPv6\s+Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){3}\s+${IPV6_EXPORT_RTS},* -> Continue + ^\s*IPv6\s+Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){4}\s+${IPV6_EXPORT_RTS},* -> Continue + ^\s*IPv6\s+Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){5}\s+${IPV6_EXPORT_RTS},* -> Continue + ^\s*IPv6\s+Export\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){6}\s+${IPV6_EXPORT_RTS},* -> Continue + ^\s*IPv6\s+Export\s+VPN\s+Targets\s*: + # Import IPv6 targets + ^\s*IPv6\s+Import\s+VPN\s+Targets\s*:\s+${IPV6_IMPORT_RTS} -> Continue + ^\s*IPv6\s+Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){1}\s+${IPV6_IMPORT_RTS},* -> Continue + ^\s*IPv6\s+Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){2}\s+${IPV6_IMPORT_RTS},* -> Continue + ^\s*IPv6\s+Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){3}\s+${IPV6_IMPORT_RTS},* -> Continue + ^\s*IPv6\s+Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){4}\s+${IPV6_IMPORT_RTS},* -> Continue + ^\s*IPv6\s+Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){5}\s+${IPV6_IMPORT_RTS},* -> Continue + ^\s*IPv6\s+Import\s+VPN\s+Targets\s*:(?:\s+\d+:\d+){6}\s+${IPV6_IMPORT_RTS},* -> Continue + ^\s*IPv6\s+Import\s+VPN\s+Targets\s*: + # IPv6 policies + ^\s*IPv6\s+Import\s+Route\s+Policy\s*:\s+${IPV6_IMPORT_POLICY} + ^\s*IPv6\s+Export\s+Route\s+Policy\s*:\s+${IPV6_EXPORT_POLICY} + ^\s*IPv6\s+Tunnel\s+Policy\s*:\s+${IPV6_TUNNEL_POLICY} + # Interfaces + ^\s*Interfaces\s*:\s+${INTERFACES},* -> Continue + ^\s*Interfaces\s*:(?:\s+[^,]+,){1}\s+${INTERFACES},* -> Continue + ^\s*Interfaces\s*:(?:\s+[^,]+,){2}\s+${INTERFACES},* -> Continue + ^\s*Interfaces\s*:(?:\s+[^,]+,){3}\s+${INTERFACES},* -> Continue + ^\s*Interfaces\s*:(?:\s+[^,]+,){4}\s+${INTERFACES},* -> Continue + ^\s{12,}${INTERFACES},* -> Continue + ^\s{12,}(?:\s+[^,]+,){1}\s+${INTERFACES},* -> Continue + ^\s{12,}(?:\s+[^,]+,){2}\s+${INTERFACES},* -> Continue + ^\s{12,}(?:\s+[^,]+,){3}\s+${INTERFACES},* -> Continue + ^\s{12,}(?:\s+[^,]+,){4}\s+${INTERFACES},* -> Continue + # End of Interfaces + ^\s*Interfaces\s*: + ^\s{12,} + # Drop + ^\s*Create\s+time + ^\s*Up\s+time + ^\s*.*Maximum\s+Routes\s+Limit + ^\s{4,} + ^. -> Error + +AFIPv4 + ^\s*Export\s+VPN\s+Targets -> ExportIPv4Targets + +ExportIPv4Targets + ^\s{4,}${IPV4_EXPORT_RTS} -> Continue + ^\s{4,}(?:\s+\d+:\d+){1}\s+${IPV4_EXPORT_RTS} -> Continue + ^\s{4,}(?:\s+\d+:\d+){2}\s+${IPV4_EXPORT_RTS} -> Continue + ^\s{4,}(?:\s+\d+:\d+){3}\s+${IPV4_EXPORT_RTS} -> Continue + ^\s{4,}(?:\s+\d+:\d+){4}\s+${IPV4_EXPORT_RTS} -> Continue + ^\s{4,}(?:\s+\d+:\d+){5}\s+${IPV4_EXPORT_RTS} -> Continue + ^\s{4,}(?:\s+\d+:\d+){6}\s+${IPV4_EXPORT_RTS} -> Continue + ^\s{4,}\d+:\d+ + ^\s*Import\s+VPN\s+Targets -> ImportIPv4Targets + ^. -> Error + +ImportIPv4Targets + ^\s{4,}${IPV4_IMPORT_RTS} -> Continue + ^\s{4,}(?:\s+\d+:\d+){1}\s+${IPV4_IMPORT_RTS} -> Continue + ^\s{4,}(?:\s+\d+:\d+){2}\s+${IPV4_IMPORT_RTS} -> Continue + ^\s{4,}(?:\s+\d+:\d+){3}\s+${IPV4_IMPORT_RTS} -> Continue + ^\s{4,}(?:\s+\d+:\d+){4}\s+${IPV4_IMPORT_RTS} -> Continue + ^\s{4,}(?:\s+\d+:\d+){5}\s+${IPV4_IMPORT_RTS} -> Continue + ^\s{4,}(?:\s+\d+:\d+){6}\s+${IPV4_IMPORT_RTS} -> Continue + ^\s{4,}\d+:\d+ + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index bdcb2ff0ba..40e1b63c8a 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -456,6 +456,7 @@ fortinet_get_system_status.textfsm, .*, fortinet, g[[et]] sy[[stem]] stat[[us]] fortinet_get_system_arp.textfsm, .*, fortinet, g[[et]] sy[[stem]] arp hp_comware_display_lldp_neighbor-information_verbose.textfsm, .*, hp_comware, di[[splay]] ll[[dp]] n[[eighbor-information]] v[[erbose]] +hp_comware_display_ip_vpn-instance_instance-name.textfsm, .*, hp_comware, di[[splay]] ip vpn[[-instance]] in[[instance-name]] hp_comware_display_counters_bound_interface.textfsm, .*, hp_comware, di[[splay]] cou[[nters]] (\S+) i[[nterface]] hp_comware_display_ip_routing-table.textfsm, .*, hp_comware, di[[splay]] ip r[[outing-table]] hp_comware_display_device_manuinfo.textfsm, .*, hp_comware, di[[splay]] dev[[ice]] m[[anuinfo]] diff --git a/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name.raw b/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name.raw new file mode 100644 index 0000000000..c9334c7e11 --- /dev/null +++ b/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name.raw @@ -0,0 +1,8 @@ + VPN-Instance Name and Index : vpna, 1 + Route Distinguisher : 100:1 + Interfaces : Vlan-interface10 + Address-family IPv4: + Export VPN Targets : + 111:1 + Import VPN Targets : + 111:1 222:2 diff --git a/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name.yml b/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name.yml new file mode 100644 index 0000000000..eb1e7f6158 --- /dev/null +++ b/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name.yml @@ -0,0 +1,21 @@ +--- +parsed_sample: + - name: "vpna" + id: "1" + rd: "100:1" + description: "" + ipv4_export_rts: + - "111:1" + ipv4_import_rts: + - "111:1" + - "222:2" + ipv4_export_policy: "" + ipv4_import_policy: "" + ipv4_tunnel_policy: "" + ipv6_export_rts: [] + ipv6_import_rts: [] + ipv6_export_policy: "" + ipv6_import_policy: "" + ipv6_tunnel_policy: "" + interfaces: + - "Vlan-interface10" diff --git a/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name1.raw b/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name1.raw new file mode 100644 index 0000000000..7fdbb3e3ad --- /dev/null +++ b/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name1.raw @@ -0,0 +1,18 @@ + VPN-Instance Name and ID : vpn1, 1 + Create time : 2022/12/21 0520:27:29 + Up time : 0 days, 00 hours, 07 minutes and 39 seconds + Route Distinguisher : 101:1 + Description : This is vpn1 + Export VPN Targets : 1:1 + Import VPN Targets : 1:2 + Import Route Policy : policy3 + Export Route Policy : policy2 + Tunnel Policy : policy1 + Maximum Routes Limit : 600 + IPv6 Export VPN Targets : 2:1 + IPv6 Import VPN Targets : 2:2 + IPv6 Import Route Policy : policy4 + IPv6 Export Route Policy : policy1 + IPv6 Tunnel Policy : policy1 + IPv6 Maximum Routes Limit : 600 + Interfaces : Ten-GigabitEthernet1/0/52 diff --git a/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name1.yml b/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name1.yml new file mode 100644 index 0000000000..2d48426898 --- /dev/null +++ b/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name1.yml @@ -0,0 +1,22 @@ +--- +parsed_sample: + - name: "vpn1" + id: "1" + rd: "101:1" + description: "This is vpn1" + ipv4_export_rts: + - "1:1" + ipv4_import_rts: + - "1:2" + ipv4_export_policy: "policy2" + ipv4_import_policy: "policy3" + ipv4_tunnel_policy: "policy1" + ipv6_export_rts: + - "2:1" + ipv6_import_rts: + - "2:2" + ipv6_export_policy: "policy1" + ipv6_import_policy: "policy4" + ipv6_tunnel_policy: "policy1" + interfaces: + - "Ten-GigabitEthernet1/0/52" diff --git a/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name2.raw b/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name2.raw new file mode 100644 index 0000000000..fd921b7fe3 --- /dev/null +++ b/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name2.raw @@ -0,0 +1,9 @@ + VPN-Instance Name and Index : vpnb, 2 + Route Distinguisher : 100:2 + Interfaces : Vlan-interface20, FortyGigE1/0/53, + GigabitEthernet1/0/25 + Address-family IPv4: + Export VPN Targets : + 222:2 + Import VPN Targets : + 222:2 111:1 diff --git a/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name2.yml b/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name2.yml new file mode 100644 index 0000000000..693743e12b --- /dev/null +++ b/tests/hp_comware/display_ip_vpn-instance_instance-name/hp_comware_display_ip_vpn-instance_instance-name2.yml @@ -0,0 +1,23 @@ +--- +parsed_sample: + - name: "vpnb" + id: "2" + rd: "100:2" + description: "" + ipv4_export_rts: + - "222:2" + ipv4_import_rts: + - "222:2" + - "111:1" + ipv4_export_policy: "" + ipv4_import_policy: "" + ipv4_tunnel_policy: "" + ipv6_export_rts: [] + ipv6_import_rts: [] + ipv6_export_policy: "" + ipv6_import_policy: "" + ipv6_tunnel_policy: "" + interfaces: + - "Vlan-interface20" + - "FortyGigE1/0/53" + - "GigabitEthernet1/0/25"