Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Community Member

Using variables in Cisco IOS

I have many sites that I would like to be able to program uniformly using simple copy paste function, but each site uses in a diffrent ip scope making it challing without the use of variables.  For example, If I had two layer 3 switches each in a differnt site, one with in a 10.100.100.0/24 network and 10.100.110.0/24 network, then the other had 10.200.100.0/24 and 10.200.110.0/24 and I wanted to set an access list for the 10.x.110.x vlans, no biggie...but then if I wanted each network to be able to get from 10.x.100.5 in each of thier prespective sites from the 10.x.110.0/24 network, but not the other sites..I would have to write the line idividually for each layer 3 switch.

Is there a way to set and use a varial in cisco IOS.  In the example above, I could set "$A" as the local subnet ( in this case Site "A" would be 100, and site "B" would be 200"), then when creating the access list it would look something like this : permit ip 10.$A.110.0 0.0.0.255 host 10.$A.110.5. 

I relalize I can put a line above the perspective line that blocks traffic to other sites, then put one in to allow traffic to any ip that ends in 110.5, but that will not work for all circumstances.

Everyone's tags (3)
428
Views
0
Helpful
0
Replies
CreatePlease to create content