0% found this document useful (0 votes)
21 views8 pages

CCNA R & S Quick Reference

NA

Uploaded by

voluptasrimor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views8 pages

CCNA R & S Quick Reference

NA

Uploaded by

voluptasrimor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

CCNA 2.

0 ( 200 - 120 ) ROUTING AND SWITCHING CISCO COMMANDS

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

10. Default Gateway of Switch


x(config)#ip default-gateway <ip address> /*router interface ip, in which the switch is connected*/

11. Save Configuration


x#copy running-config startup-config or x#write

12. View Interfaces


x#show interfaces

13. View IP Interface


x#show ip interface brief

14. View MAC Address Table


x#show mac-address-table

15. View Running Configuration


x#show running-config

16. View Version


x#show version

17. View Hardware Details


x#show controllers or x#show controllers <interface>

18. Trace Route


x#traceroute<ip address>

1
CCNA 2.0 ( 200 - 120 ) ROUTING AND SWITCHING CISCO COMMANDS

19. Backup IOS Image


x#show flash: /*shows the xxx.bin file, copy that*/
x#copy flash: tftp:
Source filename []? <xxx.bin> /*paste that copied xxx.bin file*/
Address or name of remote host []? <destination ip or name>
Destination filename [Source filename.bin]? <yyy.bin> /*give any name*/

20. View MAC/IP Address in PC


C:\>ipconfig /all /*in cmd prompt*/

21. View Neighbour Devices


x#show cdp neighbours or x#show cdp neighbour detail

SECURITY CONFIGURATIONS
1. Console Password
x(config)#line console 0
x(config-line)#login
x(config-line)#password <password>

2. Virtual Terminal Password


x(config)#line vty 0 4
x(config-line)#login
x(config-line)#password <password>

3. Enable Password
x(config)#enable password <password>

4. Enable Secret Password


x(config)#enable secret <password>

5. Service Password Encryption


x(config)# service password-encryption

6. Secure Unused Ports


x(config)#interface <interface>
x(config-if)#shutdown

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

8. View Port Security


x#show port-security interface <interface>

9. Verify Port security on the catalyst


x#show port-security address or x#show port-security

REMOTE LOGIN CONFIGURATION


1. SSH (Secure Shell)

2
CCNA 2.0 ( 200 - 120 ) ROUTING AND SWITCHING CISCO COMMANDS

x(config)#username <name> password <password>


x(config)#ip domain-name <domain name> /*e.g., cisco.com*/
x(config)#crypto key generate rsa
How many bits in the modulus[512]:1024
x(config)#ip ssh version 2
x(config)#line vty 0 4
x(config-line)#login local
x(config-line)#transport input ssh

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*/

2. NTP (Network Time Protocol)


/*connect a server to the router or switch, assign ip and default gateway, enable ntp and give password*/
x(config)#ntp server <server ip> /* in router*/
x(config)#ntp authentication-key 1 md5 <password>

3. Loop Back (Instead of connecting n/w or pc’s)


x(config)#interface loopback <no.>
x(config-if)#ip address <ip address> <subnet mask>

4. CDP (Cisco Discovery Protocol)


x(config)#hostname <host name> /*in all switches & routers*/
x#show ip interface brief /*in all routers*/
x(config)#interface <interface> /*in all routers, for all shown interfaces*/
x(config-if)#clock rate 64000
x(config-if)#no shutdown
x(config)#cdp run /*in all switches & routers*/
x#show cdp neighbours /*shows the neighbour devices*/

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. Dynamic Routing - RIP v1 (Routing Information Protocol)


/*assign ip (supports only classful ip) address to all network devices*/ /*Max. Hop Count-15 */
x(config)#router rip /* in router*/

3
CCNA 2.0 ( 200 - 120 ) ROUTING AND SWITCHING CISCO COMMANDS

x (config-router)#network <directly connected n/w id>


x#show ip route /*to view ip route*/
/* ping, to check the connectivity*/

4. Dynamic Routing - RIP v2 (Routing Information Protocol)


