CCNA 200-301 BOOTCAMP · CHAPTER 13

NAT, HSRP, Layer 2 security and IPv6

How to give the LAN Internet access with NAT overload, keep the gateway alive with HSRP, harden the LAN with DHCP snooping and DAI, and take the first steps in IPv6 with link-local and SLAAC.

20 min readVideos: Day 2, part 5 (7 videos)Level: intermediate4.0 IP Services

From point A to point B

Point A: You can configure VLANs, trunks and OSPF, but your network has a single gateway that, if it fails, leaves the whole VLAN without an exit; the switches accept any DHCP server and any ARP, and IPv6 still feels distant. Point B: You will be able to build a redundant gateway with HSRP and test the failover, limit trunks to the VLANs they need, configure and troubleshoot NAT overload with an ACL, enable DHCP snooping, DAI and storm control, and turn on IPv6 on a LAN with link-local, EUI-64 and SLAAC.

This chapter follows the closing lab of day 2 on a network with two gateways. The topics are still on the CCNA 200-301 v1.1 exam (current until February 2, 2027), spread across several domains: FHRP under IP Connectivity, NAT under IP Services, DHCP snooping and DAI under Security Fundamentals, and IPv6 under Network Fundamentals; there are no relevant domain changes from v1.0. The public addresses of the original lab are replaced here by documentation ranges (203.0.113.0/24 and 2001:db8::/32).

HSRP: a virtual gateway that stays up

Every host in a VLAN is configured with a single default gateway. If that router fails, the host is cut off even when a healthy router sits next to it. A First Hop Redundancy Protocol (FHRP) fixes this: two or more routers share a virtual IP and a virtual MAC, and the hosts point to that IP instead of to one specific router. In the lab, Gateway 1 (192.168.1.1) and Gateway 2 (192.168.1.2) share the virtual IP 192.168.1.55.

HSRP (Hot Standby Router Protocol) is Cisco's implementation. Alternatives exist: VRRP (open standard, RFC 5798) and GLBP (Cisco, which also load-balances). In an HSRP group one router is Active (it forwards traffic and answers ARP for the virtual IP), another is Standby (it watches and takes over when the active router stops sending hellos) and any others stay in Listen.

A host's path with HSRPA host sends to the virtual IP; the switch delivers it to the active router, which exits towards the Internet; the standby router waits.Host VLAN 1gateway 192.168.1.55Switchtrunk, VLAN 1Gateway 1Active, priority 200Edge / ISPNAT overload

Gateway 2 (Standby, priority 150) listens on the same segment and takes over the virtual IP if Gateway 1 fails.

ParameterDefaultIn the lab
Priority100200 (Gateway 1) and 150 (Gateway 2)
PreemptDisabledEnabled
Hello / Hold3 s / 10 s3 s / 10 s
Version 1Virtual MAC 0000.0C07.ACxx, multicast 224.0.0.2xx = group number in hexadecimal
Version 2Virtual MAC 0000.0C9F.Fxxx, multicast 224.0.0.102Needed for groups above 255
! Gateway 1
interface FastEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 standby 1 ip 192.168.1.55
 standby 1 priority 200
 standby 1 preempt
 no shutdown
!
! Gateway 2
interface FastEthernet0/0
 ip address 192.168.1.2 255.255.255.0
 standby 1 ip 192.168.1.55
 standby 1 priority 150
 standby 1 preempt
 no shutdown

HSRP group 1 configuration on both routers (the virtual IP must be in the same subnet)

Gateway1# show standby brief
                     P indicates configured to preempt.
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Fa0/0       1    200 P Active  local           192.168.1.2     192.168.1.55

Typical show standby brief output on the active router

The P shows that the router has preempt configured. For the host only one thing changes: its gateway becomes 192.168.1.55. A traceroute will still show the physical IP of the active router as the first hop.

Failover test. On Gateway 1 run shutdown on FastEthernet0/0: Gateway 2 becomes Active when the hold time expires (10 s by default) and the host's traceroute now exits through 192.168.1.2 without touching the host configuration. After no shutdown, because Gateway 1 has the higher priority and preempt, it takes the Active role back. NAT translation state is not synchronized between routers, so sessions open during the switch restart.

