The hostname is used to identify the switch on the network, and it is displayed in the command prompt. You can choose any hostname that is meaningful to you, as long as it meets the naming conventions for network devices, which usually require the hostname to start with a letter and consist of alphanumeric characters.
To configure the hostname on a Cisco switch, follow these steps:
- Connect to the switch via a console or Telnet connection and log in with your credentials.
- Enter configuration mode by typing
switch> configure terminal
Set the hostname with the following command:
switch(config)# hostname <new_hostname>
<new_hostname> with the desired hostname.
- To make the change persistent across reboots, save the configuration:
switch(config)# end switch# copy running-config startup-config
- Verify the new hostname with the
switch# show running-config | include hostname