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

line vty 0 <max>

mike-brooks
Level 1
Level 1

I am putting together a small script (series of commands in a Notepad .txt file) to be run from cli on a variety of Cisco Catalyst switches and routers.  Because the number of vty lines varies on the different platforms, I would like to be able to specify

line vty 0 15

except instead of just putting the actual number 15, have the command put in the highest number of vty lines possible.  How can I do this without creating a different script for each different switch, router, vg, etc?

Thanks,

Mike

2 Replies 2

Richard Burts
Hall of Fame
Hall of Fame

Mike

If this is a set of commands that you will copy and paste from Notepad then it seems that your only alternative is to pick a number and put it into the command or create a set of the scripts with one for each platform type. If you want to get into an interactive scripting environment then you could specify a variable and check for platform and set the variable appropriately. But that is a much more complex thing to write.

HTH

Rick

HTH

Rick

Most equipment supports up to 5 vty so You can write it like this 

line vty 0 4

 < your commands>

line vty 5 15

< your commands>

this way, for equipment that doesn't support vty range up to 15, you got it to work with the 0 to 4 and then just an error.

/Mikael