Cisco Router CCNA Commands list you must know before you take CCNA exam, the list cover basic configuration, IPv4 and IPv6, Routing protocols like RIP and OSPF, DHCP and NAT.
Configure Basic Router Settings
Router# configure terminal Router# hostname R1 R1(config)# enable secret class R1(config)# line console 0 R1(config-line)# password cisco R1(config-line)# login R1(config-line)# logging synchronous R1(config-line)# no exec-timeout R1(config-line)# exit R1(config)# line vty 0 4 R1(config-line)# password cisco R1(config-line)# login R1(config-line)# exit R1(config)# service password-encryption R1(config)# banner motd $ Authorized Access Only $ R1# copy running-config startup-config
Configure an IPv4 Router Interface
R1(config)# interface gigabitethernet 0/0 R1(config-if)# description Link to LAN 1 R1(config-if)# ip address 192.168.10.1 255.255.255.0 R1(config-if)# no shutdown R1(config-if)# exit //configure interface s0/0/0 R1(config)# interface S 0/0/0 R1(config-if)# description Link to R2 R1(config-if)# ip address 209.165.200.225 255.255.255.252 R1(config-if)# clockrate 128000 R1(config-if)# no shutdown R1(config-if)# exit //configure interface loopback 0 R1(config)# interface loopback 0 R1(config-if)# ip address 10.0.0.1 255.255.255.0 R1(config-if)# exit
Verify Interface Settings
//IPv4 R1# show ip route R1# show ip route connected R1# show interfaces R1# show ip interface R1# show ip interface brief R1# show running-config interface g 0/0 //IPv6 R1# show ipv6 route R1# show ipv6 routers R1# show ipv6 interface brief R1# show ipv6 interface gigabitethernet 0/0 R1# show running-config | section line vty R1# show ip interface brief | include up R1# show ip interface brief | exclude unassigned R1# show ip interface brief | begin Gateway R1# terminal length 20 R1# terminal history size 200 R1# show history R1(config-if)# do show ip route | begin Gateway
Static Route
//IPv4 R1(config)# ip route 192.168.1.0 255.255.255.0 S0/0/0 R1(config)# ip route 192.168.1.0 255.255.255.0 192.168.1.2 R3(config)# ip route 172.31.0.0 255.255.255.0 s0/0/1 172.31.1.197 //floating static route R4(config)# ip route 0.0.0.0 0.0.0.0 s0/0/1 5 //IPv6 R1(config)# ipv6 unicast-routing R1(config)# ipv6 route 2001:DB8:1:1::/64 Serial0/0/0 R1(config)# ipv6 route 2001:DB8:1:2::/64 2001:DB8:1:A001::2 R1(config)# ipv6 route ::/0 s0/0/0 R1(config)# ipv6 route ::/0 2001:DB8:ABAD:4::2 //Troubleshoot Static Route R1# show ip route R1# show ip route static R1# show ip route 172.31.0.0 R1# show ip route connected R1# show ipv6 route R1# show ipv6 route static R1# show ipv6 route 2001:DB8:ACAD:3:: R1# ping ipv6 2001:DB8:ACAD:3::1 R1# show running-config | section ipv6 route R1# show ipv6 interface brief
-INTER-vLAN ROUTING
Configure S1(config)# interface g0/0.10 S1(config-if)# ip address 172.17.10.1 S1(config-if)# encapsulation dot1q 10 S1(config)# interface g0/0.30 S1(config-if)# ip address 172.17.30.1 S1(config-if)# encapsulation dot1q 30 S1(config)# interface g0/0 S1(config-if)# no shutdown
-Dynamic Routing Protocols
-RIP Routing Information Protocol
Router(config)# Router RIP Router(config-router)# version 2 Router(config-router)# network 192.168.1.0 Router(config-router)# network 192.168.2.0 Router(config-router)# passive-interface G0/0 Router(config-router)# passive-interface default //disable Router(config)# no Router RIP Router(config-router)# no version Router(config-router)# no network 192.168.1.0 Router(config-router)# no passive-interface G0/0 //IPv6 Router(config)# ipv6 unicast-routing Router(config)# interface G0/0 Router(config-if)# ipv6 rip RIP-AS enable //Default Route Router(config-router)# ip route 0.0.0.0 0.0.0.0 exit-intf next-hop-ip Router(config-router)# default-information originate Router(config-router)# ipv6 route 0::/0 2001:DB8:FEED:1::1 Router(config-router)# ipv6 rip RIP-AS default-information originate //Troubleshooting RIP Router# show ip protocols | begin Default Router# show ip protocols RIP Router# show ipv6 route Router# show ipv6 protocols
-OSPF Open Short Path First
Router(config)# Router OSPF 123 Router(config-router)# router-id 10.10.10.10 Router# clear ip ospf process Router(config-router)# network 172.16. 10.0 0.0.0.255 area 0 Router(config-router)# passive-interface default Router(config-router)# passive-interface s0/0/0 Router(config-router)# no passive-interface s0/0/0 Router(config-router)# Router(config-router)# //Adjusting the Reference Bandwidth Router# auto-cost reference-bandwidth 10000 //Adjusting the Interface Bandwidth Router(config-if)# bandwidth 64 //manually configure OSPF cost Router(config-if)# no bandwidth 64 Router(config-if)# ip ospf cost 15625 //Configuring a Loopback Interface Router# interface loopback 0 Router(config-if)# ip address 1.1.1.1 255.255.255.255 //Troubleshooting OSPF v2 Router# show ip ospf neighbor Router# show ip ospf database Router# show ip ospf interface Router# show ip ospf interface brief Router# show ip ospf interface serial 0/0/0 Router# show ip ospf interface serial 0/0/0 | include cost Router# debug ip ospf packet Router# show ip protocols Router# show ip protocols | section Router ID Router# show ip route Router# show ip route 172.16.1.0 Router# show ip route | include 172.16.1.0 Router# show interface s0/0/0 | include BW //IPv6 Router(config)# ipv6 unicast-routing Router(config)# ipv6 router ospf 1 Router(config-router)# router-id 1.1.1.1 Router(config)# interface GigabitEthernet 0/0 Router(config-if)#ipv6 address 2001:db8:0:3::1/64 Router(config-if)# ipv6 ospf 1 area 0 Router(config)# clear ipv6 ospf process //Troubleshooting OSPF v3 Router# show ipv6 ospf neighbor Router# show ipv6 ospf database Router# show ipv6 10 Router# show ipv6 route //Default Route
ACL
//Configure Router# interface Serial0/0/0 Router(config-if)# ip address 10.10.1.1 255.255.255.252 Router(config-if)# ip access-group 101 out Router(config)# access-list 101 deny icmp any any echo Router(config)# access-list 101 permit ip any any R1(config)# no access-list 101 //Troubleshooting Router# show access-lists Router# debug ip packet 101
DHCP
//Configure Router(config)# ip dhcp pool LAN_DHCP_1 Router(dhcp-config)# network 10.10.10.1 255.255.255.0 Router(dhcp-config)# default-router 10.10.10.254 Router(dhcp-config)# dns-server 10.10.10.10 Router(dhcp-config)# netbios-name-server 10.10.10.111 Router(dhcp-config)# domain-name mattatech.com Router(dhcp-config)# lease 14 12 23 Router(dhcp-config)# lease infinite //Exclude IP Address range Router(config)# ip dhcp excluded-address 10.10.10.10 Router(config)# ip dhcp excluded-address 10.10.10.10 10.10.10.20 //Enable/disable DHCP server and Relay agent Router(config)# service dhcp Router(config)# no service dhcp //DHCP Relay Router(config)# interface G0/0 Router(config-if)# ip helper-address 192.168.1.1 //Configure dhcp client Router(config)# interface G0/0 Router(config-if)# ip address dhcp //Troubleshooting Router# show ip dhcp binding Router# show ip dhcp binding 10.10.10.20 Router# show ip dhcp server statistics Router# show ip dhcp conflict Router# show ip dhcp database Router# show running-config | section dhcp Router# debug ip dhcp server events