CCNA COMMANDS
CCNA COMMANDS
show vlan brief (on switch - show what VLANs exist, names, ports
assigned )
show controllers serial x/x/x (see if DCE or DTE connected and if clockrate
is present)
show interface trunk (what ports are trunking, native vlan, allowed vlans)
show run | begin interface (will start listing at the first instance of
‘interface’)
show ip route static (show routing table entries for static routes)
show ip route ospf (show routing table entries learned through OSPF)
show ip route eigrp (show routing table entries learned through EIGRP)
show ipv6 ??? (does the IPv6 version of many IPv4 commands)
trace X.X.X.X (show the path taken to reach the destination host at
X.X.X.X)
R1(config)# do show ??? (execute show commands from configuration
mode)
undebug all (turn off all debugging commands – handy if this is a busy
router)
ctrl-n or dn-arrow (if you have gone back in command history, this moves
forward)
ctrl-c (cancel current command or leave Setup mode if you accidentally get
into it)
S1# delete vlan.dat (hit ‘enter’ to accept defaults) [Note: Only do this on a
switch]
S1# reload (answer ‘no’ if asked to save current config [Router or Switch])
R1(config-line)# login (instruct the router that you want it to check for a
password)
S1(config)# line vty 0 15 [zero 15] (configure the same options in a switch)
S1(config-line)# login (tell the VTY ports to ask for password from remote
user)
R1(config-if)# clock rate CLOCK (on serial DCE interfaces, set the speed of
the link)
-or-
Trunk Creation
Router-on-a-Stick Configuration
S1(config)# vtp mode client (configure this switch to be in client mode) ---
or--
S1(config)# vtp password PASSWORD (change the VTP password for this
switch)
S1# show vtp status (see VTP mode, revision, version, domain name,
pruning mode, etc)
S1# show vtp password (only way to see the VTP password – does not
show in status)
Etherchannel (PortChannel)
on (enable Etherchannel)
S1(config-if)# switchport trunk native vlan 777 (set native VLAN the
same as the physical)
Spanning Tree
S1(config)# spanning-tree vlan 10,20 root primary (make root bridge for
these VLANs)
S1# show spanning-tree summary (among other things, see if this is the
root bridge)
S1# show spanning-tree blockedports (see which ports are in STP
blocking status)
Set a higher priority (default 100) to make this router the primary in HSRP
Preempt will make this router the active one if it had been down and comes
back up
Set a higher priority (default 100) to make this router the primary in HSRP
Preempt will make this router the active one if it had been down and comes
back up
Security Practices
SSH Configuration
Router(config)# hostname R1 (must change the name of the device from
the default)
IP DHCP Snooping
R1(config)# no router rip (remove all RIP configurations and routing table
entries)
R1(config)# ipv6 route ::/0 S0/0/1 (default route goes out S0/0/1)
R1(config-if)# ipv6 rip NAME enable (include this interface and subnet in
routing)
R1(config-if)# bandwidth 768 (indicate the serial line speed for the routing
protocol – this example is 768-K)
R1(config-if)# ip hold-time eigrp 100 90 (in this example, set the hold-
time on this interface to 90s for EIGRP AS=100)
R1(config)# key chain MYCHAIN (name the key chain – done in global
config)
R1# debug eigrp fsm (see what DUAL does when a route is removed from
the routing table)
R1# show ip ospf (display OSPF process and router IDs, as well as area
information)
R1# show ip ospf interface serial 0/0/0 (see DR/BDR information, hello
and dead intervals)
R1(config)# ipv6 router ospf 100 (create the OSPF process in this router)
R1(config-if)# ipv6 ospf 100 area 0 (associate this interface with IPv6
OSPF 55, area 0)
R1(config-if)# ipv6 eigrp 100 (associate this interface with IPv6 EIGRP
process 100)
R1(config-if)# ipv6 summary-address eigrp 100
2001:123A:AAA0::/60 (EIGRP summary address)
R1(config)# key chain MYCHAIN (name the key chain – done in global
config)
If PAP, the username and password must match the sent-username and password from
other router.
If CHAP, the username must be the hostname of the other router and the passwords
must be the same in each routers username configuration.
Frame-Relay Commands
-There are two basic types of Frame-Relay configuration: Point-to-Point and
Multi-Point.
R1# show frame-relay lmi (see status of local link to Frame-Relay cloud)
R1# show frame-relay pvc (see which links are actually up end-to-end)
-Standard access lists only evaluate the source IP field. They can use the
‘host’ and ‘any’ keywords, or apply wildcard masks. They do not use port
numbers.
Wildcard 23 – Wildcard 23 –
permit IP mask eq telnet mask eq telnet
80 –
deny TCP gt http gt 80 – http
443 – 443 –
remark UDP any lt https any lt https
host echo host echo
ICMP X.X.X.X neq (ping) X.X.X.X neq (ping)
echo- echo-
OSPF range reply range reply
EIGRP
Etc…
Time-Based ACL
R-1# show access-list (see access lists on this router and # of ‘matches’
per line)
R-1# show access-list NAME (see a specific access list and # of ‘matches’
per line)
R-1# show ip dhcp binding (see what IP addresses are assigned & MAC
addresses)
-For both static and dynamic NAT, designate interfaces as inside or outside:
-Static NAT requires only one statement. The IP addresses are inside /
outside:
-Dynamic NAT may use a pool of ‘outside addresses’. If you do not use a
pool, you will have to use the address on the outside interface. You can use
‘netmask’:
-or- Dynamic NAT can use the pool with overload to share outside addresses:
-or- Dynamic NAT can use the exit interface – almost always will use
overload: