To assign the name "sw-floor-2" to a switch, use the command hostname sw- floor-2
in global configuration mode
. Here's how to do it:
- Enter global configuration mode by typing
config
orconfigure terminal
. The command prompt will change to indicate that you are in global configuration mode
- Enter the command
hostname sw-floor-2
. This assigns the name "sw-floor-2" to the switch
- Exit global configuration mode by typing
exit
- To save the configuration, use the command
copy running-config startup-config
. This ensures that the switch retains the assigned name after a reboot