10-21-2017 03:56 AM - edited 03-05-2019 09:20 AM
We have several Cisco Routers/Switches in our environment. I am trying to get a list of subnets supported by each of these devices. These are a mix of WAN routers, LAN Routers and Layer 3 Switches. I do not have any login privileges onto these devices. The management gave me the config files and asked me to figure out and extract all the subnets and vlans on each of these devices.
What are the keywords that I should grep/search in a config file that would give me the subnet and vlan addresses information? I can derive the CIDR address from the subnet mask. What are the list of keywords that I should use to do the search?
Thank you in advance.
Solved! Go to Solution.
10-21-2017 10:26 AM
Hello,
the simplest way would be to use a regular expression (you need a word processor that supports regular expressions, such as Microsoft Word or OpenOffice Writer:
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
The grep equivalent would be:
grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b"
10-21-2017 10:26 AM
Hello,
the simplest way would be to use a regular expression (you need a word processor that supports regular expressions, such as Microsoft Word or OpenOffice Writer:
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
The grep equivalent would be:
grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b"
10-22-2017 06:40 PM
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