Configure Hostnames and IP Addresses

  • Home
  • CCNA
  • Configure Hostnames and IP Addresses

In this post, we will learn how to configure hostnames and IP addresses through the command-line interface (CLI).

Configuring Switch Hostname

  • Switch>enable
  • Switch#config t
  • Enter configuration commands, one per line. End with CNTL/Z.
  • Switch(config)#Hostname Room-145
  • Room-145(config)# exit

Set Console and Line VTY Password

  • Switch>enable
  • Switch#config t
  • Room-145(config)#line console 0
  • Room-145(config-line)#password (your password)
  • Room-145(config-line)#login
  • Room-145(config-line)#exit
  • Room-145(config)#line vty 0 15
  • Room-145(config-line)#password (your password)
  • Room-145(config-line)#login
  • Room-145(config-line)# exit

Set Secret Password

  • Room-145>enable
  • Room-145#config t
  • Enter configuration commands, one per line. End with CNTL/Z.
  • Room-145(config)#enable secret (your password)
  • Room-145(config)#exit
  • Room-145#
  • %SYS-5-CONFIG_I: Configured from console by console
  • Room-145#exit

Encrypt Text Passwords

  • Room-145#enable
  • Room-145#config t
  • Enter configuration commands, one per line. End with CNTL/Z.
  • Room-145(config)#service password-encryption
  • Room-145(config)#exit
  • Room-145#
  • %SYS-5-CONFIG_I: Configured from console by console
  • exit

Set Banner Message MOTD

  • Room-145#enable
  • Room-145#config t
  • Enter configuration commands, one per line. End with CNTL/Z.
  • Room-145(config)#banner motd *your warning*
  • Room-145(config)# exit
  • Room-145#
  • %SYS-5-CONFIG_I: Configured from console by console

Configure Addressing (VLAN)

  • Switch>enable
  • Switch#config t
  • Enter configuration commands, one per line. End with CNTL/Z.
  • Room-145(config)#interface vlan 1
  • Room-145(config-if)#ip address 172.16.5.35 255.255.255.0
  • Room-145(config-if)#no shutdown
  • Room-145(config-if)#
  • %LINK-5-CHANGED: Interface Vlan1, changed state to up
  • %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up

Save your configurations

  • Room-145#wr
  • Building configuration…
  • [OK]
Tags:
Leave a Comment