/*assign ip (supports both classful and classless, but only contagious-same range of ip) address to all
network devices*/ /*Max. Hop Count-15 */
x(config)#router rip /* in router*/
x(config-router)#version 2
x(config-router)#network <common n/w id>
x (config-router)#no auto-summary /*only for classless ip*/
x#show ip route /*to view ip route*/
/* ping, to check the connectivity*/

5. Dynamic Routing – IGRP (Interior Gateway Routing Protocol)


/*assign ip (supports only classful ip) address to all network devices*/ /*Max. Hop Count-255 */
x(config)#router igrp <AS No.> /* Autonomous System No.1 – 65535, should be same in all routers*/
x (config-router)#network <connected n/w id>
x#show ip route /*to view ip route*/
/* ping, to check the connectivity*/

6. Dynamic Routing – EIGRP (Enhanced Interior Gateway Routing Protocol)


/*assign ip (supports both classful and classless, both contagious and discontagious ip) address to all
network devices*/ /*Max. Hop Count - ∞ */
x(config)#router eigrp <AS No.> /* Autonomous System No.1 – 65535, should be same in all routers*/
x(config-router)#network <connected n/w id>
x (config-router)#no auto-summary /*only for classless ip*/
x#show ip route /*to view ip route*/
/* ping, to check the connectivity*/

7. Dynamic Routing – OSPF (Open Shortest Path First)


/*assign ip (supports both classful and classless, both contagious and discontagious ip) address to all
network devices*/ /*Max. Hop Count - ∞ */
x(config)#router ospf <Process Id. 1 – 65535> /* should be diff. in all routers*/
x(config-router)#network <connected n/w id> <WCM> area <No.> /* area no.- same in all routers*/
x(config-router)#no auto-summary /*only for classless ip*/
x#show ip route /*to view ip route*/
/* ping, to check the connectivity*/

SWITCHING CONFIGURATIONS
1. Create VLAN
x(config)#vlan <No.>
x(config-vlan)#name <vlan name>

2. Assign Ports to VLAN


x(config)#interface <interface>
x(config-if)#switchport access vlan <No.>

3. Make a Port as Trunk


x(config)#interface <interface>
x(config-if)#switchport mode trunk

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

/* Do the same for all VLAN’s*/ of VLAN


C*/
/* Do trunking between switch-switch & switch-router*/
/*Ping, to check interVLAN connection*/

5. View Trunk
x#show interface trunk

6. View Ports Assigned to VLAN


x#show vlan

7. View VTP Configuration Information


x#show vtp status

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*/

2. Extended ACL (Access Control List)


/* should be configured in the source router*/
x(config)#access-list <access-list no.> <permit/deny> ip host <source pc ip> host <dest. pc ip>
/*access-list no.100-199, 2000-2699*/
x(config)# access-list <access-list no.> <deny/ permit> ip any any /*same access list no.*/
x(config)#interface <interface>
x(config-if)#ip access-group <access-list no.> <in/out>
/*Ping from source pc to check*/

3. Permit/Deny any specific service in any specific device


/* should be configured in the source router*/
x(config)#access-list <access-list no.> <permit/deny> tcp/udp host <source pc ip> host <dest. pc ip> eq
<port no.> /*access-list no.100-199, 2000-2699*/
x(config)#interface <interface>
x(config-if)#ip access-group <access-list no.> <in/out>
/* TCP-[FTP-21, SSH-22, Telnet-23] UDP-[DHCP-67, 68, TFTP-69, SNMP-161] TCP&UDP-[DNS-53]
*/

4.ACL Troubleshooting Commands


x#show ip interfaces and x#show access-lists

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 */

IPV6 ROUTING CONFIGURATIONS


1. Enable IPV6 Addressing in Router
x(config)#ipv6 unicast-routing

5
CCNA 2.0 ( 200 - 120 ) ROUTING AND SWITCHING CISCO COMMANDS

2. Default Routing (IPV6)


