Cisco IOS commands

各種Cisco設定。

Miscellaneous

Hostname

1
(config)# hostname 'hostname'

Motd

1
(config)# banner motd 'motd'

Passwords

1
2
3
4
5
6
7
8
Line password.
(config)# line 'console'
(config-line)# password 'password'
(config-line)# login
Nomral EXEC password.
(config)# enable password 'password'
Secret EXEC password.
(config)# enable secret 'secret'

Username

1
2
3
4
5
6
(config)# username *name* {nopassword | password *password* | password *encryption-type* *encrypted-password*}
Ex:
(config)# username *name* password *password* <-- Password will not encrypt.

(config)# username *name* [access-class *number*]
(config)# username *name* [privilege *level*]

Reference

Blockfor

1
(config-if)# login block-for 'seconds' attempts 'minutes' within 'seconds' 

Inactivity timeout

1
2
(config)# line vty *line_number* [*ending_line_number*]
(config-line)# exec-timeout 'minutes' 'seconds'

Default Gateway

(config)# ip default-gateway ‘gateway’

SSH login

Set username

Reference on [top](./#Set username).

Set domain and encrypt key

(config)# ip domain-name domain name
(config)# crypto key generate rsa <– Make a RSA key.
How many bit in the modulus[512]: 1024 <– Use 1024 bit to encrypt(default 512)

Enable SSH

(config)# ip ssh version [1 | 2]
(config)# ip ssh {timeout seconds | authentication-retries number}
(config)# line vty line_number [ending_line_number]
(config-line)# login ssh
(config-line)# transport input ssh <– Enable ssh