Exam. preempt is NOT enabled by default: without it, a recovered router does not regain the Active role even with a higher priority. The highest priority wins (default 100); on a tie, the highest IP. Hosts must use the virtual IP as their gateway; if they still point to 192.168.1.1 or .2, there is no redundancy.

Trunks: only the VLANs that are needed

HSRP needs both routers in the same broadcast domain, so Gateway 2 connects to the switch through a trunk port. An 802.1Q trunk carries every VLAN by default that exists in the switch's database: create VLAN 50 and it starts crossing all trunks with no action from you. For a router that only takes part in VLAN 1, that is unnecessary traffic and a larger attack surface.

interface FastEthernet0/11
 description Troncal a Gateway 2 (HSRP VLAN 1)
 switchport mode trunk
 switchport nonegotiate
 switchport trunk allowed vlan remove 10-13
!
Switch# show interface trunk
Port    Mode  Encapsulation  Status    Native vlan
Fa0/11  on    802.1q         trunking  1
Port    Vlans allowed on trunk
Fa0/11  1-9,14-4094
Port    Vlans allowed and active in management domain
Fa0/11  1,100
Port    Vlans in spanning tree forwarding state and not pruned
Fa0/11  1,100

Restricted trunk: VLANs 10 to 13 are removed from the allowed list

  • switchport mode trunk fixes trunk mode; switchport nonegotiate turns DTP off, so the port neither negotiates nor accepts a negotiated trunk (it only works with a fixed mode, not with dynamic).
  • allowed vlan remove 10-13 takes VLANs out of the list; add appends and except allows all but the ones given. Without add or remove, allowed vlan 1,100 replaces the whole list. Lists use commas and hyphens, no spaces.
  • show interface trunk shows four lists: allowed, allowed and active (they exist in the database), and in STP forwarding. A VLAN missing from the last one is not passing traffic on that port.

This is manual (static) pruning: you decide which VLANs cross each link. It is different from VTP pruning, which is automatic and only works inside a VTP domain (enabled with vtp pruning on the server). On the exam, if the policy says a link must carry only VLAN 1 and the port allows more, the configuration is wrong: the excess is a security gap.

NAT overload with a named ACL and Internet exit

Internal networks use private addresses (RFC 1918) that are not routed on the Internet. NAT overload, also called PAT, translates many inside addresses into one public address, telling each conversation apart by its source port. It is what lets a whole VLAN browse using the IP of the interface facing the ISP (RFC 3022).

TermMeaningExample
Inside localPrivate IP of the inside host192.168.1.10
Inside globalInside host IP as seen from the Internet203.0.113.9
Outside globalReal IP of the destination198.51.100.20

It takes four steps: mark the inside interface, mark the outside one, define with an ACL which sources get translated, and bind that ACL to the exit interface with overload. Here the ACL does not filter: it only selects which traffic enters NAT. Because it is a standard ACL (even when named), it can only match the source IP, never protocols or ports; that is why permit ip ... is invalid and you write permit 192.168.1.0 0.0.0.255 with a wildcard mask.

interface FastEthernet0/0
 description Conexion al switch (troncal HSRP)
 ip address 192.168.1.2 255.255.255.0
 ip nat inside
!
interface FastEthernet0/1
 description Enlace a ISP Edge
 ip address 203.0.113.9 255.255.255.252
 ip nat outside
 no shutdown
!
ip access-list standard ACL_PAT
 permit 192.168.1.0 0.0.0.255
 permit 192.168.10.0 0.0.0.255
!
ip nat inside source list ACL_PAT interface FastEthernet0/1 overload
ip route 0.0.0.0 0.0.0.0 203.0.113.10

Gateway 2: NAT overload with a named standard ACL and default route to the ISP

A good field practice: always put a description on every interface. SNMP monitoring tools read that text and show "Link to ISP Edge" instead of an interface number, which anyone on the team can understand.

OSPF and the default route. The gateways advertise their inside networks through OSPF and the 0.0.0.0/0 route is handed to the other routers with default-information originate; the ISP link is declared passive so it does not form an adjacency with the provider. Each gateway has its own NAT, so if one fails the other still provides the exit.