/*assign ipv6 address to router interfaces and to other network devices*/
x(config)#ipv6 route ::/0 <local exit interface name> <local exit interface ipv6 address> /* in router*/
x#show ipv6 route /*to view ip route*/
/* ping, to check the connectivity*/

3. Static Routing (IPV6)


/*assign ipv6 address to router interfaces and to other network devices*/
x(config)#ipv6 route <Dest. network id/CIDR><local exit interface name> <local exit interface ipv6
address> /* in router*/
x#show ipv6 route /*to view ip route*/
/* ping, to check the connectivity*/

4. Dynamic Routing(IPV6) - RIP (Routing Information Protocol)


/*assign ipv6 address to router interfaces and to other network devices*/
x(config)#ipv6 router rip <any name> /* this name should be same everywhere*/ /* in router*/
x(config)#interface <interface> /*for all local interfaces*/
x(config-if)#ipv6 rip <name> enable
x#show ipv6 route /*to view ip route*/
/* ping, to check the connectivity*/

5. Dynamic Routing(IPV6) - EIGRP (Enhanced Interior Gateway Routing Protocol)


/*assign ipv6 address to router interfaces and to other network devices*/
x(config)#ipv6 router eigrp <AS No.> /* AS No.1 – 65535, should be same in all routers*/
x(config-rtr)#router-id <x.x.x.x>
x(config-rtr)#no shutdown
x(config)#interface <interface> /*for all local interfaces*/
x(config-if)#ipv6 eigrp <AS No.>
x#show ipv6 route /*to view ip route*/
/* ping, to check the connectivity*/

6. Dynamic Routing(IPV6) - OSPF (Open Shortest Path First)


/*assign ipv6 address to router interfaces and to other network devices*/
x(config)#ipv6 router ospf <Process Id. 1 – 65535> /* should be diff. in all routers*/
x(config-rtr)#router-id <x.x.x.x>
x(config)#interface <interface> /*for all local interfaces*/
x(config-if)#ipv6 ospf <Process Id.> area <area no.> /* area no.- should be same in all routers*/
x#show ipv6 route /*to view ip route*/
/* ping, to check the connectivity*/

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

Class D 224 – 239 Only for Multicasting


(Unused)
Class E (Unused) 240 – 255 Only for R & D

Private IP Address Range

6
CCNA 2.0 ( 200 - 120 ) ROUTING AND SWITCHING CISCO COMMANDS

Class A Class B Class C


10.0.0.0 - 10.255.255.255 172.16.0.0 – 172.31.255.255 192.168.0.0 – 192.168.255.255
*IP Addresses rather than Private are Public IP Addresses

CIDR (Classless Inter-Domain Router) - x . x . x . x / CIDR Value, which represents no. of network bits

No. of Networks = 2n,


*n – no. of network bits
No. of Hosts = 2h – 2,
*h – no. of host bits
*(-2) since, 1st ip is assigned as Network id and last ip is assigned as Broadcast id

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

Hub or Server Server or Host Usage


Pin
Pin No. Colour Function Colour Function
No.
1 White-Green Tx+ 1 White-Green Tx+ To Connect,
2 Green Tx- 2 Green Tx- Switch – Router
3 White-Orange Rx+ 3 White-Orange Rx+ Switch – PC
4 Blue 4 Blue Switch – Server
5 White-Blue 5 White-Blue Hub – PC
6 Orange Rx- 6 Orange Rx- Hub - Server
7 White-Brown 7 White-Brown
8 Brown 8 Brown

2. Cross-Over Twisted-Pair Cable

Server or Router Server or Router Usage


Pin
Pin No. Colour Function Colour Function
No. To Connect,
1 White-Green Tx+ 1 Green Tx+ Switch – Switch
2 Green Tx- 2 White-Green Tx- Switch – Hub
3 White-Orange Rx+ 3 Orange Rx+ Hub – Hub
4 Blue 4 Blue Router – Router
5 White-Blue 5 White-Blue Router – Server
6 Orange Rx- 6 White-Orange Rx- Router – PC
7 White-Brown 7 White-Brown PC – PC
8 Brown 8 Brown

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

You might also like