02-18-2018 11:07 AM - edited 03-05-2019 09:56 AM
How would you pull the info from the configs
#show running-config router ospf | utility egrep 0/3/0/0
interface TenGigE0/3/0/0
#show running-config router ospf | in 0/3/0/0
interface TenGigE0/3/0/0
This command only brings me the interface (which I do not need), but what I want need is the whole section and sub-section of ospf configuration related to that interface, like what process number and area this interface is in?
How can I pull that up? Any linux gurus to help out? :)
Thanks
Sal
Solved! Go to Solution.
02-20-2018 07:07 AM
hello,
you have two main options to achieve this.
First with egrep -A you can append n lines to the egrep matched string output.
If you know that ASR configuration is hierarchical you can search for a match of a particular indented head block and look n lines after it.
For example the area field:
show run router ospf XY | utility egrep area -A 10
will return everything inside the area config block (interfaces included) of ospf process XY and this is good option because it will iterate to look inside each block matched by egrep utility for 10 lines more. So if you have, let`s say, more than one area in your process this command will work just fine.
Or you could use the "show run formal" construct to search for the specific interface configuration.
This will highlight only the specific portion of configuration interested by the included match.
02-20-2018 07:07 AM
hello,
you have two main options to achieve this.
First with egrep -A you can append n lines to the egrep matched string output.
If you know that ASR configuration is hierarchical you can search for a match of a particular indented head block and look n lines after it.
For example the area field:
show run router ospf XY | utility egrep area -A 10
will return everything inside the area config block (interfaces included) of ospf process XY and this is good option because it will iterate to look inside each block matched by egrep utility for 10 lines more. So if you have, let`s say, more than one area in your process this command will work just fine.
Or you could use the "show run formal" construct to search for the specific interface configuration.
This will highlight only the specific portion of configuration interested by the included match.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide