cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
302
Views
5
Helpful
2
Replies

Newbie - Searching for all subnets and vlans

SkiffNetwork
Level 1
Level 1

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.

1 Accepted Solution

Accepted Solutions

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"

View solution in original post

2 Replies 2

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"

Thank you. I will try this out.
Review Cisco Networking products for a $25 gift card