| 1 |
Value Filldown VRF (\S+) |
| 2 |
Value Filldown PROTOCOL (\w) |
| 3 |
Value Filldown TYPE (\w{0,2}) |
| 4 |
Value Required,Filldown NETWORK (\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}) |
| 5 |
Value Filldown MASK (\d{1,2}) |
| 6 |
Value DISTANCE (\d+) |
| 7 |
Value METRIC (\d+) |
| 8 |
Value NEXTHOP_IP (\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}) |
| 9 |
Value NEXTHOP_VRF (\S+) |
| 10 |
Value NEXTHOP_IF ([A-Za-z][\w\-\.:/]+) |
| 11 |
Value UPTIME (\d[\w:\.]+) |
| 12 |
|
| 13 |
Start |
| 14 |
^Routing\sTable:\s${VRF}\s*$$ |
| 15 |
^Gateway.* -> Routes |
| 16 |
# Capture time-stamp if vty line has command time-stamping turned on |
| 17 |
^Load\s+for\s+ |
| 18 |
^Time\s+source\s+is |
| 19 |
|
| 20 |
Routes |
| 21 |
^\s*$$ |
| 22 |
# For "is (variably )subnetted" line, capture mask, clear all values. |
| 23 |
^\s+\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\/${MASK}\sis -> Clear |
| 24 |
# |
| 25 |
# Match directly connected route with explicit mask |
| 26 |
^${PROTOCOL}(\s|\*)${TYPE}\s+${NETWORK}\/${MASK}\sis\sdirectly\sconnected(,\s${UPTIME})?(,\s${NEXTHOP_IF})? -> Record |
| 27 |
# |
| 28 |
# Match directly connected route (mask is inherited from "is subnetted") |
| 29 |
^${PROTOCOL}(\s|\*)${TYPE}\s+${NETWORK}\sis\sdirectly\sconnected,\s${NEXTHOP_IF} -> Record |
| 30 |
# |
| 31 |
# Match regular routes, with mask, where all data in same line |
| 32 |
^${PROTOCOL}(\s|\*)${TYPE}\s+${NETWORK}\/${MASK}\s\[${DISTANCE}/${METRIC}\]\svia\s${NEXTHOP_IP}(\s\(${NEXTHOP_VRF}\))?(,\s${UPTIME})?(,\s${NEXTHOP_IF})? -> Record |
| 33 |
# |
| 34 |
# Match regular route, all one line, where mask is learned from "is subnetted" line |
| 35 |
^${PROTOCOL}(\s|\*)${TYPE}\s+${NETWORK}\s\[${DISTANCE}\/${METRIC}\]\svia\s${NEXTHOP_IP}(,\s${UPTIME})?(,\s${NEXTHOP_IF})? -> Record |
| 36 |
# |
| 37 |
# Match route with no via statement (Null via protocol) |
| 38 |
^${PROTOCOL}(\s|\*)${TYPE}\s+${NETWORK}\/${MASK}\s\[${DISTANCE}/${METRIC}\],\s${UPTIME},\s${NEXTHOP_IF} -> Record |
| 39 |
# |
| 40 |
# Match "is a summary" routes (often Null0) |
| 41 |
^${PROTOCOL}(\s|\*)${TYPE}\s+${NETWORK}\/${MASK}\sis\sa\ssummary,\s${UPTIME},\s${NEXTHOP_IF} -> Record |
| 42 |
# |
| 43 |
# Match regular routes where the network/mask is on the line above the rest of the route |
| 44 |
^${PROTOCOL}(\s|\*)${TYPE}\s+${NETWORK}\/${MASK} -> Next |
| 45 |
# |
| 46 |
# Match regular routes where the network only (mask from subnetted line) is on the line above the rest of the route |
| 47 |
^${PROTOCOL}(\s|\*)${TYPE}\s+${NETWORK} -> Next |
| 48 |
# |
| 49 |
# Match the rest of the route information on line below network (and possibly mask) |
| 50 |
^\s+\[${DISTANCE}\/${METRIC}\]\svia\s${NEXTHOP_IP}(,\s${UPTIME})?(,\s${NEXTHOP_IF})? -> Record |
| 51 |
# |
| 52 |
# Match load-balanced routes |
| 53 |
^\s+\[${DISTANCE}\/${METRIC}\]\svia\s${NEXTHOP_IP} -> Record |
| 54 |
# |
| 55 |
# Clear all variables on empty lines |
| 56 |
^\s* -> Clearall |
| 57 |
|
| 58 |
EOF |