Skip to content

Commit

Permalink
Merge pull request #1214 from unyc-io/huawei-vrp-add-display-routing-…
Browse files Browse the repository at this point in the history
…table-template

Add Huawei VRP display routing-table template
  • Loading branch information
itdependsnetworks authored Dec 3, 2022
2 parents eb28bb4 + 04da598 commit 6f6ebfe
Show file tree
Hide file tree
Showing 6 changed files with 559 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Value DESTINATION (\S+)
Value PREFIX_LENGTH (\d+)
Value PROTOCOL (Direct|Static|EBGP|IBGP||ISIS|OSPF|RIP|UNR)
Value PROCESS_ID (\d+)
Value LABEL (\S+)
Value QOS_INFO (\S+)
Value NEIGHBOUR (\S+)
Value NEXT_HOP (\S+)
Value PREFERENCE (\d+)
Value STATE ((\s*(Active|Invalid|Inactive|NoAdv|Adv|Del|Relied|Stale))+)
Value COST (\d+)
Value AGE ([\d\w]+)
Value TAG (\d+)
Value PRIORITY (low|medium|high|critical)
Value INDIRECT_ID (\S+)
Value RELAY_NEXT_HOP (\S+)
Value INTERFACE (\S+)
Value TUNNEL_ID (\S+)
Value FLAGS ((D|R)*)
Value ENTRY_ID (\S+)
Value ENTRY_FLAGS (\S+)
Value REFERENCE_CNT (\d+)

Start
^\s*Route\sFlags:.*$$
^\s*-*\s*$$
^\s*Routing\sTable(s)?\s*:\sPublic\s*$$
^\s*Destinations\s*:\s+\d+\s+Routes\s*:\s+\d+\s*$$
^\s*Destination\s*:\s+.*$$ -> Continue.Record
^\s*Destination\s*:\s+${DESTINATION}(\s+PrefixLength\s*:\s+${PREFIX_LENGTH})?\s*$$
^\s*Protocol\s*:\s+${PROTOCOL}\s+Process\sID\s*:\s+${PROCESS_ID}\s*$$
^\s*Preference\s*:\s+${PREFERENCE}\s+Cost\s*:\s+${COST}\s*$$
^\s*NextHop\s*:\s+${NEXT_HOP}\s+Neighbour\s*:\s+${NEIGHBOUR}\s*$$
^\s*State\s*:\s+${STATE}\s+Age\s*:\s+${AGE}\s*$$
^\s*Tag\s*:\s+${TAG}\s+Priority\s*:\s+${PRIORITY}\s*$$
^\s*Label\s*:\s+${LABEL}\s+QoSInfo\s*:\s+${QOS_INFO}\s*$$
^\s*IndirectID\s*:\s+${INDIRECT_ID}\s*$$
^\s*RelayNextHop\s*:\s+${RELAY_NEXT_HOP}\s+Interface\s*:\s+${INTERFACE}\s*$$
^\s*TunnelID\s*:\s+${TUNNEL_ID}\s+Flags\s*:\s+${FLAGS}\s*$$
# IPv6 only regex
^\s*NextHop\s*:\s+${NEXT_HOP}\s+Preference\s*:\s+${PREFERENCE}\s*$$
^\s*Neighbour\s*:\s+${NEIGHBOUR}\s+ProcessID\s*:\s+${PROCESS_ID}\s*$$
^\s*Label\s*:\s+${LABEL}\s+Protocol\s*:\s+${PROTOCOL}\s*$$
^\s*State\s*:\s+${STATE}\s+Cost\s*:\s+${COST}\s*$$
^\s*Entry\sID\s*:\s+${ENTRY_ID}\s+EntryFlags\s*:\s+${ENTRY_FLAGS}\s*$$
^\s*Reference\sCnt\s*:\s+${REFERENCE_CNT}\s+Tag\s*:\s+${TAG}\s*$$
^\s*Priority\s*:\s+${PRIORITY}\s+Age\s*:\s+${AGE}\s*$$
^\s*RelayNextHop\s*:\s+${RELAY_NEXT_HOP}\s+TunnelID\s*:\s+${TUNNEL_ID}\s*$$
^\s*Interface\s*:\s+${INTERFACE}\s+Flags\s*:\s+${FLAGS}\s*$$
^\s*$$
^. -> Error
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ hp_procurve_show_arp.textfsm, .*, hp_procurve, sh[[ow]] ar[[p]]

