One of the first configuration tasks is to assign the router a unique name. To do this, you must, in global configuration mode, use the following commands:
Router(config)#hostname network
network(config)# Passwords limit access to routers. They should always be configured for virtual terminal lines and the line console. Passwords are also used to control access to privileged mode so that only authorized users can make changes to the configuration file.
The following commands are used to set a password optional but recommended on the console line
The following commands are used to set a password optional but recommended on the console line
Router(config)#line console 0
Router(config-line)#password
Router(config-line)#login
Router(config-line)#password
Router(config-line)#login
To allow users to remotely access the router using Telnet, a password must be set to one or more virtual terminal lines (VTY). In general, Cisco routers support five VTY lines numbered from 0 to 4, although each hardware platform supports different numbers of VTY connections. The same password is often used for all lines, but sometimes one line is set to provide an input to the router backup if the other four connections are used. The following commands are used to set the password on the VTY lines:
Router (config) # line vty 0 4
Router (config-line) # password
Router (config-line) # login
The enable password and enable secret password is used to restrict access to privileged mode. Only the enable password is used if the enable secret password has not been defined. It is recommended to define and use only the enable secret password because, unlike the enable password, is encrypted. The following will set the enable passwords:
Router (config) # enable password
Router (config) # enable secret
Sometimes it is preferable that the passwords are not displayed in clear text in the output of show running-config or show startup-config. This command allows you to encrypt passwords in the output configuration:
Router (config) # service password-encryption
The service password-encryption command applies a simple encryption to all unencrypted passwords. Enable secret command uses a strong MD5 algorithm for encryption.
Router (config) # line vty 0 4
Router (config-line) # password
Router (config-line) # login
The enable password and enable secret password is used to restrict access to privileged mode. Only the enable password is used if the enable secret password has not been defined. It is recommended to define and use only the enable secret password because, unlike the enable password, is encrypted. The following will set the enable passwords:
Router (config) # enable password
Router (config) # enable secret
Sometimes it is preferable that the passwords are not displayed in clear text in the output of show running-config or show startup-config. This command allows you to encrypt passwords in the output configuration:
Router (config) # service password-encryption
The service password-encryption command applies a simple encryption to all unencrypted passwords.