You are on page 1of 13

CCNA Commands

__________________________________________________________
__________________________________________________________
______________

Router> enable [ ENABLE


MODE , USER MODE ] used for show commands
(limited)
Router# configure terminal [ PRIVILAGE MODE ]
used for show commands (total)
Router(config)# [ GLOBAL
CONFIGURATION MODE ] used for configuration
Router(config-if)# [ INTERFACE
MODE ]
Router(config-line)# [ LINE MODE ]
Router(config-router)# [ ROUTER MODE ]
---------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
Router(config)# hostname R-1
configures hostname of device
Router(config)# enable password xxxxx password
is asked before privilage mode
Router(config)# enable secret xxxxx
password is asked before privilage mode [ prefered ]
---------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
Router(config)# line concole 0
Router(config-line)# password xxxxx sets
password for console port
Router(config-line)# login
---------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
Router(config)# line vty 0 4
Router(config-line)# password xxxxx sets
password for telnet lines 0 to 4
Router(config-line)# login
Router(config-line)# transport input ssh allows
secure telnet (passwords will be encripted)
---------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
Router(config)# interface fa0/0
selects port fa0/0
Router(config)# ip address 192.168.1.1 255.255.255.0
give it ip address
Router(config)# no shutdown
opens the port
---------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
Router(config)# ip route destination mask
next-hop-ip-address
Router(config)# ip route 172.16.0.0 255.255.0.0 1.1.1.1
EXAMPLES
Router(config)# ip route <destination> <mask> <exit
interface> STATIC ROUTE
Router(config)# ip route 172.16.0.0 255.255.0.0 fa0/1
---------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
Router(config)# ip route 0.0.0.0 0.0.0.0 fa0/1
DEFAULT ROUTE
Router(config)# ip route 0.0.0.0 0.0.0.0 180.50.2.1
EXAMPLES
---------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
DYNAMIC ROUTING
---------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
Router(config)# Router rip
enables protocol rip
Router(config-router)# version 2
enables version 2 of rip
Router(config-router)# no autosummary disables
autosummarization
Router(config-router)# network 10.0.0.0 advartises all
subnets of 10.0.0.0 or 10.0.0.0 network
---------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
Router(config)# Router eigrp 100
enables protocol eigrp with AS no: 100
Router(config-router)# no autosummary disables
autosummarization
Router(config-router)# network 10.0.0.0 advartises
all subnets of 10.0.0.0 or 10.0.0.0 network
Router(config-router)# network 172.16.1.0 0.0.0.255
advartises subnet 172.16.1.0 /24
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
Router(config)# Router ospf 1
enables protocol ospf with process no: 1
Router(config-router)# network 10.0.0.0 0.255.255.255
area 0 puts all subnets of 10.0.0.0 or 10.0.0.0 network in
area 0
Router(config-router)# network 172.16.1.0 0.0.0.255
area 1 puts subnet 172.16.1.0 /24 in area 1
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
-
ROUTE REDISTRIBUTION
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
-
Router(config)# Router rip
Router(config-router)# redistribute eigrp 100 metric 1
Router(config-router)# redistribute ospf 1 metric
1
Router(config-router)# redistribute protocol metric
hop-count
---------------------------------------------------------------------------------------
-------------------------
Router(config)# Router ospf 1
Router(config-router)# redistribute eigrp 100 metric
5 subnets
Router(config-router)# redistribute rip
metric 5 subnets
Router(config-router)# redistribute protocol metric cost
subnets
---------------------------------------------------------------------------------------
--------------------------
Router(config)# Router eigrp 100
Router(config-router)# redistribute ospf 1 metric
1 2 3 4 5
Router(config-router)# redistribute rip metric
1 2 3 4 5
Router(config-router)# redistribute protocol metric BW
DELAY Reliability load mtu
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---
ACCESS CONTROL LIST
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---
STANDARD ACL
Router(config)# access-list 1 permit host 10.1.1.1
Router(config)# access-list 1 deny host 10.1.1.2
Router(config)# access-list 1 permit any
---------------------------------------------------------------------------------------
--------------------------------------------------
EXTENDARD ACL
Router(config)# access-list 101 IP permit host
10.1.1.1 host 172.16.1.1
Router(config)# access-list 101 TCP permit host
10.1.1.1 host 172.16.1.2 eq FTP
Router(config)# access-list 101 IP permit host
10.1.1.1 192.168.1.0 0.0.0.255
Router(config)# access-list 101 IP deny host
10.1.1.1 any
Router(config)# access-list 101 IP permit any
any
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------
SWITCHING
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------
Switch > enable [ ENABLE
MODE , USER MODE ] used for show commands
(limited)
Switch # config terminal [ PRIVILAGE MODE
] used for show commands
(total)
Switch(config) # [ GLOBAL
CONFIGURATION MODE ] used for configuration
Switch(config-vlan) # [ VLAN MODE
]
------------------------------
Switch(config)# vlan 10 creates vlan 10
Switch(config)# name sales give it name sales
---------------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Switch(config)# interface fa 0/9
Switch(config-if)# switchport mode access Access
port configuration
Switch(config-if)# switchport access vlan 10 puts
acessport in vlan 10
---------------------------------------------------------------------------------------
------------------------------------------------------------------------------
Switch(config)# interface fa 0/10
Switch(config-if)# switchport mode trunk Trunk port
configuration
Switch(config-if)# switchport trunk encapsulation dot1q
selects trunking protocol 802.1q
Switch(config-if)# switchport nonegotiate turns
off DTP negotiation for trunk
---------------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Inter Vlan Routing ( router-on-stick)
Router(config)# interface fa 0/0
Router(config-if)# no shutdown opens the
port (must be put always on physical port)
Router(config-if)# interface fa 0/0.1 creates sub
interface fa0/0.1
Router(config-sub-if)# encapsulation dot1q 10 links
sub int fa0/0.1 to vlan 10
Router(configsub-if)# ip address 10.0.0.1 255.0.0.0
gives ip address to port fa0/0.1
---------------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Switch(config)# spanning-tree vlan 10 root primary [
automatic ]
Switch(config)# spanning-tree vlan 10 priority 4096 [
manual ]
---------------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Switch(config)# interface range fa0/1 - 3,fa0/9,fa0/15
selects a group of port
Switch(config-range-if)#channel-group 1 mode on
binds the port in one group no : 1 , called ether channel
HSRP
Router(config)# interface fa 0/0.1
Router(config-sub-if)# encapsulation dot1q 10
Router(configsub-if)# ip address 10.0.0.1 255.0.0.0
Router(configsub-if)# standby 1 ip 10.0.0.3
defines the ip of virtual-gateway
Router(configsub-if)# standby 1 priority 150 sets
the priority of this port to 150 ,default is 100,so it becomes
active
Router(configsub-if)# standby 1 preempt
needed to force this port to become active gateway again
after failure
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---
SHOW COMMANDS OR EXEC COMMANDS
Router# show version
Router# show flash
Router# show clock
Router# show cdp neighbors
Router# show cdp entries
Router# show running-config
--------------------------------------------------------------------
Switch# show version
Switch# show flash
Switch# show clock
Switch# show cdp neighbors
Switch# show cdp entries
Switch# show running-config
----------------------------------------------------------------------
Router# show ip interface brief
Router# show interface fastethernet 0/0
Router# show ip protocols
Router# show ip route
Router# show ip route connected
Router# show ip route static
Router# show ip route rip
Router# show ip route ospf
Router# show ip route eigrp
Router# show access-list
Router# show standby
----------------------------------------------------------------------
Switch# show vlan brief
Switch# show interfaces trunk
Switch# show interface fa0/0 switchport
Switch# show spanning-tree vlan 10
Switch# show ether-channel
Switch# show ether-channel summary
---------------------------------------------------------------------------------------
-----------------------------------------------------------------------------
TROUBLE SHOOTING COMMAND
From Router or Layer3 switch
Router# ping 192.168.1.1
Router# traceroute 192.168.1.1
From command prompt
PC> ping 192.168.1.1
PC> tracert 192.168.1.1
For remote access from command prompt
PC> telnet 192.168.1.1 ip of router you want to
telnet
PC> password xxxx password of line vty
of remote router
R-7>enable loged in that
router
password xxxx enable
password / enable secret
R-7#

__________________________________________________________
__________________________________________________________
__

You might also like