Security

Filters act on the traffic that really flows: an ACL counts its matches as hosts ping and browse, and the attacker laptop's tools trip the switch's protections.

Access lists

Standard and extended ACLs, numbered or named, filter on router interfaces in or out, and on vty lines with access-class. Entries are checked in order, with the implicit deny at the end. Wildcard masks, host, any, TCP and UDP ports (eq, gt, lt, range), ICMP types and established work as in IOS.

Router
In global configuration
access-list 10 permit 10.0.99.0 0.0.0.255A standard ACL: matches the source only.
access-list 110 deny tcp any host 10.0.20.10 eq 23An extended ACL entry: protocol, source, destination and port.
access-list 110 permit ip any anyPermits the rest.
Under ip access-list extended WEB
remark Web from the users onlyA note in the list.
permit tcp 10.0.10.0 0.0.0.255 host 10.0.20.10 eq wwwA named ACL entry (eq 80 works too).
permit icmp any any echo-replyAn ICMP type.
permit tcp any any establishedReturn traffic of TCP sessions.
deny ip any anyAn explicit deny, so the counters show what it drops.
15 permit udp any any eq 53An entry at sequence number 15, between two others.
no 15Removes the entry with that number.
Under interface Gi0/2
ip access-group WEB outFilters what leaves Gi0/2 (in: what arrives).
Under ip access-list standard MGMT
permit host 10.0.99.10A named standard ACL.
Under line vty 0 15
access-class MGMT inOnly that host may log in remotely.
In privileged EXEC
show access-listsEvery ACL with its entries and match counts.
show ip interface Gi0/2Which ACLs are applied to the interface, in and out.
clear access-list countersResets the match counts.
Under interface Gi0/0
ip verify unicast source reachable-via rx allow-defaultStrict unicast RPF: drops a packet unless the route back to its source leaves through this interface (any: loose, any route will do; allow-default: the default route counts).
In privileged EXEC
show ip interface Gi0/0Includes the uRPF mode and its verification drops.

IPv6 access lists

IPv6 lists are always named, match prefixes (2001:db8:20::/64, host, any) with the protocols ipv6, tcp, udp and icmp, ports and ICMPv6 types, and are applied with ipv6 traffic-filter. Entries are numbered 10, 20, …; sequence N puts one where you want it. Every list ends with the implicit permit icmp any any nd-na, permit icmp any any nd-ns and deny ipv6 any any, which IOS does not print. log sends %IPV6_ACL-6-ACCESSLOGP messages.

Router
Under ipv6 access-list GUEST-IN
permit tcp 2001:db8:20::/64 host 2001:db8:100::10 eq wwwAn entry: protocol, source prefix, destination and port.
permit icmp 2001:db8:20::/64 any echo-requestICMPv6 by type (echo-request, echo-reply, nd-ns, nd-na, router-advertisement…).
sequence 5 deny tcp any host 2001:db8:100::10 eq 22 logAn entry at sequence 5, ahead of the others, logged.
no sequence 5Removes one entry.
Under interface Gi0/2
ipv6 traffic-filter GUEST-IN inFilters the IPv6 packets entering the interface (out: leaving it).
In privileged EXEC
show ipv6 access-listEvery IPv6 list with its matches and sequence numbers.
show ipv6 access-list GUEST-INOne list.
clear ipv6 access-listZeroes the match counters.

Port security

Switch (2960)
Under interface Fa0/2
switchport mode accessPort security needs an access (or trunk) port, not a dynamic one.
switchport port-securityTurns it on: one MAC address by default.
switchport port-security maximum 2Up to 2 addresses.
switchport port-security mac-address stickyLearns the addresses and writes them into the running configuration.
switchport port-security violation restrictDrops and counts other addresses (protect drops quietly; shutdown, the default, err-disables the port).
In privileged EXEC
show port-securityEach secured port, its maximum, its count and its violations.
show port-security interface Fa0/2One port in detail, with the last source address.
show port-security addressThe secure addresses learnt.

DHCP snooping and dynamic ARP inspection

With snooping on, DHCP offers are accepted only from trusted ports, and the switch keeps a binding table of who got which address. Dynamic ARP inspection checks ARP replies against that table, so the attacker laptop's arpspoof is dropped and logged.

Switch (2960)
In global configuration
ip dhcp snoopingTurns snooping on.
ip dhcp snooping vlan 10In VLAN 10.
no ip dhcp snooping information optionStops adding option 82, which many DHCP servers refuse from a switch that isn't a relay.
Under interface Gi0/1
ip dhcp snooping trustThe port towards the real DHCP server.
Under interface Fa0/2
ip dhcp snooping limit rate 10Err-disables a port that sends more than 10 DHCP messages a second.
In global configuration
ip arp inspection vlan 10Checks ARP in VLAN 10.
Under interface Gi0/1
ip arp inspection trustTrusts ARP on the uplink.
In privileged EXEC
show ip dhcp snoopingSnooping's VLANs and trusted ports.
show ip dhcp snooping bindingThe bindings: MAC, address, VLAN and port.
show ip arp inspection statisticsARP packets forwarded and dropped, per VLAN.

Storm control and RA guard