router ospf 1
 network 192.168.1.0 0.0.0.255 area 0
 passive-interface FastEthernet0/1
 default-information originate

OSPF on the gateway that exits to the Internet

Default route and NAT/OSPF troubleshooting

Before troubleshooting, clear up one concept: a router does not invent paths. If the destination matches no prefix in the table, it drops the packet (and may send an ICMP "destination unreachable"). The default route 0.0.0.0/0 is a wildcard with a /0 mask: it matches everything, but being the least specific it is used only when no other route fits (longest-prefix-match rule). In the table it shows as the Gateway of last resort with S* (static) or O*E2 (learned through OSPF).

DestinationMatching routeResult
192.168.10.5192.168.10.0/24 (OSPF)Forwarded by that route
198.51.100.20Only 0.0.0.0/0Sent to the gateway of last resort

When Internet access does not work, always follow the same order, from physical to logical:

  1. OSPF neighbors and routes. show ip ospf neighbor must show the neighbor in FULL (with a DR or BDR on multi-access segments) and show ip route must contain the O routes and the default route. If routes vanish, check the adjacency before touching anything; clear ip ospf process is the last resort.
  2. Ping hop by hop. Host to gateway, gateway to the ISP interface, ISP to the destination. If the ping reaches the ISP but no further, the problem is NAT or the return path.
  3. inside and outside interfaces. Check with show ip nat statistics or show run that the LAN is inside and the ISP link is outside. Swapping them or forgetting one prevents any translation.
  4. The ACL matches the traffic. show ip access-lists shows match counters; if they do not grow, the ACL is not catching the source network (wrong wildcard or subnet).
  5. The NAT command uses the right ACL. A real lab case: two ACLs had identical content and the NAT rule pointed to a different one than expected. ACL names are case-sensitive. Fix it with no ip nat inside source list ... and write the rule again.
  6. Translation table. show ip nat translations must list entries when you generate traffic. If there is an entry but no reply, the packet left correctly translated and the fault is after that: return route, the server's gateway, or a badly routed outside subnet.
show ip ospf neighbor
show ip route
show ip access-lists
show ip nat statistics
show ip nat translations
clear ip nat translation *
debug ip nat

Diagnostic commands, in order of use (debug only in the lab or with care)

Exam. The exam asks whether a packet is forwarded by the default route: it is when no more specific prefix exists in the table and the router has a 0.0.0.0/0 route configured. And remember: the host must use the right gateway (the virtual IP when HSRP is in place), otherwise the packet never even reaches NAT.

Layer 2 security: DHCP snooping, DAI and storm control

A switch forwards what it receives without asking whether it is legitimate. Four typical LAN attacks each have a specific defense on the switch:

AttackWhat it doesDefense
Rogue DHCP serverHands out the attacker's gateway or DNS (man-in-the-middle)DHCP snooping with trusted ports
DHCP starvationExhausts the pool with thousands of DISCOVERs from fake MACsRate limit and port security
ARP spoofingSends forged ARP replies to impersonate the gatewayDynamic ARP Inspection
Broadcast stormSaturation by excess traffic or loopsStorm control

DHCP snooping splits ports into two classes. All start untrusted: client DISCOVER and REQUEST messages are accepted, but server replies (OFFER, ACK, NAK) are dropped. Only trusted ports, those leading toward the legitimate DHCP server (including uplink trunks and port-channels), may deliver those replies. The switch also builds the binding table with every lease: MAC, IP, lease time, VLAN and port.

ip dhcp snooping
ip dhcp snooping vlan 1
!
interface FastEthernet0/1
 description Hacia el servidor DHCP
 ip dhcp snooping trust
 ip dhcp snooping limit rate 150
!
interface range FastEthernet0/10 - 19
 ip dhcp snooping limit rate 100
!
show ip dhcp snooping
show ip dhcp snooping binding

Enable snooping on VLAN 1, trust the server port and limit messages per second elsewhere

MacAddress          IpAddress       Lease(sec)  Type           VLAN  Interface
00:50:0F:5E:4C:21  192.168.1.152   86400       dhcp-snooping  1     FastEthernet0/1

