hostname
Modifies the display name of the device in the CLI prompt. This is the foundational step for device administration, logging identification, and generating RSA crypto keys for SSH.
Quick Reference
Router(config)#Router or Switchno hostnameSyntax & Parameters
| Parameter | Description & Constraints |
|---|---|
| [name] | The desired name of the device.
|
CLI Deployment Scenarios
Scenario 1: Standard Deployment
You are configuring a brand new switch out of the box and need to name it for the Portland datacenter core.
Scenario 2: Removing the Hostname
You are decommissioning a router and want to return it to the default generic prompt.
CCNA Exam Gotchas
Prerequisite for SSH
You cannot generate RSA crypto keys (required for SSH remote access) if the router is still using the default generic Router hostname. Cisco IOS will throw an error. You must assign a unique hostname and an ip domain-name first.
Invalid Characters
If a simulator question asks you to set the hostname to "Core Switch 1", you must use hyphens or underscores (e.g., Core_Switch_1). Using a space will result in an "Invalid input detected" error.