Loading...
「ツール」は右上に移動しました。
利用したサーバー: wtserver1
27いいね 1,462 views回再生

TextFSM | Cisco | VRF Data

Let's suppose you want to extract parameters like RD,RT,VRF etc from Cisco router configuration.
One way is to use regular expression but this is not easy way.

Another option is to use TextFSM module for easy extract of parameters from parsed configuration
Install Following module

textfsm
pprint

#### Template for Reference [

Value Required VRF (\S+)
Value rd (\S+)
Value import_map (\S+)
Value export_map (\S+)
Value List RT_import (\S+)
Value List RT_export (\S+)

Start
^vrf definition ${VRF}
^ rd ${rd}
^ export map ${export_map}
^ import map ${import_map}
^ route-target export ${RT_export}
^ route-target import ${RT_import}
^! # Record (# is actually dash + Angled bracket)

コメント