Typical binding table row

  • If an untrusted port exceeds the rate limit, the switch puts it in err-disabled; fix the cause and reactivate with shutdown then no shutdown.
  • Trust is set on the physical interface or on the port-channel, not on a VLAN interface (SVI). If the server sits behind an EtherChannel or several switches, mark as trusted every link the replies travel through.
  • If clients keep a 169.254.x.x address, check: is the port toward the server trusted?, are the uplinks too?, is the server port up (not shutdown or err-disabled)?, is the DHCP pool enabled on the server? In class the server only handed out addresses after being plugged into a direct access port with trust.

Dynamic ARP Inspection (DAI) relies on that table: it intercepts every ARP packet received on an untrusted port and lets it through only if the MAC-IP pair matches a snooping binding. Hosts with a static IP have no binding, so they need a separate ARP ACL. Nothing is inspected on a trusted port. With validate you add consistency checks between the Ethernet header and the ARP message body.

ip arp inspection vlan 1
ip arp inspection validate src-mac dst-mac ip
!
interface FastEthernet0/1
 ip arp inspection trust
!
show ip arp inspection vlan 1
show ip arp inspection statistics
!
interface FastEthernet0/12
 storm-control broadcast level 50
 storm-control action shutdown

DAI on VLAN 1 with a trusted port and broadcast storm control on an access port

Storm control measures the broadcast, multicast or unknown-unicast traffic entering a port and, when it crosses the threshold (level, a percentage of bandwidth, or in pps/bps), drops the excess or, with action shutdown, puts the port in err-disabled. It is set per traffic type and does not depend on DHCP or ARP. Know that it exists and what problem it solves; the CCNA blueprint centers on DHCP snooping, DAI and port security.

Watch out. Recommended order: DHCP snooping first (it fills the table), then DAI (it consumes it). If you enable DAI before having bindings or without trusting the uplinks, the switch drops legitimate ARP and hosts lose connectivity.

SLAAC, multicast and NDP messages

There are three ways to give a host a global address: configure it by hand, use stateful DHCPv6 (a server tracks the leases) or SLAAC (Stateless Address Autoconfiguration, RFC 4862). With SLAAC the router only announces the prefix and the host builds the full address; nobody keeps a record of who has what, hence "stateless".

SLAAC sequenceThe host creates its link-local, asks for a router advertisement, receives the prefix, builds its global address and checks that it is not duplicated.Link-local + DADown FE80::/64RS to routerFF02::2RA with prefixFF02::1Global addressprefix + EUI-64DADNS to solicited-node

A Router Solicitation (RS) goes to all routers; the Router Advertisement (RA) answers to all nodes with the prefix.

ipv6 unicast-routing
!
interface FastEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 ipv6 address 2001:DB8:ACAD:1::1/64
 no shutdown
!
show ipv6 interface brief
show ipv6 interface FastEthernet0/0
show ipv6 route

Router as the IPv6 gateway of VLAN 1 (dual stack): without ipv6 unicast-routing it sends no advertisements

Once ipv6 unicast-routing is on and the prefix is set, the router starts sending RAs and hosts set to automatic get an address like 2001:DB8:ACAD:1:202:17FF:FEAB:CDEF. A router can also be a SLAAC client on an interface with ipv6 address autoconfig. A practical detail: SLAAC alone does not provide DNS servers; it is completed with stateless DHCPv6 (ipv6 nd other-config-flag) or the RDNSS option in the RA. Modern operating systems often prefer random identifiers instead of EUI-64 for privacy (RFC 4941).

IPv6 has no broadcast and no ARP: everything is done with ICMPv6 and multicast. The Neighbor Discovery Protocol (NDP, RFC 4861) replaces ARP and adds router discovery:

MessageICMPv6 typePurpose
Router Solicitation (RS)133The host asks for an RA without waiting for the next one (to FF02::2)
Router Advertisement (RA)134The router announces prefix and parameters (to FF02::1 or the requester)
Neighbor Solicitation (NS)135Resolve the MAC of an IP and detect duplicates (DAD)
Neighbor Advertisement (NA)136Reply to an NS with the MAC
Multicast addressGroup
FF02::1All IPv6 nodes on the link (every interface joins)
FF02::2All routers (joined when ipv6 unicast-routing is enabled)
FF02::1:FFxx:xxxxSolicited-node: FF02::1:FF + the last 24 bits of the unicast address

