02-08-2019 11:31 AM - edited 03-08-2019 05:17 PM
Hello,
we have several Cisco 3560CX switches in our company which all have the same host name (3560cx) but different domain names. F. Ex. 3560cx.berlin.company.com and 3560cx.hamburg.company.com. The iOS CLI on all switches shows "3560cx#".
How can we create individual CLI prompts like "3560cx-hamburg#" and "3560cx-berlin#" so that we always see on which switch we execute the command when we have several SSH sessions open?
Thanks!
Peter
02-08-2019 11:35 AM
02-08-2019 11:35 AM
Just create a hostname for each switch
switch-1
config t
hostname 3560cx-hamburg
and so on...
HTH
02-08-2019 11:52 AM
02-08-2019 11:52 AM - edited 02-08-2019 11:53 AM
.
02-08-2019 03:25 PM
You should be able to just use the 'prompt' command in config mode. A limitation is that it doesn't show the modified prompt at config mode.
You could use something like this: 3560cx(config)#prompt %h.Hamburg%p
This will take the existing hostname, append it with .Hamburg then add the prompt character based on your current level, > or #. So when you exit out of config mode, it should show:
3560cx.Hamburg#
But if you go back to config mode, it will switch away from the custom prompt:
3560cx(config)#
02-09-2019 03:12 AM
The command does not work:
sw1(config)#prompt %h.Hamburg%p
^
% Invalid input detected at '^' marker.
sw1(config)#
02-09-2019 03:22 AM
Don't think the 3560 supports that.
Just change the hostnames. Yes I know you say you can't but it is bound to happen ie. someone reloads the wrong switch etc. and then you will wish you had.
Jon
02-09-2019 04:54 AM
hi,
i agree with everyone. there's a possibility of a human error due to same hostname on your switching environment.
easy fix is to change the device hostname and have management back you up on this move.
if for some reason management doesn't agree in changing this policy (i don't see why they wouldn't), you could alternatively configure a banner token to display its domain name.
banner incoming &Youhaveentered$(hostname).$(domain)on line$(line)($(line-desc))&
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