huawei_vrp_display_traffic-filter_applied-record.textfsm, .*, huawei_vrp, dis[[play]] traffic-filter applied-record
huawei_vrp_display_snmp-agent_community_read.textfsm, .*, huawei_vrp, dis[[play]] snm[[p-agent]] c[[ommunity]] (r[[ead]]|w[[rite]])
huawei_vrp_display_ip_routing-table_verbose.textfsm, .*, huawei_vrp, dis[[play]] ip(v6)? routi[[ng-table]] ve[[rbose]]
huawei_vrp_display_interface_description.textfsm, .*, huawei_vrp, dis[[play]] inter[[face]] des[[cription]]
huawei_vrp_display_service-set_id_id.textfsm, .*, huawei_vrp, dis[[play]] service-set (id|name) \S+
huawei_vrp_display_interface_brief.textfsm, .*, huawei_vrp, dis[[play]] inter[[face]] br[[ief]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
Route Flags: R - relay, D - download to fib, T - to vpn-instance
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 14


Destination: 0.0.0.0/0
Protocol: Static Process ID: 0
Preference: 60 Cost: 0
NextHop: 192.214.198.156 Neighbour: 0.0.0.0
State: Active Adv Age: 1d01h58m07s
Tag: 0 Priority: medium
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: Dialer1
TunnelID: 0x0 Flags: D

Destination: 0.0.0.0/0
Protocol: EBGP Process ID: 0
Preference: 255 Cost: 0
NextHop: 23.90.232.243 Neighbour: 23.90.232.243
State: Inactive Adv Age: 1d01h57m50s
Tag: 0 Priority: low
Label: NULL QoSInfo: 0x0
IndirectID: 0x1
RelayNextHop: 0.0.0.0 Interface: Dialer1
TunnelID: 0x0 Flags:

Destination: 23.90.232.243/32
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 23.90.232.243 Neighbour: 0.0.0.0
State: Active Adv Age: 1d01h58m07s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: Dialer1
TunnelID: 0x0 Flags: D

Destination: 100.95.15.240/30
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 100.95.15.241 Neighbour: 0.0.0.0
State: Active Adv Age: 1d01h58m15s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: Vlanif100
TunnelID: 0x0 Flags: D

Destination: 100.95.15.241/32
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 127.0.0.1 Neighbour: 0.0.0.0
State: Active NoAdv Age: 1d01h58m15s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: Vlanif100
TunnelID: 0x0 Flags: D

Destination: 100.95.15.243/32
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 127.0.0.1 Neighbour: 0.0.0.0
State: Active NoAdv Age: 1d01h58m19s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: Vlanif100
TunnelID: 0x0 Flags: D

Destination: 127.0.0.0/8
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 127.0.0.1 Neighbour: 0.0.0.0
State: Active NoAdv Age: 1d01h59m26s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: InLoopBack0
TunnelID: 0x0 Flags: D

Destination: 127.0.0.1/32
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 127.0.0.1 Neighbour: 0.0.0.0
State: Active NoAdv Age: 1d01h59m26s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: InLoopBack0
TunnelID: 0x0 Flags: D

Destination: 127.255.255.255/32
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 127.0.0.1 Neighbour: 0.0.0.0
State: Active NoAdv Age: 1d01h59m26s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: InLoopBack0
TunnelID: 0x0 Flags: D

Destination: 192.168.1.0/24
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 192.168.1.1 Neighbour: 0.0.0.0
State: Active Adv Age: 1d01h58m54s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: Vlanif1
TunnelID: 0x0 Flags: D

Destination: 192.168.1.1/32
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 127.0.0.1 Neighbour: 0.0.0.0
State: Active NoAdv Age: 1d01h58m55s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: Vlanif1
TunnelID: 0x0 Flags: D

Destination: 192.168.1.255/32
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 127.0.0.1 Neighbour: 0.0.0.0
State: Active NoAdv Age: 1d01h58m55s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: Vlanif1
TunnelID: 0x0 Flags: D

Destination: 192.214.198.156/32
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 127.0.0.1 Neighbour: 0.0.0.0
State: Active Adv Age: 1d01h58m13s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: Dialer1
TunnelID: 0x0 Flags: D

Destination: 255.255.255.255/32
Protocol: Direct Process ID: 0
Preference: 0 Cost: 0
NextHop: 127.0.0.1 Neighbour: 0.0.0.0
State: Active NoAdv Age: 1d01h59m27s
Tag: 0 Priority: high
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: InLoopBack0
TunnelID: 0x0 Flags: D
Loading

0 comments on commit 6f6ebfe

Please sign in to comment.