All The Basic CCNA Config Commands
All The Basic CCNA Config Commands
I wanted to share a file that I put together while I was in the Cisco Net Acad. (basically CCNA 1-4). These
commands are all the ones from the textbooks that I compiled as I went. This is the barebones to get it
up and running. Of course, you can play around with it and make those routers do lots of tricks, but this
will get you going.
Initial Setup
router>enable
router#config t
router(config)#hostname [i.e. rtA, rtB, New York]
rtA(config)#enable secret class
rtA(config)#line con 0
rtA(config-line)#password cisco
rtA(config-line)#login
rtA(config-line)#exit
rtA(config)#line vty 0 4
rtA(config-line)#password cisco
rtA(config-line)#login
rtA(config-line)#exit
rtA(config)#ip host [Hostname i.e. rtA, rtB] [ip address]
rtA(config)#banner motd #Authorized Access Only!!!#
rtA(config)#interface [i.e. s0,s1,e0,lo0,lo1]
rtA(config-if)#ip address [ip address] [Subnet mask]
rtA(config-if)#(if DCE) clockrate 56000
rtA(config-if)#description [Link to.....]
rtA(config-if)#no shutdown
rtA(config-if)#exit
rtA(config)#router rip
rtA(config-router)#version 2 (*If you are using version 2, skip if not)
rtA(config-router)#redistribute static (*If you redistribute default route, skip if not)
rtA(config-router)#network [Network address]
rtA(config-router)#exit
rtA(config)#copy run start
Setting up Static Routes
rtA(config)#interface [Interface closest to the Destination that ACL will be applied, i.e. s0, s1, e0, lo0]
rtA(config-if)#ip access-group [#1-99] [In/Out]
rtA(config)#access-list [#100-199, 2000-2699] [Permit/Deny] [Protocol, i.e. TCP, IP, UDP, ICMP] [Source
Address] [Source Wild Card Mask] [Destination Address] [Destination Wild Card Mask] [Operator, i.e. lt
(less than), eq (equal to), neq (not equal to)] [Port #] [Log]
rtA(config)#access-list [#100-199, 2000-2699] [Permit/Deny] [Protocol] any any
(Implicit Deny statement automatically applied)
rtA(config)#interface [Interface closest to the Source that Extended ACL will be applied, i.e. s0, s1, e0,
lo0]
rtA(config-if)#ip access-group [#100-199, 2000-2699] [In/Out]
Named Access Control Lists
rtA(config)#interface [If Standard ACL chosen, use interface closest to Destination; if Extended ACL
chosen, use interface closest to Source]
rtA(config-if)#ip access-group [Name] [In/Out]
OSPF
rtA(config-if)#ip ospf priority (0-255, 0 prevents election, highest # will be DR, next highest BDR)
rtA(config-if)#bandwidth (eg. 56 = 56k)
EIGRP
Switch(config)#hostname (name)
Switch(config)#line con 0
Switch(config-line)#password (password)
Switch(config-line)#login
Switch(config-line)#exit
Switch(config)#line vty 0 15
Switch(config-line)#password (password)
Switch(config-line)#login
Switch(config-line)#exit
VLAN Configuration
Switch(config)#interface VLAN 1
Switch(config-if)#ip address (ip address) subnet mask (mask)
Switch(config-if)#ip default-gateway (ip address)
Switch(config-if)#no shutdown (vlan 1 only!!!)
Switch(config)#clear mac-address-table
Creating VLANs
Switch#vlan database
Switch(vlan)#vlan (vlan #) name (vlan name)
Switch(vlan)#exit
Deleting VLANs
Switch(config)#delete vlan.dat
Switch(config)#erase startup-config
Switch(config)#reload
VLAN Trunking
VTP Setup
Switch#vlan database
Switch(vlan)#vtp domain (name)
Switch(vlan)#vtp password (password)
Switch#vlan database
Switch(vlan)#vtp (server, client, transparent)
Inter-VLAN Routing
NAT Static
rtA(config)#ip nat inside source static [Inside local IP address] [Inside global IP address]
rtA(config)#in e0/0
rtA(config-if)#ip address [ip address] [subnet mask]
rtA(config-if)#ip nat inside
rtA(config)#in s0/0
rtA(config-if)#ip address [ip address] [subnet mask]
rtA(config-if)#ip nat outside
NAT Dynamic
rtA(config)#ip nat pool [pool name] [address range] netmask [network address mask]
rtA(config)#ip nat inside source list [list #] pool [name of nat-pool]
rtA(config)#in e0/0
rtA(config-if)#ip address [ip address] [subnet mask]
rtA(config-if)#ip nat inside
rtA(config)#in s0/0
rtA(config-if)#ip address [ip address] [subnet mask]
rtA(config-if)#ip nat outside
rtA(config)#access-list [same list # used above] permit [ip address] [wildcard mask]
PAT
rtA(config)#in e0/0
rtA(config-if)#ip address [ip address] [subnet mask]
rtA(config-if)#ip nat inside
rtA(config)#in s0/0
rtA(config-if)#ip address [ip address] [subnet mask]
rtA(config-if)#ip nat outside
DHCP Relay
rtA(config)#ip helper-address (allows router to forward UDP broadcasts to look for address of DHCP
server)
ISDN
rtA(config)#in bri
rtA(config-if)#encapsulation [ppp/frame-relay/hdlc/lapb/x25/cpp] (usually ppp)
rtA(config-if)#isdn spid 1 [spid #] [ldn #]
rtA(config-if)#isdn spid 2 [spid #] [ldn #]
rtA(config-if)#dialer-group [group #]
rtA(config-if)#dialer-map [protocol] [next hop address] name [name of next hop router] speed 56
[broadcast] dial-string [5551000, 5552000]
rtA(config-if)#ppp authentication chap
ISDN Dialer Profiles
FRAME RELAY
rtA(config)#in s0/0
rtA(config-if)#ip address [ip address] [subnet mask]
rtA(config-if)#encapsulation frame-relay [cisco/ietf]
rtB(config)#in s0/0
rtA(config-if)#ip address [ip address] [subnet mask]
rtA(config-if)#encapsulation frame-relay [cisco/ietf]