Storm control measures the broadcast, multicast or unicast traffic a port receives, in percent of its bandwidth. Above the rising level the switch drops that traffic and logs %STORM_CONTROL-3-FILTERED, and forwards it again under the falling level; with action shutdown the port is err-disabled instead. RA guard drops IPv6 router advertisements that enter a port whose policy says a host is there, so a rogue router can't hand out a prefix and become the clients' gateway.

Switch (2960)
Under interface Fa0/3
storm-control broadcast level 5.00 3.00Filters broadcasts above 5% of the bandwidth, until they fall under 3% (multicast and unicast work the same way).
storm-control action shutdownErr-disables the port on a storm instead of filtering (trap filters and sends a trap).
In privileged EXEC
show storm-controlEach port's state (Forwarding, Blocking, Link Down), levels and current rate (show storm-control fa0/3 multicast for one port and kind).
In global configuration
ipv6 nd raguard policy HOSTSCreates an RA guard policy and enters it.
Under ipv6 nd raguard policy HOSTS
device-role hostRouter advertisements arriving on its ports are dropped (router lets them in, for the port towards the real router).
Under interface Fa0/1
ipv6 nd raguard attach-policy HOSTSAttaches the policy to the port.
In privileged EXEC
show ipv6 nd raguard policy HOSTSThe policy's role and the ports it's attached to.

AAA with TACACS+ and RADIUS

Logins go to the lab's AAA server, which answers from its own users. A method list falls back to the next method only when the server can't be reached (an ERROR), not when it rejects the user, as in IOS.

Router
In global configuration
aaa new-modelTurns AAA on. From now on, lines without a method list use the default one.
Under tacacs server TAC1
address ipv4 10.0.99.20The TACACS+ server.
key Tac123The shared key.
Under radius server RAD1
address ipv4 10.0.99.21 auth-port 1812 acct-port 1813A RADIUS server.
key Rad123Its key.
In global configuration
aaa authentication login default group tacacs+ localLogins ask TACACS+ first, and the local users if it can't be reached.
aaa authentication login CONSOLE localA named list.
aaa authorization exec default group tacacs+ localThe server decides the privilege level.
aaa accounting exec default start-stop group tacacs+Records each session's start and end.
Under line console 0
login authentication CONSOLEThe console uses the named list.
In global configuration
ip tacacs source-interface Loopback0TACACS+ requests leave from the loopback's address. The server only answers devices it knows by their source address.
ip radius source-interface Loopback0The same for RADIUS.
In privileged EXEC
show aaa serversEach server, its state and its counters.
test aaa group tacacs+ admin Cisco123 legacyTries a login against the servers.

Control-plane policing (CoPP)

Router
Under ip access-list extended ICMP-IN
permit icmp any anyWhat the class matches.
Under class-map match-all COPP-ICMP
match access-group name ICMP-INA class for that traffic.
Under policy-map COPP > class COPP-ICMP
police 8000 conform-action transmit exceed-action dropLets 8 kb/s through and drops the rest.
Under control-plane
service-policy input COPPApplies it to traffic sent to the router itself.
In privileged EXEC
show policy-map control-planeConformed and exceeded packets, per class.

IPsec for GRE and DMVPN

tunnel protection ipsec profile sends a tunnel's GRE packets inside IPsec (IKEv1 with a pre-shared key). Both ends need protection, an ISAKMP policy in common (encryption, hash, authentication and DH group), the same key for each other's address and a transform set in common. show crypto isakmp sa shows where a failure stops: MM_NO_STATE (no policy or key), MM_KEY_EXCH (the keys differ), or QM_IDLE with no IPsec SAs (no transform set in common).

Router
In global configuration
crypto isakmp policy 10An IKE phase 1 policy; the lowest number is offered first.
Under crypto isakmp policy 10
encryption aes 256The cipher (des by default; 3des, aes, aes 192, aes 256). encr is the short form.
hash sha256The hash (sha by default; md5, sha256, sha384, sha512).
authentication pre-sharePre-shared keys. The default, rsa-sig, needs certificates.
group 14The Diffie-Hellman group (1 by default).
In global configuration
crypto isakmp key DMVPN-psk address 0.0.0.0The pre-shared key for any peer (a hub's spokes are not known in advance), or give one address.
crypto ipsec transform-set TS esp-aes 256 esp-sha256-hmacWhat protects the data: ESP encryption and integrity.
Under crypto ipsec transform-set TS esp-aes 256 esp-sha256-hmac
mode transportTransport mode: GRE already adds an outer header (tunnel is the default).
In global configuration
crypto ipsec profile DMVPNA profile that a tunnel interface applies.
Under crypto ipsec profile DMVPN
set transform-set TSThe transform sets it offers.
Under interface Tunnel0
tunnel protection ipsec profile DMVPNProtects the tunnel's GRE packets.
In privileged EXEC
show crypto isakmp saEach IKE SA: destination, source and state (QM_IDLE when up).
show crypto sessionEach peer's session status (UP-ACTIVE, UP-IDLE, DOWN-NEGOTIATING), its IKE SA and its IPsec flow.
show crypto isakmp policyThe configured policies, then the default protection suite.
show crypto ipsec transform-setEach transform set and its mode.