Cisco Router Configuration: Password, IPv4, IPv6, VLAN & SSH
Posted on Apr 6, 2025 in ICT Systems Engineering
Cisco Router Configuration
Remove Router Password
- Power off the router physically.
- Hold CTRL + Pause keys.
Rommon1>confreg 0x2142
Rommon2>reset
Router>enable
Router#copy startup-config running-config
Change Passwords
(config)#config-register 0x2102
(config)#exit
Router#copy running-config startup-config
Router#reload
Set Router Password
(config)#enable secret (password)
(config)#line console 0
(config-line)#password (password)
(config-line)#login
(config-line)#exit
(config)#line vty 0 4
(config-line)#password (password)
(config-line)#login
(config.line)#exit
(config)#service password-encryption
Save Configuration to TFTP Server
Router#copy startup-config tftp
router#copy startup-config tftp:(IP)(Mask)
Configure IPv4
router>enable
router#configure terminal
(config)#hostname (name)
(config)#interface f0/0
(config-if)#ip address (IP) (Mask)
(config-if)#description (According to the topology)
(config-if)#no shutdown
(config-if)#exit
(config)#interface serial 0/0/0
(config-if)#ip address (IP) (Mask)
(config-if)#description (According to the topology)
(config-if)#no shutdown
(config-if)#exit
Static IPv4 Routing
Router>enable
Router#configure terminal
(config)#ip route (IP) (Mask) (exit interface)
Configure IPv6
Router>enable
Router#configure terminal
(config)#interface f0/0
(config)#ipv6 address (IP) link-local
(config-if)#ipv6 address (IP)(Prefix)
(config-if)#description (According to the topology)
(config-if)#no shutdown
(config-if)#exit
(config)#interface serial 0/0/0
(config-if)#ipv6 address (IP)(Prefix)
(config-if)#description (According to the topology)
(Config-if)#no shutdown
(config-if)# exit
IPv6 Routing
Router>enable
Router#configure terminal
(config)#IPv6 route ::/0 (IP)
Configure VLAN on Switch
switch>enable
switch#configure terminal
(config)#hostname (Name)
(Config)#interface vlan 1
(config-if)#ip address (IP)(Mask)
(config-if)#no shutdown
(config-if)#exit
SSH Configuration
(config)#ip domain-name (name)
(config)#crypto key generate rsa
(config)#line vty 0 4
(config-line)#transport input ssh
(config-line)#login local
(config-line)#exit
(config)#username (User) secret (Password)
Banner MOTD
(config)#banner motd #" "#
Subnet Masks
- 255.255.255.255 /32
- 255.255.255.254 /31
- 255.255.255.252 /30
- 255.255.255.248 /29
- 255.255.255.240 /28
- 255.255.255.224 /27
- 255.255.255.192 /26
- 255.255.255.128 /25
- 255.255.255.0 /24
- 255.255.254.0 /23
- 255.255.252.0 /22
- 255.255.248.0 /21
- 255.255.240.0 /20
- 255.255.224.0 /19
- 255.255.192.0 /18
- 255.255.128.0 /17
- 255.255.0.0 /16
- 255.254.0.0 /15
- 255.252.0.0 /14
- 255.248.0.0 /13
- 255.240.0.0 /12
- 255.224.0.0 /11
- 255.192.0.0 /10