CCNA R & S Quick Reference
CCNA R & S Quick Reference
BASIC CONFIGURATIONS
1. Privileged EXEC mode
x>enable
2. Configuration mode
x#configure terminal
3. Clock
x#clock set <hh:mm:ss> <dd month yyyy>
4. Host Name
x(config)#hostname <host name>
5. Login Banner
x(config)#banner login <$banner$> or x(config)#banner motd <$banner$>
6. Interface
x(config)#interface <interface_typeA/B>
7. Range of Interfaces
x(config)#interface range <interface_typeA/B-C>
8. IP Address to Interface
x(config)#interface <interface>
x(config-if)#ip address <ip address><subnet mask>
x(config-if)#no shutdown
9. IP Address to Switch
x(config)#interface vlan 1
x(config-if)#ip address <ip address> <subnet mask>
x(config-if)#no shutdown
1
CCNA 2.0 ( 200 - 120 ) ROUTING AND SWITCHING CISCO COMMANDS
SECURITY CONFIGURATIONS
1. Console Password
x(config)#line console 0
x(config-line)#login
x(config-line)#password <password>
3. Enable Password
x(config)#enable password <password>
7. Port Security
x(config)#interface <interface>
x(config-if)#switchport mode access
x(config-if)#switchport port-security
x(config-if)#switchport port-security maximum <no.>
x(config-if)#switchport port-security mac-address sticky /*Sticky method*/ or
x(config-if)#switchport port-security mac-address <mac address> /*Manual method*/
x(config-if)#switchport port-security violation shutdown
2
CCNA 2.0 ( 200 - 120 ) ROUTING AND SWITCHING CISCO COMMANDS
NETWORK CONFIGURATIONS
1. DHCP (Dynamic Host Configuration Protocol)
x(config)#interface <interface> /*in router, for interfaces which are act as gateway for network*/
x(config-if)#ip address <ip address> <subnet mask>
x(config-if)#no shutdown
x(config)#ip dhcp pool <name> /*give different pool name for different networks*/
x(dhcp-config)#network <network id> <subnet mask>
x(dhcp-config)#default-router <default gateway>
x(dhcp-config)#ip dhcpexcluded-address <from ip> <to ip> /*to reserve/exclude some ip address*/
ROUTING CONFIGURATIONS
1. Default Routing
/*assign ip address to router interfaces and to other network devices*/
x(config)#ip route 0.0.0.0 0.0.0.0 <next hop ip address> or /* in router*/
x(config)#ip route 0.0.0.0 0.0.0.0 <interface name> /*router’s local interface*/
x#show ip route /*to view ip route*/
/* ping, to check the connectivity*/
2. Static Routing
/*assign ip address to all network devices*/
/*draw routing table,
Destination n/w id (indirectly connected n/w’s ) Subnet Mask of it Next Hop ip (Default gateway)
x(config)#ip route <destination network id> <subnet mask> <next hop> /* in router*/
x#show ip route /*to view ip route*/
/* ping, to check the connectivity*/
3
CCNA 2.0 ( 200 - 120 ) ROUTING AND SWITCHING CISCO COMMANDS
SWITCHING CONFIGURATIONS
1. Create VLAN
x(config)#vlan <No.>
x(config-vlan)#name <vlan name>
4. InterVLAN Trunking
/*Subinterface or Routing with trunk link method*/
x(config)#interface <interfaceA/B.C> /* in router, for VLAN C*/
x(config-subif)#encapsulation dot1q C native /*only for native VLAN*/ or
x(config-subif)#encapsulation dot1q C
x(config-subif)#ip address <ip address> <subnet mask> /*same ip should be set as gateway for all pc’s
4
CCNA 2.0 ( 200 - 120 ) ROUTING AND SWITCHING CISCO COMMANDS
5. View Trunk
x#show interface trunk
ACL CONFIGURATIONS
1. Standard ACL (Access Control List)
/* should be configured in the destination router*/
x(config)#access-list <access-list no.> <permit/deny><source pc ip> /*access-list no.1-99, 1300-
x(config)# access-list <access-list no.> <deny/ permit> any /*same access list no.*/ 1999*/
x(config)#interface <interface>
x(config-if)#ip access-group <access-list no.> <in/out>
/*Ping from source pc to check*/
SPANNING-TREE
1. View Spanning-Tree of VLAN
x#spanning-tree vlan <no.>
/* Root Bridge-Switch with least MAC address *Non-Root Bridge-Switch with highest MAC address
*Root Port-Port of neighbour switches, which are connected with Root Bridge
*Blocked Port- Port of a switch with highest MAC address, which is not connected with Root Bridge
*Designated Ports-Ports rather than blocked port and root ports */
5
CCNA 2.0 ( 200 - 120 ) ROUTING AND SWITCHING CISCO COMMANDS
IPV4 ADDRESSING
Classification of IP V4 Address
1st Octet
Class 1st Octet Binary Value Default Subnet Mask No. Of Possible Hosts
Decimal Val.
Class A 1 – 126 00000001 – 01111110* 255.0.0.0 16,777,214
Class B 128 - 191 10000001 – 10111111 255.255.0.0 65,534
Class C 192 – 223 11000001 – 11011111 255.255.255.0 254
*127(01111111) – Class A address reserved for loopback testing 0.0.0.0 –indicates network by default
6
CCNA 2.0 ( 200 - 120 ) ROUTING AND SWITCHING CISCO COMMANDS
CIDR (Classless Inter-Domain Router) - x . x . x . x / CIDR Value, which represents no. of network bits
Subnet Mask
Subnet Mask
No. of 1st Bit 2nd Bit 3rd Bit 4th Bit 5th Bit 6th Bit 7th Bit 8th Bit Subnet
Network 27 26 25 24 23 22 21 20 Mask
Bits in 128 64 32 16 8 4 2 1 Value
an Octet
8 1 1 1 1 1 1 1 1 255
7 1 1 1 1 1 1 1 0 254
6 1 1 1 1 1 1 0 0 252
5 1 1 1 1 1 0 0 0 248
4 1 1 1 1 0 0 0 0 240
3 1 1 1 0 0 0 0 0 224
2 1 1 0 0 0 0 0 0 192
1 1 0 0 0 0 0 0 0 128
0 0 0 0 0 0 0 0 0 0
Wildcard Mask
Wildcard Mask = 255 – Subnet Mask ( Wildcard Mask - One’s complement of Subnet Mask )
IPV6 ADDRESSING
1.16 Bits x 8 = 168 Bits Hexadecimal Address
2. Eg., 2031 : 0000 : 130F : 0000 : 0000 : 09C0 : 8764 : 130B = 2031 : 0 : 130F : : 9C0 : 8764 : 130B
:0: :: : 9C0 :
3. Types – Unicast, Multicast & Anycast
4. Global Address starts with 2000 : : / 3, by IANA
5. Private-Local Link starts with FE80 : : / 10
6. Loopback - : : 1
7.Unspecified - : :
8. Reserved Addresses are used by IETF
9. Every IPV6 interface contains atleast 1 loopback and 1 link-local address
10. Single interface will be assigned multiple addresses of any type
11. Converting IPV4 to IPV6 involves 1. Dual Stack, 2. Tunneling, 3. Proxying & Translation
ADMINISTRATIVE DISTANCE
1. Directly Connected Route – 0
2. Static Route – 1
3. Internal EIGRP Route – 90
4. OSPF Route – 110
5. RIP Route – 120
6. External EIGRP Route – 170
7. Unknown Route – 255
PATH COST
1. Ethernet – 100
7
CCNA 2.0 ( 200 - 120 ) ROUTING AND SWITCHING CISCO COMMANDS
2. FastEthernet – 19
3. Gi-Ethernet – 4
4. 10Gi-Ethernet – 2
CABLING
1. Straight-Through Twisted-Pair Cable
3. Roll-Over Cable
To connect PC COM port with Switch
4. Console Cable
To connect Switch / Router’s Console port with PC for configuration