Cisco CCNA Exam: Configuring a Hostname

How to Configure a Hostname on Cisco Devices

Prev Question Next Question

Question

How do you configure a hostname?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

A

To configure a hostname on a Cisco router, you would use the command hostname followed by the desired hostname. In the given options, the correct command to configure the hostname is option A:

A. Router(config)#hostname R1

Here's a detailed explanation of the command and its usage:

  1. Access privileged EXEC mode: Before you can configure any changes on a Cisco router, you need to access privileged EXEC mode. If you are not already in privileged EXEC mode, you can enter it by typing enable at the router prompt and providing the appropriate password.

  2. Access global configuration mode: Once in privileged EXEC mode, you need to access global configuration mode to make configuration changes. You can enter global configuration mode by typing configure terminal or simply conf t at the router prompt.

  3. Configure the hostname: In global configuration mode, you can use the hostname command to configure the hostname of the router. The syntax for the command is hostname <hostname>, where <hostname> is the desired name for the router. In this case, the desired hostname is "R1".

    The command you would use is: Router(config)#hostname R1

    This command sets the hostname of the router to "R1". Replace "Router" with the actual hostname or prompt of your router.

  4. Exit global configuration mode: Once you have configured the hostname, you can exit global configuration mode by typing exit at the router prompt. This will take you back to privileged EXEC mode.

  5. Save the configuration: To ensure that the hostname configuration is saved and persists across router reboots, you need to save the configuration to non-volatile memory (NVRAM). You can do this by typing write memory or copy running-config startup-config at the router prompt.

    Note: It's always a good practice to save the configuration after making changes to avoid losing them in case of a power failure or reboot.

By following these steps and using the correct command, you can successfully configure the hostname of a Cisco router.