IOS Features
CEF
- Cisco proprietary packet switching (Cisco Express Forwarding)
- Main components are FIB and AT (Adjacency Table). Part of data plane.
- FIB derived from routing table (RIB)
- Generally on by default on Cisco routers and multilayer switches
-
L2 information is kept in adjacency table (
show adjacencyandshow adjacency detail). Derived from ARP. -
Process switching - uses CPU. Slow
- Fast switching - Lookup on first packet, used cached entry for others in same flow. Less CPU intensive than process switching. Enabled with
ip route-cacheon an interface.
Commands
show ip cefshow ip interface- Verify that IP CEF switching is enabled and IP CEF Fast switching turbo vector
SLA
- Consists of a
sourceandresponder(UDP port 1967 used for control connection) - Source connects to responder. REsponder will echo back test packets, adding timestamp info, etc.
- Needs NTP synchronization for accurate timing info
- Responder not required to be configured on simple tests like ICMP echo test
Example configs
Simple ICMP echo test
ip sla 5
icmp-echo 10.1.1.3
frequency 60
ip sla schedule 5 start-time now
Configure responder (if test requires it):
(config)# ip sla responder
Secure IP SLA (configured on both endpoints)
(config)# key chain CCNP
(config-keychain)# key 1
(config-keychain-key)# key-string SPIDERS
(config)# ip sla key-chain CCNP
SLA Tracking
- Tie an sla object to a static route (for example)
- If reachability is down, can remove a route tied to the tracked object from the routing table
(config)# ip sla 1
(config-ip-sla)# icmp-echo 172.12.234.3
(config)# ip sla schedule 1 life forever start-time now
(config)# track 1 ip sla 1 reachability
(config)# no ip route 172.12.34.0 255.255.255.0 172.12.234.3
(config)# ip route 172.12.34.0 255.255.255.0 172.12.234.3 track 1
Commands
show ip sla configshow ip sla statisticsshow track
ACLs
1-99 are standard ACLs
100-100 are extended ACLs
Extended ranges are 1300-1999 for standard and 2000-2699 for extended
Applied to interfaces:
int fa0/0
ip access-group 100 in
- Implicit deny all
Named ACLs:
ip access-list extended BLAH
deny ip 175.56.56.0 0.0.0.255 any
Time-based ACLs:
time-range TELNET
periodic weekdays 09:00 to 17:00
access-list 145 permit tcp any any eq telnet time-range TELNET
line vty 0 4
access-class 145 in
Auth/Passwords
enable secretencrypyed by default.enable passwordis not unlessservice password-encryption
Securing VTY lines:
line vty 0 4
login
password SPIDERS
username johnny password cisco
line vty 0 4
login local
Setting user to login to enable mode, set privilege 15
Enabling SSH
ip domain-name cisco.com
crypto key generate rsa
line vty 0 4
transport input ssh
Syslog
| Severity | Level |
|---|---|
| 0 | Emergencies |
| 1 | Alerts |
| 2 | Critical |
| 3 | Errors |
| 4 | Warning |
| 5 | Notifications |
| 6 | Informational |
| 7 | Debugging |
Timestamps for syslog
clock timezone EST -5
clock summer-time EDT recurring
service timestamps log datetime localtime show-timezone msec
clock set 15:23:00
Logging to console
(config)# logging console 7
terminal monitor
Logging to internal buffer
logging buffered `severity`
logging buffered `size`
Logging to remote syslog
(config)# logging host 1.1.1.1
(config)# no logging event link-status
(config)# logging trap `severity`
SNMP
Set a community for v1/v2c
(config)# access-list 15 permit host 192.168.1.20
(config)# snmp-server community CCNP ro 15
SNMPv3 example
| Security Level | description |
|---|---|
| authNoPriv | auth - You have authentication but no privacy (encryption) |
| noAuthNoPriv | noauth - You have no auth and no privacy |
| authPriv | priv - You have auth and privacy |
Example config
snmp-server group ADMINS v3 priv
snmp-server user jmillay ADMINS v3 auth sha CCNP priv aes 128 SOMEKEY
Configure trap host
snmp-server host 10.1.1.1 traps version 3 priv SUPERSECRET
NTP
- Stratum = how many "hops" away from stratum-0 (atomic clock). Stratum-1 are generally "time servers"
- Uses UDP port 123
- Can use client/server model, or "peer" model whereby peers send NTP messages to eachother.
- Broadcast mode or multicast mode are options.
show clock
Configure server:
ntp master 1
Configure client:
ntp server 10.1.1.4 prefer
ntp server 10.1.1.7
Configure auth (client):
ntp authenticate
ntp authentication-key 1 md5 CCNP
ntp trusted-key 1
ntp server 10.1.1.4
Configure auth (server):
ntp authenticate
ntp authentication key 1 md5 CCNP
ntp trusted-key 1
Configure NTP ACL:
access-list 22 permit host 10.1.1.3
ntp access-group serve 22
Commands
show ntp associationshow ntp statusdebug ntp packet
Netflow
Old style:
int fa 0/0
ip route-cache flow
New style:
ip cef
ip fa0/0
ip route-cache cef
ip flow Ingress
ip flow Egress
ip flow-export destination 172.12.123.1 9980
show ip flow export
Sampler map:
flow-sampler-map CCNP
mode random one-out-of 100
int s0/1/0
flow-sampler CCNP
uRPF
Requires CEF
Loose mode:
ip cef
int serial 1/0
ip verify unicast source reachable-via any
Strict mode:
ip cef
int serial 1/0
ip verify unicast source reachable-via rx
Allow default option (allows default route-resolution in uRPF):
ip verify unicast source reachable via rx allow-default
Verify with show cef interface or show ip traffic
DHCP
Clients broadcast with DISCOVER messages.
Servers respond with an OFFER
Clients REQUEST addresses
Servers respond with ACKs to indicate the assignment is recorded
Clients send ARP requests to see if their new addresses are in use
DHCP Server
(config)# service dhcp
(config)# ip dhcp excluded-address 192.168.0.100 192.168.0.105
(config)# ip dhcp pool MYPOOL
(config-dhcp)# network 192.168.0.0/24
(config-dhcp)# default-router 192.168.0.1
(config-dhcp)# lease 3
(config-dhcp)# dns-server 216.66.108.26
show ip dhcp binding
DHCP Client
int fa0/0
ip address dhcp
Helper Address
Apply to ingress interface where you are receiving broadcasts that need to be forwarded:
ip helper-address 172.12.123.1 (show ip interface)
Default forwarded UDP broadcasts: - TIME 37 - TACACS 49 - DNS 53 - BOOTP 67 (DHCP Server) - BOOTP 68 (DHCP Client) - TFTP 69 - NetBIOS Name Service 137 - NetBIOS Datagram Service 138
Add additional protocols: ip forward-protocol udp ?
Remove protocols: no ip forward-protocol udp tftp
HTTP Server
show ip http server secure status
ip http secure-port 443
Debugs
Add an ACL to debug ip packet:
access-list 124 permit ip host 10.1.1.4 any
access-list 124 permit ip any host 10.1.1.4
debug ip packet 124
show debug
Diagnosing memory
show memory allocating-process totals
Core dumps
16384 bytes of memory reserved for core dump by default
exception core-file R1-core
exception region-size 16384
Execute a manual core dump: write core 10.1.1.1