Example: the address FE80::202:17FF:FEAB:CDEF ends in AB:CDEF, so its solicited-node group is FF02::1:FFAB:CDEF, and the same host's global address shares those last 24 bits and therefore the same group. To resolve an IP, the host sends an NS to that group instead of to the whole network, and only devices with those 24 bits process it. To debug in the lab, debug ipv6 nd helps (carefully outside the lab).

Class videos

Recorded live in 2021; Spanish audio with Spanish, English, French and Portuguese subtitles. When you play it, the video loads from YouTube. Day 2 playlist on YouTube

Test what you learned

1. Gateway 1 (priority 200) and Gateway 2 (priority 150) run HSRP without preempt. Gateway 1 goes down and comes back up. Which router is Active afterwards?

Answer. Answer. Gateway 2. When Gateway 1 failed, Gateway 2 became Active; without preempt, Gateway 1 does not take it back even with a higher priority. With standby 1 preempt on Gateway 1 it would regain the role.

2. Policy says port Fa0/11 must carry only VLAN 1, but show interface trunk lists 1-4094. Which command fixes it and why does it matter?

Answer. Answer. switchport trunk allowed vlan 1 (without add or remove it replaces the list). By default the trunk carries every VLAN; the excess is unnecessary traffic and a security gap. It is manual pruning, different from VTP pruning.

3. Hosts on 192.168.1.0/24 cannot reach the Internet. show ip nat translations is empty and show ip access-lists shows ACL ACL_PAT with no matches. Which two things do you check first?

Answer. Answer. (1) That the ip nat inside source list rule uses exactly that ACL's name (case-sensitive) and that the ACL includes the subnet with the right wildcard. (2) That the interfaces are marked ip nat inside (LAN) and ip nat outside (ISP). Without them no traffic matches the ACL.

4. You enable DHCP snooping on VLAN 1 and clients stop getting an IP even though the server works. The server is behind a port-channel. What is the most likely cause and the fix?

Answer. Answer. All ports are untrusted by default and drop server OFFER and ACK. Set ip dhcp snooping trust on every link the reply travels through (the server port, uplink trunks and the port-channel). Afterwards DAI can use the now-filled binding table.

5. An interface has MAC 0002.17AB.CDEF. What are its EUI-64 link-local address and its solicited-node group?

Answer. Answer. FE80::202:17FF:FEAB:CDEF: FFFE is inserted in the middle of the MAC and the seventh bit is flipped (00 becomes 02). The solicited-node group is FF02::1:FFAB:CDEF, i.e. FF02::1:FF plus the last 24 bits.

Key takeaways

  • HSRP shares a virtual IP and MAC between routers; hosts use the virtual IP as their gateway and failover is automatic.
  • The highest priority wins (default 100), and without preempt a recovered router does not regain the Active role.
  • A trunk carries every VLAN by default; limit it with switchport trunk allowed vlan and disable DTP with switchport nonegotiate.
  • NAT overload needs inside/outside interfaces, an ACL that selects the sources and ip nat inside source list ... interface ... overload; a standard ACL only sees the source IP.
  • Troubleshoot from physical to logical: OSPF neighbors, default route, NAT interfaces, ACL counters and show ip nat translations.
  • DHCP snooping blocks rogue servers with trusted ports and builds the binding table; DAI uses it to stop ARP spoofing; storm control limits broadcast, multicast and unknown unicast.
  • A link-local (FE80::/10) is not routed and every IPv6 interface has one; EUI-64 inserts FFFE into the MAC and flips the seventh bit.
  • SLAAC uses RS and RA (ICMPv6) and requires ipv6 unicast-routing on the router; NDP (NS/NA) replaces ARP using solicited-node multicast.

Official resources

Source and credits. Chapter written from the CCNA 200-301 Bootcamp that Jesús Espinoza recorded live in 2021, on the v1.0 syllabus; the current exam is v1.1. Text drafted with AI assistance and reviewed; original diagrams by The House of Routing. Technical data and configuration were checked against Cisco's official documentation, IETF RFCs and IEEE standards.

Navigate