Sie sind auf Seite 1von 13

CCNA Commands

__________________________________________________________
__________________________________________________________
______________
Router> enable
MODE , USER MODE ]
(limited)

[ ENABLE
used for show commands

Router# configure terminal


used for show commands (total)

[ PRIVILAGE MODE ]

Router(config)#
[ GLOBAL
CONFIGURATION MODE ] used for configuration
Router(config-if)#
MODE ]
Router(config-line)#
Router(config-router)#

[ INTERFACE
[ LINE MODE ]
[ ROUTER MODE ]

------------------------------------------------------------------------------------------------------------------------------------------------------------------------Router(config)# hostname R-1


configures hostname of device
Router(config)# enable password xxxxx
is asked before privilage mode
Router(config)# enable secret xxxxx

password

password is asked before privilage mode [ prefered ]


------------------------------------------------------------------------------------------------------------------------------------------------------------------------Router(config)# line concole 0
Router(config-line)# password xxxxx
password for console port

sets

Router(config-line)# login
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------Router(config)# line vty 0 4
Router(config-line)# password xxxxx
password for telnet lines 0 to 4

sets

Router(config-line)# login
Router(config-line)# transport input ssh
secure telnet (passwords will be encripted)

allows

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------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
EXAMPLES

255.255.0.0

1.1.1.1

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


DEFAULT ROUTE

0.0.0.0

fa0/1

Router(config)# ip route 0.0.0.0


EXAMPLES

0.0.0.0

180.50.2.1

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------DYNAMIC ROUTING
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------Router(config)# Router rip
enables protocol rip
Router(config-router)# version 2
enables version 2 of rip

Router(config-router)# no autosummary
autosummarization

disables

Router(config-router)# network 10.0.0.0


subnets of 10.0.0.0 or 10.0.0.0 network

advartises all

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------Router(config)# Router eigrp 100


enables protocol eigrp with AS no: 100
Router(config-router)# no autosummary
autosummarization
Router(config-router)# network 10.0.0.0
all subnets of 10.0.0.0 or 10.0.0.0 network

disables
advartises

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
Router(config-router)# redistribute ospf 1
1
Router(config-router)# redistribute protocol

metric
metric

hop-count
--------------------------------------------------------------------------------------------------------------Router(config)# Router ospf 1
Router(config-router)# redistribute
5 subnets

eigrp 100

Router(config-router)# redistribute
metric
5 subnets

rip

metric

Router(config-router)# redistribute protocol metric cost


subnets
---------------------------------------------------------------------------------------------------------------Router(config)# Router eigrp 100

Router(config-router)# redistribute
1
2
3
4
5

ospf 1

Router(config-router)# redistribute
1
2
3
4
5

rip

metric
metric

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
10.1.1.1 host 172.16.1.1

IP

Router(config)# access-list 101 TCP


10.1.1.1 host 172.16.1.2 eq FTP

permit
permit

host
host

Router(config)# access-list 101


10.1.1.1 192.168.1.0 0.0.0.255

IP

permit

Router(config)# access-list 101


10.1.1.1 any

IP

deny

Router(config)# access-list 101


any

IP

permit

host
host
any

----------------------------------------------------------------------------------------------------------------------------------------------------------------------SWITCHING
----------------------------------------------------------------------------------------------------------------------------------------------------------------------Switch > enable
MODE , USER MODE ]
(limited)
Switch # config terminal
]
(total)

[ ENABLE
used for show commands
[ PRIVILAGE MODE
used for show commands

Switch(config) #
[ GLOBAL
CONFIGURATION MODE ] used for configuration
Switch(config-vlan) #
]

[ VLAN MODE

-----------------------------Switch(config)# vlan 10
Switch(config)# name sales

creates vlan 10
give it name sales

--------------------------------------------------------------------------------------------------------------------------------------------------------------------Switch(config)# interface fa 0/9


Switch(config-if)# switchport mode access
port configuration

Access

Switch(config-if)# switchport access vlan 10


acessport in vlan 10

puts

-------------------------------------------------------------------------------------------------------------------------------------------------------------------Switch(config)# interface fa 0/10


Switch(config-if)# switchport mode trunk
configuration

Trunk port

Switch(config-if)# switchport trunk encapsulation dot1q


selects trunking protocol 802.1q
Switch(config-if)# switchport nonegotiate
off DTP negotiation for trunk

turns

--------------------------------------------------------------------------------------------------------------------------------------------------------------------Inter Vlan Routing ( router-on-stick)


Router(config)# interface fa 0/0
Router(config-if)# no shutdown
port (must be put always on physical port)
Router(config-if)# interface fa 0/0.1
interface fa0/0.1

opens the
creates sub

Router(config-sub-if)# encapsulation dot1q 10


sub int fa0/0.1 to vlan 10

links

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
telnet
PC> password xxxx
of remote router
R-7>enable
router
password xxxx
password / enable secret

ip of router you want to


password of line vty
loged in that
enable

R-7#

__________________________________________________________
__________________________________________________________
__