cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4639
Views
5
Helpful
8
Replies

How to change CLI prompt name on Cisco C3560CX

JuergenW
Level 1
Level 1

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

8 Replies 8

Jaderson Pessoa
VIP Alumni
VIP Alumni
I think that you need change hostname.
Jaderson Pessoa
*** Rate All Helpful Responses ***

Reza Sharifi
Hall of Fame
Hall of Fame

Just create a hostname for each switch

switch-1 

config t

hostname 3560cx-hamburg

and so on...

HTH

Hello,
the host names of the switches cannot be changed for different reasons. But we still want to change the prompts to individual names. In old iOS versions there was a command "set prompt <....>". But this command does not work any more.
How can we achieve this?
Peter

.

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)#

The command does not work:

sw1(config)#prompt %h.Hamburg%p
                         ^
% Invalid input detected at '^' marker.

sw1(config)#

 

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

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.

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/fundamentals/configuration/15mt/fundamentals-15-mt-book/cf-connections.pdf

banner incoming &Youhaveentered$(hostname).$(domain)on line$(line)($(line-desc))&

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco