Command
Command
(config-if)# ipv6 address 2001:41d0:8:e115::/64 eui- Add IPv6 address based on MAC to
64 interface.
(config)# ipv6 route 2001:41d0:8:e115::/64 [g1/1] Next hop is required for Ethernet interface
[next hop] in IPv6
(config)# ip host the-space.agency 178.32.222.21 Create a static host entry on this device.
Command Description
# show interfaces [if-name] Show interfaces mac, bandwidth, mtu, packet stats...
# show ip[v6] route [static] Show routes and how they were learned.
# show ip[v6] interface brief [if-name] Only show ip, status and operational status
# show protocols [if-name] Much like show ip int brief, w/ cidr, w/o ok/method
# clear mac address-table [dynamic] Clear the dynamically learned mac address table entries.
# show control-plane host open-ports netstat -tulpn on this cisco device, basically
Command Description
(config)# monitor session 23 source interface g1/1 {rx,tx,both} Define SPAN #23 input as g1/1
(config)# monitor session 23 destination interface g1/2 Define SPAN #23 output as g1/2
Port Security
Command Description
(config-if)# switchport port-security violation Shutdown port when other device gets
shutdown connected.
Term Definition
Command Description
# show port-security [interface g1/1] port status, violation mode, max/total MACs,...
Note: Even when a switch port is changed from access to trunk, its access vlan is maintained in the config.
When automatic trunk negotiation fails (e.g. because I unplug a link between to switches and put it into
my laptop) the configured access vlan becomes active once again and I might be able to reach network
parts I'm not supposed to. Always disable DTP / trunk auto negotiation.
Command Description
(config-if)# switchport mode access Make frames out this port untagged
(config-if)# switchport mode trunk Make frames out this port tagged by default
(config-if)# switchport trunk native vlan 256 Except for vlan 256, which is still untagged.
(config-if)# int g
Command Description
Command Description
# show vlan [{id 23, name TelephoneSanitizer}] [brief] Show vlan settings for all switch ports
# show run interface vlan 1 Quick way to search the running config.
# show dtp interface g1/1 Show current DTP mode for g1/1
VTP
Command Description
Troubleshoot VTP
Command Description
show vtp status show vtp domain, pruning, mode and more
STP
Spaning Tree Protocol (802.1D) blocks ports with redundant links to prevent layer 2 loops and broadcast
storms.
Command Description
(config)# spanning-tree vlan 1 root {primary, Make this device the primary/secondary root
secondary} bridge.
(config)# spanning-tree portfast bpduguard Enable bpdu guard for all portfast enable
default interfaces
(config)# spanning-tree portfast default Enable portfast for all non-trunk interfaces
Troubleshoot STP
Command Description
# show spanning-tree [vlan 1] Who's the root and how do I get there?
RSTP
Rapid Spanning Tree Protocol (802.1w) reduces convergence time after a topology change compares to
STP.
Command Description
Command Description
(config)# interface range g1/1 - 2 configure g1/1 and g1/2 at the same time
Command Description
# show interface port-channel 1 Has the combined bandwidth and members as extra info.
Configure a Serial
Layer 1 link speed is dictated by a CSU/DSU, in a lab without an external CSU/DSU a DTE (Data Terminal
Equipment) cable and DCE (Data Communications Equipment) cable are used.
Command Description
(config-if)# clock rate 128000 Set clock rate on DCE router side to 128 kbps
(config)# show controllers serial 1/0 Verify clock rate for serial interface 1/0
ACLs
Command Description
(config)# access-list 23 permit 1.2.3.4 Create ACL #23 or append a rule to ACL #23,
[0.0.255.255] allow 1.2.x.x
(config)# ip[v6] access-list resequence local_only Renumber ACL Rules, put first on #5,
5 10 increment by 10.
(config)# ip access-list {standard, extended} Create ACL and/or enter config mode for ACL
local_only 'local_only'
Interface ACLs
Command Description
(config-if)# ip access-group 23 out Apply ACL #23 to outgoing packets, not send by the router
(config-if)# ip access-group Overwrite the used ACL, only one ACL per if + proto +
local_only in direction!
Command Description
# show ip interface g1/1 | incl Show ACLs on g1/1 (When none set shows not set for v4 and
access list nothing for v6)
Troubleshooting ACLs
Command Description
# show access-list 10 Display all rules in ACL #10 and how often they matched.
NAT
Local addresses are any address as it appears inside the network. Global addresses are any address as it
appears outside the network.
Term Definition
outside local IP address of a remote host as it appears inside the network, non-routable
outside global IP address of a remote host assigned by the host owner, routable
Command Description
SNAT
Command Description
(config)# ip nat inside source static 10.10.23.2 SNAT - statically map an internal ip 1:1 to an
1.2.3.5 external ip.
DNAT
Command Description
The overload keyword means, that one or a couple of external IPs are to be used for multiple internal IPs.
Higher level information like connection port numbers are used to identify the correct internal
destination for incoming packets. Cisco calls this PAT, while this is what your average joes home router
would call NAT.
Command Description
(config)# ip nat inside source list 10 interface g1/1 PAT IPs matching ACL #10 many:1 with g1/1s
overload public IP
Troubleshooting NAT
Command Description
Show translations are actually used and interfaces are marked in/out
# show ip nat statistics
correctly.
Is the ACL correct? Is there a route to the address? Note: NAT Table entries are kept for 24h after the last
use by default.
DHCP Server
Command Description
(config)# ip dhcp pool PCs Creat and/or enter dhcp config for pool 'PCs'
Troubleshooting DHCP
Command Description
Command Description
(config-if)# standby [group-number] (optional) Preempt other routers when this router
preempt becomes active
Troubleshooting HSRP
Command Description
# show standby HSRP Groups, their VIPs, state, active router, standby router, preemption.
SLAs
Command Description
(config)# ip sla schedule 23 life {forever, seconds} start- Start test #23 now and until manually
time now stopped.
Troubleshooting SLAs
Command Description
Device Management
Command Description
# show {running,startup}-config
Firmware Management
Command Description
License Management
Command Description
(config)# no license boot module technology- Remove the no longer needed line from the
package disable config.
Reset Password
Command Description
(config)# config-register
Do load startup-config after boot again.
0x2102
# save
Telnet / Console
Command Description
(config)# line vty 0 4 Enter config mode for vty 0 to 4 (up to 15 allowed).
(config)# line console 0 Enter config mode for the console port
(config-line)# access-class 10 in Set ACL to limit inbound IPs allowed to access vty
Command Description
SSH
Command Description
(config)# crypto key generate rsa modulus Generate keys like it's 1995! Potentially takes
2048 forever.
Clock
Command Description
Command Description
(config)# no ip http server Stop the http server (but not https).
# auto secure
Radius
Command Description
(config)# aaa authentication login group local Allow that group and local users in.
TACACS+
Command Description
(config-server-tacacs)# [port ]
(config-server-tacacs)# key
(config)# aaa authentication login group local Allow that group and local users in.
Syslog
Command Description
# logging trap informational Only log messages with min. informational sev.
service sequence-number | Needed for seqence number in syslog messages service time stamps log
[datetime, log] | Needed for date and time in syslog messages
Command Description
SNMP
Command Description
Command Description
Command Description
# [no] cdp run Enables cdp globaly and on all interfaces (default)
# show cdp neighbors [detail] List connected cisco devices (name, local/remote port, [ip] ..)
Command Description
PPP
Command Description
(config)# username fnord password pass Create users for pap auth.
Command Description
(config)# username routy2 password foobar Create users for chap auth for routy2
Note: When routy1 connects to routy2 it looks in it's local user database for a user named routy2 and
uses that users password. This means the passwords have to be the same on both sides and the
usernames must be the other sides hostname.
Troubleshooting PPP
Command Description
# show ppp all session state, auth type, peer ip and name
MLP
Command Description
(conifg-if)# ppp multilink group 23 Make phys ifs with mlp #23 join.
Troubleshooting MLP
Command Description
PPPoE
Command Description
(config-if)# dialer pool 23 The dialer interface is a member of one dialer pool...
(config-if)# no ip address
(config-if)# pppoe-client dial-pool-number ... the pool is a group of one or more physical
23 interfaces.
Troubleshooting PPPoE
Command Description
# show ip interface brief is the dialer if up? Does the dialer have an IP via IPCP?
GRE
Note: We can run OSPF and other routing protocols through this gre tunnel, as gre supports multicast.
Command Description
Troubleshooting GRE
Command Description
# show ip interface brief tunnel23 Line hould be up, given a route to the destination.
RIPv2
Command Description
(config)# router rip Enable RIP and enter it's config mode
(config-router)# passive-interface g1/1 Don't send RIP updates out this interface
Troubleshooting RIPv2
Command Description
# show ip rip database Routes learned by rip, used to combile the routing table
EIGRP
Note: The network command enables any interface with an ip in that net to send and receive EIGRP
updates. Also it enables routes to this nets to start beeing advertised.
Command Description
(config-router)# [no] passive-interface g1/2 Disable EIGRP here. Ignore incoming pkgs.
# show ip[v6] eigrp neighbors Neighbor addr, if, hold time, uptime, queued pkgs
# show ip[v6] eigrp interfaces [if-name] If, Number of peers, pending routes, queued pkgs
Command Description
# show ip[v6] route [eigrp] Routes starting with D were learned via EIGRP
Command Description
(config-if)# [no] ipv6 eigrp 23 Enable eigrp with ipv6 for as #23 on this if.
OSPF
Command Description
(config-router)# (no) passive-interface g1/1 Stop in- and egress ospf hello packets.
Command Description
Router Types
Term Definition
Autonomous System Boundary Injects routes into OSPF via redistribution from other
Router (ASBR) routing protocols
Command Description
The networks command does not exist, non mentioned commands are the same.
Troubleshooting OSPF
Command Description
# show ipv6 ospf reference bandwidth, router id, networks, interface per area
# show ip(v6) ospf neighbor neighbor IDs, IPs and via interface.
# show ip(v6) ospf interface g1/1 ospf related infos for g1/1, passive?
# show ip(v6) route (ospf) ospf routes are marked O, show route ad and cost
BGP
Note: In other routing protocols the network statement is used to determin the interfaces over which the
protocol should talk to its neighbors. In BGP it indicates only which routes should be advertised to the
BGP neighbors. The network needs to match an exact route in the routing table or it will still not be
announced.
Command Description
Command Description
# show ip bgp summary neighbors IPs, ASs and session states, bgp version
# show ip bgp neighbors [peer-ip] tcp sessions and timers, bgp parameters
CLI
Default Behavior
Here I'll collect crazy default behaviors and how to fix them, I guess..
Command Description
Modes
Filters
Name Function
begin interface Show remaining config starting with the first line containing 'interface'
Navigation
Sequence Function
Ctrl-C
Drop back to Exec, does not kill processes..
Tab Autocompletion
Packet Types
Ethernet Frame
Type or Length 2 bytes Layer three type OR length if smaler then 1536 bytes.
46 - 1500
Data Payload
bytes
Field Field Length Description
IPv4 Header
TCP Segment
Field
Field Description
Length
Control Flags like SYN, ACK, FIN, RST and Flags for
Flags 9 bits
congestion control.
0 - 320
Options The Size is determined by Header length. TODO:
bits
Data variable
UDP Segment
Field Field Length Description
Data variable
Command Description
# telnet 1.2.3.4 23
Telnet to 1.2.3.4 using port 23