02-13-2014 04:30 PM
Hi,
Need some advice from some RME gurus here..
I have a lot of Cisco devices with inconsistant CLI line "transport input xxx"...
Some have "transport input telnet ssh" and some have "transport intput ssh". I want to check as long as they have the words "ssh", they are compliant. Can I now what regex should I use?
I tried "+transport input [#.*#] ssh" or "+transport input [#(\btelnet\b)?#] ssh" but all fail.
Any suggestion would be much appreciated..
Thanks...
02-13-2014 05:01 PM
Hi,
If you want to test or find the command with SSH only use the below syntax
-------------------------------------------------------------------------------------
+ transport input ssh
in GLOBAL mode
-------------------------------------------------------------------
If you want to check for both Telnet \ SSH then use the below command
+ transport input [#(telnet|ssh)#]
Thanks-
Afroz
[Do rate the useful post]
****Ratings Encourages Contributors ****
02-13-2014 08:49 PM
Hi Afroj,
Thanks for the suggestion...I tried and it match half of it....I have two different string to match:
"transport input telnet ssh"
"transport input ssh"
How do I match BOTH of the strings? I tried: +[transport input (telnet|ssh) (ssh)?#] but fail...
Also, just curious...How come this check is in GLOBAL mode? I thought "transport input xxx" is within "line vty 0 4" and "line vty 5 15"?
Thanks..
02-13-2014 08:51 PM
No ,you are right , it should be under
Submode : as suggested by Joe
[#line vty .*#]
also use this syntax :
+transport input [#(\btelnet\b)?#] ssh
Thanks-
Afroz
[Do rate the useful post]
****Ratings Encourages Contributors ****
02-13-2014 05:29 PM
You script may be correct. Just check you are using this against submode commands?
As the transport input command will be in submode of line vty *.
The Baseline Template also allows you to verify commands within a sub-configuration section by using a “SubMode Block”.
The Baseline Template must be configured in Advanced Mode to allow SubMode Blocks. Under submode use following :
Submode : [#line vty .*#]
Followed by your commands :
"+transport input [#.*#] ssh" or "+transport input [#(\btelnet\b)?#] ssh"
-Thanks
Joe
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