IP and subnetting, animated

IP addressing and subnetting: where the network ends and the host begins

Every mechanism has a step-by-step animation, the configuration explained line by line and the exam notes. Where a parameter changes the outcome, you get a simulator where you change it yourself.

  1. Host A has 192.168.10.37 with the mask 255.255.255.128, written /25: the first 25 bits name the network, the last 7 name the host. AND-ing the address with the mask gives Host A's own subnet, 192.168.10.0/25.address 192.168.10.37 · mask 255.255.255.128 = /25 · network 192.168.10.0/25
  2. Host A wants to reach 192.168.10.150. It applies its own mask to the destination and gets 192.168.10.128, a different subnet. So Host A does not ARP for Host B: it ARPs for its default gateway, R1 (192.168.10.1), unless R1 is already in its ARP cache, and sends the frame to R1's MAC. The IP destination stays 192.168.10.150.destination 192.168.10.150 · AND /25 192.168.10.128 ≠ 192.168.10.0 · ARP for 192.168.10.1, the gateway (not Host B) · IP destination unchanged: 192.168.10.150
  3. R1 has a connected route for every subnet, and each one has the size it needs: Sales is a /25 (126 hosts), Engineering a /26 (62 hosts), management a /27 and the WAN link a /30. That is VLSM. R1 forwards the packet out Gi0/1 to Host B.
  4. Host A now opens a web page on 203.0.113.10. Its source, 192.168.10.37, is an RFC 1918 private address that no ISP routes, so R1 translates it to its public address 198.51.100.2 (NAT) before the packet leaves.source 192.168.10.37 → 198.51.100.2 · destination 203.0.113.10 · why private addresses are not routed on the Internet
  5. The same host also speaks IPv6: prefix 2001:db8:acad:10::/64 on its LAN, an interface ID built from its MAC (EUI-64) and a link-local fe80:: address for the local link. 128 bits, a /64 per LAN, no broadcast and no NAT: the packet keeps its source end to end.prefix 2001:db8:acad:10::/64 · interface ID 250:56ff:fea1:1b01 (EUI-64) · NAT none
IPv4 packetsIPv6 packetsARP, DHCP, NDP and other control messagesrouting updates and summariespackets after NATICMP and ICMPv6 errorsdropped or filtered trafficnetwork bitssubnet (borrowed) bitshost bits dropped packet or link down

TL;DR

An IP address has two parts: the network, which routers use to find the right subnet, and the host, which identifies one device inside it. The mask, or the prefix length /n, says where the line between them falls. In IPv4 (32 bits), the first and the last address of every subnet are reserved for the network and the broadcast, so a /n gives 232−n − 2 usable hosts; the exceptions are /31 on point-to-point links and /32 for a single host. The classes A to E are history, but their ranges still explain the default masks and the multicast (224.0.0.0/4) and reserved (240.0.0.0/4) blocks. The RFC 1918 private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are reused in every company and need NAT to reach the Internet; 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 0.0.0.0/8, 255.255.255.255 and the documentation blocks are exceptions you must recognize on sight. Subnetting borrows host bits to make more, smaller subnets; VLSM gives every subnet the size it needs, largest first; summarization does the reverse for routing tables. IPv6 (128 bits) has no broadcast and no need for NAT: a /48 or /56 per site, a /64 per LAN, /127 on point-to-point links, a link-local fe80::/10 address on every interface, unique local fd00::/8 for private use and global unicast from 2000::/3.

How to read the notes: red = critical for the exam, green = theory, blue = numbers, yellow = pitfalls, cyan = differences between platforms (NX-OS, IOS-XE, IOS-XR) and RFCs. In the animations, the configuration lines used at the current step are highlighted automatically; the ← → arrows change the step while the animation is focused. Every address on this page comes from the documentation ranges (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24, 2001:db8::/32) or from the private ranges, so you can copy the examples into a lab safely.

The analogy, in short

Think of a city with a land registry. Every address has a street part and a house-number part, and the mask tells you how much of the address is the street. On every street the first plot holds the street sign and the last one holds the town crier, so neither can be a home. Surveyors cut the land into streets of different sizes as needed. Inside office buildings, room numbers repeat everywhere, and the reception desk swaps them for the building's street address when a letter leaves.

The model holds up to §10. From §11 on (IPv6), the city is rebuilt on a planet-sized registry, and the analogy stretches; see the full analogy and its limits in §18.

What an IP address is: network part, host part and binary

CCNA 200-301 v1.1

TL;DRAn IPv4 address is a 32-bit number, written as four octets in dotted decimal: 192.168.10.37 is 11000000.10101000.00001010.00100101. The mask splits it into a network part, which routers forward on (one route per network, not one per host), and a host part, which names one interface; a host ANDs every destination with its own mask and either delivers locally or hands the packet to its default gateway.

The terms, in short
Octet
A group of 8 bits, written as one decimal number from 0 to 255; an IPv4 address has four of them (192 · 168 · 10 · 37).
Dotted decimal
The usual way to write the 32 bits: the four octets in decimal, separated by dots, such as 192.168.10.37.
Bit and place value
Each bit of an octet is worth 128, 64, 32, 16, 8, 4, 2 or 1 from left to right; 37 = 32 + 4 + 1 = 00100101.
Network part
The leading bits shared by every address of one network: the first 25 bits of Host A, i.e. 192.168.10.0/25. Routers forward on it.
Host part
The remaining bits, which pick one interface on that network: the last 7 bits of Host A, value 37.
Mask and prefix
The mask marks the network part with 1s (255.255.255.128); the prefix /25 is the same thing written as the number of 1s.
Default gateway
The router address a host sends to for every destination outside its own network: 192.168.10.1 (R1 Gi0/0) for Host A.

1.1The step-by-step animation

  1. Host A's address, 192.168.10.37, is one 32-bit number written as four decimal octets separated by dots. Every bit of an octet has a place value, 128 64 32 16 8 4 2 1 from left to right, and the octet is the sum of the places that hold a 1. To convert 37, take each place that still fits and subtract it: 32, then 4, then 1, so 37 = 00100101.dotted decimal 192.168.10.37 · binary 11000000.10101000.00001010.00100101 · size 4 octets × 8 bits = 32 bits
  2. Going back is the same table read the other way: add up the place values of the 1 bits. Host A's mask is 25 ones followed by 7 zeros. 11111111 is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255, and 10000000 is 128, so the mask is 255.255.255.128. Counting the ones gives its short form, /25 (§3).binary 11111111.11111111.11111111.10000000 · dotted decimal 255.255.255.128 · prefix /25 = 25 ones
  3. Lay the mask under the address. Where the mask has 1s, the address bits are the network part (25 bits, cyan); where it has 0s, they are the host part (7 bits, green). Keeping the network bits and zeroing the host bits, a bitwise AND with the mask, gives the network 192.168.10.0/25; the host bits alone, 0100101, say that Host A is host number 37 on it. §3 and §4 do the full arithmetic.network part first 25 bits → 192.168.10.0/25 · host part last 7 bits → 37 · AND 1 AND 1 = 1, anything AND 0 = 0
  4. Host A wants to reach 192.168.10.100. It ANDs the destination with its own mask and gets 192.168.10.0, its own network: the destination is on the local link. So Host A sends an ARP request for 192.168.10.100 itself and delivers the frame straight through SW1, with no router involved.destination 192.168.10.100 · AND /25 192.168.10.0 = my network · ARP for 192.168.10.100, the destination itself
  5. Now the destination is 192.168.10.150. The same AND gives 192.168.10.128, not 192.168.10.0: Host B is on another network, even though both addresses start with 192.168.10. So Host A ARPs for its default gateway, 192.168.10.1, and sends the frame to R1's MAC; the IP destination stays 192.168.10.150, and R1 forwards the packet out Gi0/1.destination 192.168.10.150 · AND /25 192.168.10.128 ≠ 192.168.10.0 · ARP for 192.168.10.1, the gateway · IP destination unchanged: 192.168.10.150
  6. This is why the split exists: R1 keeps one entry per network, not one per host. 192.168.10.0/25 covers all 126 usable Sales addresses, Host A included, 192.168.10.128/26 covers 62 more, and a single default route covers the whole Internet. Asked about 192.168.10.37, R1 answers with the network that contains it, Routing entry for 192.168.10.0/25. The Internet works the same way: about a million prefixes instead of four billion addresses.lookup 192.168.10.37 · match 192.168.10.0/25, connected, Gi0/0 · entries one per network, whatever the number of hosts

1.2Simulator: an address in decimal, binary and hex

Type an address in dotted decimal or as 32 bits (with or without dots)

Every octet is converted on its own with the place values 128 64 32 16 8 4 2 1. Pick a prefix to see which bits are the network part and which are the host part.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

OctetDecimal1286432168421Sum of the 1sHex
119211000000128 + 64 = 192C0
216810101000128 + 32 + 8 = 168A8
310000010108 + 2 = 100A
4370010010132 + 4 + 1 = 3725
FormValue
Dotted decimal192.168.10.37
Binary, by octet11000000.10101000.00001010.00100101
32 bits in a row11000000101010000000101000100101
Hexadecimal0xC0A80A25
One 32-bit integer3,232,238,117
Network part (/25)1100000010101000000010100 → 192.168.10.0/25
Host part (7 bits)0100101 = host 37
192.168.10.37 = 11000000.10101000.00001010.00100101
  • Octet by octet: 192 = 128+64 → 11000000 · 168 = 128+32+8 → 10101000 · 10 = 8+2 → 00001010 · 37 = 32+4+1 → 00100101.
  • As one number: 3,232,238,117 = 0xC0A80A25; hex is just the same bits in groups of 4 (1100 0000 1010 1000 0000 1010 0010 0101).
  • With /25 the first 25 bits are the network, 192.168.10.0/25; the last 7 bits (0100101) are host number 37 on it. §4 gives the first, last and broadcast addresses.
  • First octet 192 = 11000000, class C (§2); Private-Use, RFC 1918 (§6).

1.3The configuration, line by line

R1 · IOS-XE

1interface GigabitEthernet0/0Sales LAN, VLAN 10: Host A's default gateway lives here.
2 description Sales LAN (VLAN 10)
3 ip address 192.168.10.1 255.255.255.128Address and mask, the mask in dotted decimal. 255.255.255.128 = 25 ones = /25, so Gi0/0 owns 192.168.10.0/25 and R1 installs it as a connected route.
4 no shutdown
5!
6interface GigabitEthernet0/1Engineering LAN, VLAN 20.
7 ip address 192.168.10.129 255.255.255.192/26: another network, so traffic between the two LANs has to cross R1.
8 no shutdown
9!
10interface GigabitEthernet0/4Toward the ISP.
11 ip address 198.51.100.2 255.255.255.248/29 from the ISP (a documentation range in this guide).
12!
13ip route 0.0.0.0 0.0.0.0 198.51.100.1The default route: one entry for every network R1 does not know.
14! ip address 192.168.10.1/25Wrong on IOS and IOS-XE: the /n form is refused with "% Invalid input". It is the NX-OS syntax.

show ip interface Gi0/0

1GigabitEthernet0/0 is up, line protocol is upLayers 1 and 2 are up; an address on a down interface installs no connected route.
2 Internet address is 192.168.10.1/25The address with its prefix: configured as 255.255.255.128, displayed as /25.
3 Broadcast address is 255.255.255.255Not the subnet broadcast (192.168.10.127, §4): it is the address IOS uses for broadcasts it sends itself.
4 Address determined by non-volatile memoryRead from the startup configuration.
5 MTU is 1500 bytes
6 Helper address is not set
7 Directed broadcast forwarding is disabledThe default since IOS 12.0 (§7).
8 Outgoing access list is not set
9 Inbound access list is not set
10 Proxy ARP is enabledOn by default: R1 answers ARP for addresses it routes out another interface, which can hide a wrong host mask (§16).

show ip interface brief

1Interface IP-Address OK? Method Status Protocol
2GigabitEthernet0/0 192.168.10.1 YES NVRAM up upThere is no mask column: brief shows the address only.
3GigabitEthernet0/1 192.168.10.129 YES NVRAM up up
4GigabitEthernet0/2 192.168.10.225 YES NVRAM up upThe point-to-point link to R2 (§8).
5GigabitEthernet0/3 192.168.10.193 YES NVRAM up up
6GigabitEthernet0/4 198.51.100.2 YES NVRAM up upToward the ISP.
7GigabitEthernet0/5 unassigned YES NVRAM administratively down downNo address and shut down: no connected route.

show ip route 192.168.10.37

1Routing entry for 192.168.10.0/25R1 looked up a host and found the network that contains it: there is no entry for .37 itself.
2 Known via "connected", distance 0, metric 0 (connected, via interface)A connected route comes from the interface address and mask; administrative distance 0.
3 Routing Descriptor Blocks:
4 * directly connected, via GigabitEthernet0/0Deliver on Gi0/0: R1 ARPs for 192.168.10.37 there.
5 Route metric is 0, traffic share count is 1

Host A · Windows and Linux

1C:\> ipconfig
2 IPv4 Address. . . . . . . . . . . : 192.168.10.37Windows shows the address…
3 Subnet Mask . . . . . . . . . . . : 255.255.255.128…the mask in dotted decimal…
4 Default Gateway . . . . . . . . . : 192.168.10.1…and the gateway, used for every destination outside 192.168.10.0/25.
5$ ip -4 addr show dev eth0
6 inet 192.168.10.37/25 brd 192.168.10.127 scope global eth0Linux shows /25 and the subnet broadcast it computed from the mask (.127, §4).
7$ ip route
8default via 192.168.10.1 dev eth0Everything that is not local goes to the gateway.
9192.168.10.0/25 dev eth0 proto kernel scope link src 192.168.10.37The local decision in one line: this /25 is on the link, so the host ARPs for the destination itself.

The outputs are typical for IOS-XE, Windows and Linux; details may vary between versions.

1.4Remember

Critical for the exam
An IPv4 address is 32 bits, written as 4 octets in dotted decimal; each octet is 0–255 because 8 bits give 28 = 256 values. The place values are 128 64 32 16 8 4 2 1: every conversion and every subnetting question starts from them.
Theory
A host decides "local or remote" by ANDing the destination with its own mask. Same network: it ARPs for the destination. Different network: it ARPs for the default gateway and sends the frame to the gateway's MAC, with the IP destination unchanged. Routers then look up the destination network, not the individual host.
Pitfall
The sender never knows the destination's mask: Host A always uses its own. With a wrong /24 mask, Host A treats 192.168.10.150 as local and ARPs for it; it only works because R1 answers with proxy ARP (on by default on IOS), and it breaks as soon as no ip proxy-arp is configured (§16).
Numbers
232 = 4,294,967,296 addresses. 11111111 = 255, 10000000 = 128. 192.168.10.37 = 0xC0A80A25 = 3,232,238,117 as one integer. A /25 holds 128 addresses, 126 of them usable hosts (§4). IPv4 itself is defined in RFC 791 (1981).
Pitfall
show ip interface brief shows no mask at all, and "Broadcast address is 255.255.255.255" in show ip interface is not the subnet broadcast (192.168.10.127). Read the mask from "Internet address is 192.168.10.1/25" or from the running configuration.
Platforms and standards
IOS and IOS-XE take a dotted mask (ip address 192.168.10.1 255.255.255.128), NX-OS takes ip address 192.168.10.1/25, IOS-XR ipv4 address 192.168.10.1 255.255.255.128 (§10). Windows ipconfig prints the dotted mask, Linux ip addr prints /25. IOS 15 and later also install an L /32 route for the router's own address.
Verify withshow ip interface GigabitEthernet0/0show ip interface briefshow ip route 192.168.10.37show running-config interface GigabitEthernet0/0

1.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

What is the octet 172 in binary?

  1. A11001100
  2. B10101100
  3. C10110100
  4. D10101010
Show answer
Answer: B. 172 = 128 + 32 + 8 + 4, so the bits for 128, 32, 8 and 4 are 1: 10101100. 10110100 is 180 (128 + 32 + 16 + 4), the classic slip of putting the 16 in place of the 8; 10101010 is 170 and 11001100 is 204.
CCNACCNA 200-301Q2

A mask is shown in binary as 11111111.11111111.11111111.11100000. What is it in dotted decimal, and what is its prefix length?

  1. A255.255.255.240, /28
  2. B255.255.255.224, /27
  3. C255.255.255.192, /26
  4. D255.255.255.224, /29
Show answer
Answer: B. The last octet 11100000 = 128 + 64 + 32 = 224, and the mask has 8 + 8 + 8 + 3 = 27 ones, so it is 255.255.255.224 = /27. 240 would need four 1s in the last octet (/28); /29 comes from subtracting the three 1s from 32 instead of adding them to 24.
CCNACCNA 200-301Q3

Host A is 192.168.10.37/25 with default gateway 192.168.10.1. It sends its first packet to 192.168.10.150. What does Host A do?

  1. AIt ARPs for 192.168.10.150 directly, because both addresses begin with 192.168.10
  2. BIt ARPs for the gateway 192.168.10.1 and sends the frame to R1's MAC
  3. CIt rewrites the IP destination to 192.168.10.1 so that R1 accepts the packet
  4. DIt drops the packet, because 192.168.10.150 lies outside its own subnet
Show answer
Answer: B. 192.168.10.150 AND 255.255.255.128 = 192.168.10.128, which is not Host A's network 192.168.10.0, so the destination is remote: Host A resolves the gateway's MAC and leaves the IP destination unchanged. Sharing the first three octets means nothing with a /25: the boundary is inside the fourth octet.
CCNACCNA 200-301Q4

In 192.168.10.37/25, how many bits form the host part, and what value do they carry?

  1. A8 bits, value 37
  2. B7 bits, value 37
  3. C7 bits, value 165
  4. D25 bits, value 192.168.10
Show answer
Answer: B. A /25 leaves 32 − 25 = 7 host bits. The last octet 37 = 00100101; its first bit belongs to the network, and the remaining 0100101 = 37. 165 would be 10100101, i.e. the 128 bit counted as host; 8 bits is the /24 reflex.
ProfessionalENARSI 300-410Q5

R1's routing table holds C 192.168.10.0/25 (Gi0/0), C 192.168.10.128/26 (Gi0/1) and S* 0.0.0.0/0 via 198.51.100.1. Host A (192.168.10.37) is up and has been talking through R1. What does show ip route 192.168.10.37 report?

  1. ARouting entry for 192.168.10.37/32, built from the ARP cache
  2. BRouting entry for 0.0.0.0/0, the default via 198.51.100.1
  3. C% Network not in table, since no host route exists for .37
  4. DRouting entry for 192.168.10.0/25, connected via Gi0/0
Show answer
Answer: D. A router stores networks, not hosts: the longest prefix containing 192.168.10.37 is the connected 192.168.10.0/25, and the command prints that entry. ARP entries never become routes in the routing table, and the default route only wins when nothing more specific matches.
ProfessionalENARSI 300-410Q6

Host A (192.168.10.37) is mistakenly configured with mask 255.255.255.0. R1 Gi0/0 is 192.168.10.1/25 with default settings, and Host B (192.168.10.150) sits behind R1 Gi0/1. Host A pings Host B. What happens?

  1. AIt fails: R1 never answers ARP requests for addresses it does not own
  2. BIt works: Host A ARPs for .150 and R1 replies with proxy ARP
  3. CHost A sends the ping to 192.168.10.1, because .150 is in another /25
  4. DSW1 floods the ARP request toward Gi0/1 and Host B answers it directly
Show answer
Answer: B. With /24, Host A believes 192.168.10.150 is local and ARPs for it. Proxy ARP is enabled by default on IOS interfaces, and R1 has a route to 192.168.10.128/26 out another interface, so it replies with its own MAC and the traffic flows. With no ip proxy-arp the same misconfiguration breaks the ping. A host never uses the other side's mask, and the ARP broadcast stops at R1.
CCIECCIE EI v1.1Q7

R1 runs IOS-XE with Gi0/0 = 192.168.10.1/25. What do show ip route 192.168.10.1 and show ip route 192.168.10.37 return?

  1. AThe C route 192.168.10.0/25 for both, since .1 is inside it
  2. B% Subnet not in table for both: connected networks are not routes
  3. CThe L route 192.168.10.1/32, then the C route 192.168.10.0/25
  4. DAn L /32 for both: IOS 15 adds a /32 route per ARP entry too
Show answer
Answer: C. Since IOS 15, every interface address also installs a /32 local route (code L), which is the longest match for the router's own address. Any other host on the LAN, such as .37, only matches the connected /25: ARP entries are never turned into routes in the routing table. The L route is how the router knows a packet is for itself rather than for the LAN.

IPv4 classes A to E: first bits, ranges and default masks

CCNA 200-301 v1.1ENARSI 300-410CCIE EI v1.1

TL;DRThe first bits of the first octet give the class: 0 = A (1–126, /8), 10 = B (128–191, /16), 110 = C (192–223, /24), 1110 = D (multicast) and 1111 = E (reserved). Fixed masks wasted addresses and bloated routing tables, so CIDR replaced the classes in 1993; they survive as default masks, classful network statements, auto-summary and the "is subnetted" headers, and auto-summary can still black-hole a discontiguous network.

The terms, in short
Class
One of five groups, A to E, given by the first bits of the address; for A, B and C it also fixed the mask (/8, /16, /24).
Leading bits
The class pattern at the start of the first octet: 0, 10, 110, 1110 or 1111. 172 = 10101100 starts with 10, so it is class B.
Default (classful) mask
The mask the class implies: 255.0.0.0, 255.255.0.0 or 255.255.255.0. Classes D and E have none.
Major (classful) network
The class network an address belongs to: 172.16.1.10 → 172.16.0.0/16, 10.0.12.1 → 10.0.0.0/8.
Auto-summary
A RIP and EIGRP behaviour: advertise only the major network (172.16.0.0/16) out of an interface that belongs to another major network.
Discontiguous network
A major network split in two by another one, such as 172.16.1.0/24 and 172.16.2.0/24 separated by 10.0.0.0 links.
CIDR
Classless Inter-Domain Routing (RFC 1519 in 1993, now RFC 4632): any prefix length, written /n and carried with every route.

2.1The step-by-step animation

  1. The class of an IPv4 address is written in the first bits of its first octet, so one octet is enough to tell it. A leading 0 means class A, 10 class B, 110 class C, 1110 class D (multicast) and 1111 class E (reserved). Below, both sites use 172.16.x.x, class B, and the core links use 10.x.x.x, class A: keep that in mind, it is what breaks the routing later.0… A · 0–127 · /8 · 10… B · 128–191 · /16 · 110… C · 192–223 · /24 · 1110… / 1111… D multicast · E reserved
  2. Each class fixed where the network part ends: 8 bits for A, 16 for B, 24 for C. Class A is half of the whole address space, cut into only 126 usable networks of 16,777,214 hosts (0 is "this network", 127 is loopback). Class B is a quarter: 16,384 networks of 65,534 hosts. Class C is an eighth: 2,097,152 networks of only 254 hosts. Class D (224–239) carries multicast groups and class E (240–255) is reserved; neither has a default mask.A 126 networks × 16,777,214 hosts · B 16,384 × 65,534 · C 2,097,152 × 254
  3. Fixed sizes did not fit real networks. A company with 300 hosts was too big for a C (254) and got a B, leaving 65,234 addresses unused, so class B was running out by the early 1990s; handing out several Cs instead added one Internet route per C. CIDR (RFC 1519, 1993, now RFC 4632) removed the classes: a prefix carries its own length, so the same company gets a /23, 510 hosts and one route.300 hosts, classful a class B: 65,234 addresses unused · 300 hosts, CIDR a /23: 510 hosts, one route · CIDR RFC 1519 (1993) → RFC 4632 (2006)
  4. Classful habits survive in routing protocols. R1 and R3 run EIGRP with auto-summary (typed on purpose here; RIPv2 still does it by default). When R1 advertises 172.16.1.0/24 out of an interface in another major network, 10.0.0.0, it sends only the classful network 172.16.0.0/16 and installs that summary toward Null0. R3 does exactly the same with 172.16.2.0/24.R1 sends 172.16.0.0/16, not 172.16.1.0/24 · R3 sends 172.16.0.0/16, not 172.16.2.0/24 · R1 and R3 install 172.16.0.0/16 → Null0
  5. The result is a discontiguous network: 172.16.0.0 is split in two by 10.0.0.0, and both halves claim all of it. PC 1 pings 172.16.2.10, and R1's best match is its own summary 172.16.0.0/16 to Null0: the packet is discarded right there. R2 holds two equal-cost paths for 172.16.0.0/16 and load-shares per flow (CEF hashes source and destination), so about half of the flows it sends toward Site 2 go to R1 and die the same way.ping 172.16.1.10 → 172.16.2.10 · R1 match 172.16.0.0/16 → Null0: discarded · R2 172.16.0.0/16 via R1 and via R3 (ECMP)
  6. The fix is to stop cutting at the class boundary: no auto-summary on R1 and R3 (the EIGRP default since IOS 15.0(1)M; for RIPv2 you must type it). Each router now advertises its real /24 with its mask, R2 learns two different routes, 172.16.0.0/24 is subnetted, 2 subnets, and the ping goes through. This is classless routing: the mask travels with the prefix.R1 sends 172.16.1.0/24 · R3 sends 172.16.2.0/24 · ping 172.16.1.10 → 172.16.2.10: success
  7. Classes are gone from forwarding, but they leave traces you meet every day: show ip route still groups subnets under their classful network ("is subnetted", "is variably subnetted"); RIP network statements, and EIGRP ones without a wildcard, take the class; BGP network 10.0.0.0 without mask means 10.0.0.0/8; and hosts propose the class mask, 255.0.0.0 for a 10.x address. Know the classes, then always give the mask.show ip route 172.16.0.0/24 is subnetted · BGP network 10.0.0.0 = 10.0.0.0/8 · RIP network 172.16.1.0 saved as 172.16.0.0

2.2Simulator: which class is this address?

Type an address, with or without a prefix length

The class comes only from the first bits of the first octet. For classes A, B and C it implies a default mask; the special blocks are pointed to §6 and §7.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

FieldValue
First octet172 = 10101100
ClassB
Leading bits10
First-octet range128–191
Default (classful) mask255.255.0.0 = /16
Classful network172.16.0.0/16
Hosts per classful network65,534 (216 − 2)
Networks in the class16,384
With your /20 (CIDR)172.16.32.0/20
IANA special-purpose172.16.0.0/12 · Private-Use · RFC 1918 → §6
172.16.45.200 is class B: first bits 10, default mask /16
  • Private (RFC 1918, 172.16.0.0/12): usable inside any network, but it needs NAT to reach the Internet (§6). "Private" is not a class: the three RFC 1918 blocks sit in classes A, B and C.
  • With /20 the real network is 172.16.32.0/20 (CIDR). The classful network 172.16.0.0/16 only matters for auto-summary, classful network statements and the "is subnetted" header in show ip route.

2.3The configuration, line by line

R1 · EIGRP with auto-summary

1router eigrp 100
2 network 10.0.0.0No wildcard, so the class is assumed: every R1 interface in 10.0.0.0/8 runs EIGRP.
3 network 172.16.0.0Same: the whole class B network 172.16.0.0/16.
4 auto-summaryAdvertise only 172.16.0.0/16 out of interfaces in another major network and install 172.16.0.0/16 → Null0. Off by default since IOS 15.0(1)M: here it was typed on purpose, and R3 has the same line.

R1 · EIGRP fixed

1ip classlessThe IOS default since 11.3, shown for clarity: a packet for an unknown subnet of a known major network may still follow the default route.
2router eigrp 100
3 network 10.0.12.0 0.0.0.3With a wildcard: only the interface in 10.0.12.0/30.
4 network 172.16.1.0 0.0.0.255Only the LAN 172.16.1.0/24.
5 no auto-summaryAdvertise 172.16.1.0/24 with its real mask. R3 needs the same line for 172.16.2.0/24.

R1 · RIPv2

1router rip
2 version 2RIPv2 sends the mask with every route; RIPv1 does not, so it cannot handle a discontiguous network at all.
3 network 10.0.0.0RIP network statements are always classful: there is no wildcard.
4 network 172.16.0.0Typing network 172.16.1.0 would be saved as 172.16.0.0.
5 no auto-summaryRequired: RIPv2 still summarizes at the class boundary by default on most IOS and IOS-XE releases.

R1 · show ip route (auto-summary)

1Gateway of last resort is not set
2 
3 10.0.0.0/8 is variably subnetted, 4 subnets, 3 masksThe classful parent header: 10.0.0.0/8 holds routes with 3 different masks (/8, /30, /32).
4D 10.0.0.0/8 is a summary, 00:02:11, Null0Auto-summary the other way: R1 advertises 10.0.0.0/8 into Site 1.
5C 10.0.12.0/30 is directly connected, GigabitEthernet0/1
6L 10.0.12.1/32 is directly connected, GigabitEthernet0/1
7D 10.0.23.0/30 [90/3072] via 10.0.12.2, 00:02:09, GigabitEthernet0/1No summary inside the same major network: the /30 arrives intact.
8 172.16.0.0/16 is variably subnetted, 3 subnets, 3 masks
9D 172.16.0.0/16 is a summary, 00:02:11, Null0The trap: 172.16.2.10 matches this /16 and goes to Null0, i.e. it is discarded.
10C 172.16.1.0/24 is directly connected, GigabitEthernet0/0
11L 172.16.1.1/32 is directly connected, GigabitEthernet0/0The IOS 15+ local route for R1's own address.

R2 · show ip route (auto-summary)

1 10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
2C 10.0.12.0/30 is directly connected, GigabitEthernet0/0
3L 10.0.12.2/32 is directly connected, GigabitEthernet0/0
4C 10.0.23.0/30 is directly connected, GigabitEthernet0/1
5L 10.0.23.1/32 is directly connected, GigabitEthernet0/1
6D 172.16.0.0/16 [90/3072] via 10.0.23.2, 00:02:05, GigabitEthernet0/1The classful network itself, with no "is subnetted" header: R2 only knows 172.16.0.0/16…
7 [90/3072] via 10.0.12.1, 00:02:05, GigabitEthernet0/0…from both R1 and R3 with the same metric: equal-cost load sharing between the two sites.

R2 · show ip route (fixed)

1 10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
2C 10.0.12.0/30 is directly connected, GigabitEthernet0/0
3L 10.0.12.2/32 is directly connected, GigabitEthernet0/0
4C 10.0.23.0/30 is directly connected, GigabitEthernet0/1
5L 10.0.23.1/32 is directly connected, GigabitEthernet0/1
6 172.16.0.0/24 is subnetted, 2 subnetsThe classful parent 172.16.0.0 with the one mask its subnets share: the class survives as a heading.
7D 172.16.1.0 [90/3072] via 10.0.12.1, 00:00:07, GigabitEthernet0/0Site 1, toward R1.
8D 172.16.2.0 [90/3072] via 10.0.23.2, 00:00:07, GigabitEthernet0/1Site 2, toward R3.

The outputs are typical for IOS and IOS-XE; timers, metrics and details may vary between versions.

2.4Remember

Critical for the exam
Classes by first octet: A 1–126 (/8, leading bit 0), B 128–191 (/16, 10), C 192–223 (/24, 110), D 224–239 multicast (1110), E 240–255 reserved (1111). 127 is loopback and 0 is "this network", so neither is a usable class A network.
Theory
Classful protocols (RIPv1, IGRP) send no mask in their updates: the receiver infers it from the class or from its own interface in the same major network. A classful network therefore has to be contiguous, and auto-summary breaks a 172.16.0.0 that is split by 10.0.0.0.
Pitfall
"Private" is not a class. 172.16.0.0–172.31.255.255 is private (RFC 1918) but 172.32.1.1 is ordinary public class B space; 10.x is class A and private, 192.168.x class C and private (§6).
Numbers
A: 126 networks × 16,777,214 hosts; B: 16,384 × 65,534; C: 2,097,152 × 254 (hosts = 2h − 2). A is 50 % of the space, B 25 %, C 12.5 %, D and E 6.25 % each. CIDR: RFC 1519 (1993), replaced by RFC 4632 (2006).
Pitfall
Auto-summary defaults differ: EIGRP stopped summarizing by default in IOS 15.0(1)M and 12.2(33)SRE, while RIPv2 still does on most IOS and IOS-XE releases. Type no auto-summary whenever a major network is discontiguous and check show ip protocols: "Automatic network summarization is in effect" (RIP) or "Automatic Summarization: enabled" (EIGRP).
Platforms and standards
OSPF and IS-IS have no auto-summary at all; IOS BGP has an auto-summary command, off by default since 12.2(8)T, and network 10.0.0.0 without mask still means /8. ip classless has been the IOS default since 11.3: with no ip classless, a packet for an unknown subnet of a known major network is dropped instead of following the default route.
Verify withshow ip protocolsshow ip routeshow ip route 172.16.2.10show ip eigrp topology

2.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

The first octet of an address begins with the bits 110. Which class is it, and what is its default mask?

  1. AClass C, 255.255.0.0
  2. BClass D, no default mask
  3. CClass C, 255.255.255.0
  4. DClass B, 255.255.0.0
Show answer
Answer: C. 110 is the class C pattern (first octet 192–223), whose default mask is /24 = 255.255.255.0. Class B starts with 10 and class D with 1110; mixing class C with the /16 mask is the classic off-by-one-octet mistake.
CCNACCNA 200-301Q2

How many class A networks can be assigned to hosts, and why not 128?

  1. A126: networks 0 and 255 are reserved in every class
  2. B127: only network 0 is reserved, as "this network"
  3. C128: every first octet from 0 to 127 can be assigned
  4. D126: network 0 is "this network" and 127 is loopback
Show answer
Answer: D. Seven network bits give 128 class A networks, but 0.0.0.0/8 is "this network" (source only) and 127.0.0.0/8 is loopback, which leaves 126. 255 is not class A at all: it belongs to class E.
CCNACCNA 200-301Q3

Which address is a class B address that is not private?

  1. A172.16.45.200
  2. B172.32.1.1
  3. C192.168.172.16
  4. D172.31.255.254
Show answer
Answer: B. The private class B range of RFC 1918 is only 172.16.0.0–172.31.255.255 (172.16.0.0/12). 172.32.1.1 is still class B (first octet 172, bits 10) but ordinary public space. 192.168.172.16 is class C and private.
CCNACCNA 200-301Q4

Which first-octet range is class D, and what is it used for?

  1. A224–239, multicast groups
  2. B224–239, reserved for experiments
  3. C240–255, multicast groups
  4. D192–223, multicast groups
Show answer
Answer: A. Class D (leading bits 1110) is 224.0.0.0–239.255.255.255 and names multicast groups, such as 224.0.0.10 for EIGRP. 240–255 is class E, reserved; 192–223 is class C unicast.
ProfessionalENARSI 300-410Q5

R1 (LAN 172.16.1.0/24) and R3 (LAN 172.16.2.0/24) both connect to R2 over 10.0.12.0/30 and 10.0.23.0/30. EIGRP runs everywhere, and R1 and R3 are configured with auto-summary. What does R2 install for the 172.16 networks?

  1. ATwo routes, 172.16.1.0/24 via R1 and 172.16.2.0/24 via R3
  2. BA 172.16.0.0/16 summary route pointing to Null0
  3. CNothing, because EIGRP rejects two identical summaries from different neighbors
  4. DOne 172.16.0.0/16 route with two equal-cost next hops, R1 and R3
Show answer
Answer: D. R1 and R3 both cross a major-network boundary toward 10.0.0.0, so both advertise only 172.16.0.0/16; with equal metrics R2 load-shares between them, and about half of the flows for each site go the wrong way and die in the other router's Null0 route. The Null0 summary exists on R1 and R3, the routers that summarize, not on R2.
ProfessionalENARSI 300-410Q6

On classic IOS 15.x, which statement about the automatic summarization defaults is correct?

  1. ABoth EIGRP and RIPv2 auto-summarize by default
  2. BNeither EIGRP nor RIPv2 auto-summarizes by default
  3. CEIGRP no longer auto-summarizes by default, while RIPv2 still does
  4. DOSPF auto-summarizes at classful boundaries unless no auto-summary is configured
Show answer
Answer: C. Cisco disabled EIGRP auto-summary by default in 15.0(1)M and 12.2(33)SRE, but RIPv2 kept its classful default, so no auto-summary is still needed there (check the default on your IOS-XE release). OSPF has no auto-summary at all: it only summarizes where you configure area range or summary-address.
ProfessionalENARSI 300-410Q7

An IOS router has router bgp 65001 with network 10.0.0.0 (no mask keyword). Its routing table holds 10.1.0.0/16 but no 10.0.0.0/8. What does BGP advertise from this statement?

  1. A10.0.0.0/16, with the mask copied from the first matching route
  2. B10.0.0.0/8, built as an aggregate of 10.1.0.0/16
  3. CNothing, unless 10.0.0.0/8 itself is in the routing table
  4. D10.1.0.0/16, because it falls inside 10.0.0.0/8
Show answer
Answer: C. A BGP network statement without mask uses the classful mask, here /8, and BGP originates it only if that exact prefix is in the routing table (BGP auto-summary is off by default since 12.2(8)T). To advertise the /16, use network 10.1.0.0 mask 255.255.0.0; building a /8 from more specific routes needs aggregate-address (§9).
CCIECCIE EI v1.1Q8

R1 runs EIGRP with auto-summary and also has a static default route via R2. PC 1 in 172.16.1.0/24 cannot reach 172.16.2.10, which lives behind R3. Why does the default route not help?

  1. AR2 drops the packet because it arrived on the interface it would use to reach R1
  2. BR1's own summary 172.16.0.0/16 → Null0 is a longer match than 0.0.0.0/0
  3. Cip classless is disabled by default, so R1 ignores the default route for subnets of 172.16.0.0
  4. DEIGRP split horizon blocks traffic going back toward the summarizing router
Show answer
Answer: B. Auto-summary installs 172.16.0.0/16 → Null0 (administrative distance 5) on R1, and the longest match beats the /0, so the packet never leaves R1. ip classless has been on by default since IOS 11.3, and split horizon filters route advertisements, not data packets.

Subnet masks, prefix length and CIDR

CCNA 200-301 v1.1ENCOR 350-401 v1.2ENARSI 300-410

TL;DRA subnet mask is 32 bits of contiguous 1s followed by 0s, so it can be written as a single count, the prefix length: 255.255.240.0 = /20, and every mask octet is one of only nine values. A wildcard is the same boundary inverted (0.0.15.255) and is what ACLs and OSPF network statements expect. CIDR made the length part of every prefix; IOS keeps the dotted mask in its configuration and prints /n in its routing table.

The terms, in short
Subnet mask
32 bits: 1s over the network part, then 0s over the host part. 255.255.240.0 = 11111111.11111111.11110000.00000000.
Prefix length (/n)
The number of 1 bits in the mask, written after a slash: 255.255.240.0 = /20.
Contiguous
All the 1s on the left, with no 0 between them. 255.0.255.0 is not contiguous, and IOS refuses it as a mask.
Wildcard (inverse) mask
The mask with every bit flipped, 0.0.15.255 for a /20: 0 = must match, 1 = ignore. Used by ACLs and by OSPF and EIGRP network statements.
CIDR
Classless Inter-Domain Routing (RFC 1519, now RFC 4632): any prefix length from /0 to /32, written address/length and carried with every route.
Block size
256 minus the mask octet where the boundary falls: 256 − 240 = 16, so /20 networks start every 16 in the third octet (§5).

3.1The step-by-step animation

  1. A mask is 32 bits: a run of 1s on the left, the network part, then 0s, the host part. To build a /20, write 20 ones. The first two octets fill completely, 255.255; the third gets the remaining 4 ones, 11110000 = 128 + 64 + 32 + 16 = 240; everything after is 0. So /20 = 255.255.240.0, the mask of this branch LAN./20 20 ones + 12 zeros · octet 3 11110000 = 240 · dotted decimal 255.255.240.0
  2. Because the 1s must be contiguous, a mask octet can only hold nine values: 0, 128, 192, 224, 240, 248, 252, 254 and 255, that is zero to eight ones pushed to the left. 240 has four ones, so it means /4, /12, /20 or /28 depending on the octet it sits in. Any other value, such as 250 or 127, has a 1 after a 0 and is never a valid mask octet.valid octets 0 128 192 224 240 248 252 254 255 · 240 4 ones: /4, /12, /20 or /28 · never 250, 253, 127, 55…
  3. The PC has 172.16.45.200 with mask 255.255.240.0. Its 20 network bits give the network 172.16.32.0/20, a block of 4,096 addresses from 172.16.32.0 to 172.16.47.255. The same mask has two spellings: IOS configures it in dotted decimal, ip address 172.16.32.1 255.255.240.0, while show ip route, NX-OS and every CIDR document write /20. Converting is just counting the ones.address 172.16.45.200 · mask 255.255.240.0 = /20 · network 172.16.32.0/20 · 4,096 addresses
  4. ACLs and OSPF network statements do not take masks but wildcards: the same boundary with every bit inverted, where 0 means "this bit must match" and 1 means "ignore it". Flip the bits of 255.255.240.0, or subtract each octet from 255, and you get 0.0.15.255. access-list 10 permit 172.16.32.0 0.0.15.255 checks the first 20 bits and ignores the last 12, so the PC's traffic is permitted toward HQ.mask 255.255.240.0 · wildcard 0.0.15.255 = 255.255.255.255 − mask · 0 / 1 must match / ignore
  5. The classic mistake is typing the mask where IOS expects a wildcard: access-list 10 permit 172.16.32.0 255.255.240.0. IOS accepts it but reads "ignore the first 20 bits, check the last 12", and stores permit 0.0.0.0, wildcard bits 255.255.240.0: only addresses whose last 12 bits are zero match. 172.16.45.200 ends in 1101 11001000, so the implicit deny drops it. The fix is the wildcard, 0.0.15.255.typed permit 172.16.32.0 255.255.240.0 · stored permit 0.0.0.0, wildcard bits 255.255.240.0 · 172.16.45.200 last 12 bits ≠ 0 → implicit deny
  6. Masks, unlike ACL wildcards, must be contiguous. ip address 172.16.32.1 255.0.255.0 on R1 is refused with Bad mask 0xFF00FF00 for address 172.16.32.1: the 1s of the third octet come after the 0s of the second, so there is no single point where the network ends. RFC 950 only recommended contiguous masks; CIDR requires them, and IOS rejects 255.255.255.250 the same way.typed 255.0.255.0 · binary 11111111.00000000.11111111.00000000 · IOS Bad mask 0xFF00FF00 for address 172.16.32.1
  7. CIDR is why the length now travels with every prefix: since RFC 1519 (1993, replaced by RFC 4632) a route is an address plus a length, and any length from /0 to /32 is legal. On Cisco devices you meet four spellings of the same /20: dotted on IOS interfaces, /20 in routing tables and on NX-OS, the wildcard in ACLs and OSPF, and hex, which IOS prints with ip netmask-format hexadecimal and in Bad mask errors. ip netmask-format only changes how IOS displays masks, never the configuration.IOS interface 255.255.240.0 · routes, NX-OS /20 · ACL, OSPF 0.0.15.255 · hex display 0xFFFFF000

3.2Simulator: one mask, every spelling

Type a mask, a prefix length or a wildcard, and say where it will be used

The converter checks that the 1s are contiguous and gives the dotted mask, the /n, the wildcard, the hex value, the addresses per block and the usable hosts.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

FormValue
Prefix length/20
Subnet mask255.255.240.0 (octet 3 = 240, one of 0 128 192 224 240 248 252 254 255)
Wildcard0.0.15.255
Mask in binary11111111.11111111.11110000.00000000
Mask in hex0xFFFFF000
Addresses per block4,096 (212)
Usable hosts4,094 (212 − 2)
Block size16 in octet 3 (networks start every 16: 0, 16, 32…)
How you type itIOS: ip address … 255.255.240.0 · NX-OS: ip address …/20 · ACL / OSPF: … 0.0.15.255
/20 = 255.255.240.0 = wildcard 0.0.15.255
  • 20 ones followed by 12 zeros: the network part is 20 bits, the host part 12. The wildcard is 255.255.255.255 − 255.255.240.0 = 0.0.15.255.
  • Each /20 block holds 4,096 addresses: the first is the network, the last the broadcast, 4,094 are left for hosts (§4).
  • Block size 16 in octet 3 (256 − 240): §5 uses it to list the subnets without binary.

3.3The configuration, line by line

R1 · IOS-XE

1interface GigabitEthernet0/0Branch LAN.
2 ip address 172.16.32.1 255.255.240.0IOS and IOS-XE always take the dotted mask here: 255.255.240.0 = /20.
3!
4interface GigabitEthernet0/1Link to R2 at HQ.
5 ip address 10.0.12.1 255.255.255.252/30 = 255.255.255.252.
6 ip access-group 10 outFilter what leaves toward HQ with ACL 10.
7!
8access-list 10 permit 172.16.32.0 0.0.15.255A wildcard, not a mask: 0 bits must match, 1 bits are ignored. Permits 172.16.32.0 to 172.16.47.255; everything else hits the implicit deny.
9!
10router ospf 1
11 network 172.16.32.0 0.0.15.255 area 0OSPF network statements take a wildcard too: every interface whose address falls in 172.16.32.0/20 joins area 0.
12 network 10.0.12.0 0.0.0.3 area 0The /30 link: wildcard 0.0.0.3.
13!
14line vty 0 4
15 ip netmask-format bit-countDisplay only: show output on SSH sessions prints masks as /20; decimal prints 255.255.240.0 and hexadecimal 0xFFFFF000. The configuration does not change. terminal ip netmask-format does the same for the current session.

NX-OS

1interface Ethernet1/1
2 no switchportA routed port.
3 ip address 172.16.32.1/20NX-OS uses the prefix length; a dotted mask is also accepted and stored as /20.
4 ip router ospf 1 area 0.0.0.0No network statement and no wildcard: OSPF is enabled per interface.
5!
6ip access-list BRANCH
7 10 permit ip 172.16.32.0/20 anyNX-OS ACLs take /20 (a wildcard is accepted too).

IOS-XR

1interface GigabitEthernet0/0/0/0
2 ipv4 address 172.16.32.1 255.255.240.0IOS-XR configures the dotted mask too (note ipv4, not ip); show route prints /20.
3!
4ipv4 access-list BRANCH
5 10 permit ipv4 172.16.32.0 0.0.15.255 anyA wildcard, as on IOS: 0 = must match, 1 = ignore.
6!
7router ospf 1
8 area 0
9 interface GigabitEthernet0/0/0/0As on NX-OS, interfaces are listed under the area: no wildcards.

Wrong

1access-list 10 permit 172.16.32.0 255.255.240.0A mask typed as a wildcard: accepted, but it ignores the first 20 bits and checks only the last 12.
2! show access-lists → 10 permit 0.0.0.0, wildcard bits 255.255.240.0IOS clears the ignored bits, so only addresses ending in 12 zero bits match: 172.16.45.200 is denied.
3interface GigabitEthernet0/0
4 ip address 172.16.32.1 255.0.255.0Not contiguous: 1s after 0s.
5! Bad mask 0xFF00FF00 for address 172.16.32.1Refused: the interface keeps its previous address.
6 ip address 172.16.32.1 255.255.255.250
7! Bad mask 0xFFFFFFFA for address 172.16.32.1250 = 11111010: refused as well.

show ip route connected

1 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
2C 10.0.12.0/30 is directly connected, GigabitEthernet0/1
3L 10.0.12.1/32 is directly connected, GigabitEthernet0/1
4 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masksThe classful parent (§2): the /20 and the /32 live under it.
5C 172.16.32.0/20 is directly connected, GigabitEthernet0/0The configured 255.255.240.0, displayed as /20.
6L 172.16.32.1/32 is directly connected, GigabitEthernet0/0R1's own address as a /32 (IOS 15 and later).

show access-lists

1Standard IP access list 10
2 10 permit 172.16.32.0, wildcard bits 0.0.15.255 (12 matches)IOS prints the stored address and the wildcard bits; the counter grows as the PC's packets are permitted.

The outputs and error messages are typical for IOS and IOS-XE; details may vary between versions.

3.4Remember

Critical for the exam
A mask octet can only be 0, 128, 192, 224, 240, 248, 252, 254 or 255. Wildcard = 255.255.255.255 − mask: /20 = 255.255.240.0 → 0.0.15.255; /30 = 255.255.255.252 → 0.0.0.3. In a wildcard, bit 0 = must match and bit 1 = ignore.
Theory
The prefix length is the mask: /n means n leading 1 bits. Because the 1s are contiguous, one number describes the boundary, which is what lets CIDR advertise any length, aggregate prefixes (§9) and choose the longest match.
Pitfall
A mask typed in an ACL (permit 172.16.32.0 255.255.240.0) is accepted without any warning and matches the wrong addresses. Check with show access-lists: IOS prints the address it stored and the wildcard bits.
Numbers
/20 = 4,096 addresses, 4,094 usable hosts, block size 16 in the third octet; 255.255.240.0 = 0xFFFFF000. /30 = 4 addresses, 2 hosts. RFC 950 (1985) introduced the subnet mask; CIDR came with RFC 1519 (1993), replaced by RFC 4632 (2006).
Pitfall
255.255.255.250 is not "almost a /29": with 11111010 in the last octet it is no mask at all, and IOS answers Bad mask 0xFFFFFFFA. Wildcards, on the other hand, may be non-contiguous: permit 10.1.0.5 0.0.255.0 legally matches 10.1.x.5.
Platforms and standards
IOS and IOS-XE take dotted masks in ip address and ip route and wildcards in ACLs and in OSPF and EIGRP network statements. NX-OS configures /20 and enables OSPF per interface; IOS-XR configures ipv4 address with a dotted mask and lists OSPF interfaces under the area. terminal ip netmask-format {bit-count | decimal | hexadecimal} changes only how show output prints masks.
Verify withshow running-config interface GigabitEthernet0/0show ip interface GigabitEthernet0/0show ip route connectedshow access-lists 10show ip ospf interface brief

3.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

Which of these is a valid subnet mask?

  1. A255.255.255.253
  2. B255.0.255.0
  3. C255.255.248.0
  4. D255.255.250.0
Show answer
Answer: C. A mask is a run of 1s followed by 0s, so every octet must be one of 0, 128, 192, 224, 240, 248, 252, 254 or 255, and once an octet is below 255 the following ones must be 0. 248 = 11111000 fits (/21). 250 = 11111010 and 253 = 11111101 have a 1 after a 0, and 255.0.255.0 puts 1s back after a zero octet.
CCNACCNA 200-301Q2

Which prefix length is the same as the mask 255.255.240.0?

  1. A/21
  2. B/20
  3. C/19
  4. D/28
Show answer
Answer: B. 8 + 8 ones in the first two octets, plus 240 = 11110000, four more: 20 ones, /20. /28 is what you get when 240 sits in the last octet (255.255.255.240), the classic confusion of the octet position.
CCNACCNA 200-301Q3

In a standard ACL, which wildcard matches exactly the addresses of 172.16.32.0/20?

  1. A0.0.16.255
  2. B255.255.240.0
  3. C0.0.15.255
  4. D0.0.31.255
Show answer
Answer: C. The wildcard is the inverted mask: 255.255.255.255 − 255.255.240.0 = 0.0.15.255, i.e. check the first 20 bits and ignore the last 12. 255.255.240.0 is the mask itself, 0.0.31.255 would cover a /19 (172.16.32.0 to 172.16.63.255), and 0.0.16.255 is not even contiguous.
CCNACCNA 200-301Q4

What is a /27 mask in dotted decimal, and how many usable hosts does a /27 subnet hold?

  1. A255.255.255.192, 62 hosts
  2. B255.255.255.224, 30 hosts
  3. C255.255.255.240, 14 hosts
  4. D255.255.255.224, 32 hosts
Show answer
Answer: B. 27 ones leave 3 ones in the last octet, 11100000 = 224, and 5 host bits: 25 − 2 = 30 usable hosts. 32 forgets to remove the network and broadcast addresses; 255.255.255.240 with 14 hosts is a /28, one bit too far.
ProfessionalENCOR 350-401 · ENARSI 300-410Q5

To permit the branch 172.16.32.0/20, an engineer types access-list 10 permit 172.16.32.0 255.255.240.0 and applies it outbound toward HQ. What happens to traffic from 172.16.45.200?

  1. ADenied: read as a wildcard, it checks only the last 12 bits, which must be 0
  2. BPermitted: its first 20 bits match 172.16.32.0, exactly as the mask demands
  3. CPermitted: IOS rejects the line with Bad mask, and a missing ACL permits all
  4. DPermitted: IOS converts the mask into the wildcard 0.0.15.255 by itself
Show answer
Answer: A. In an ACL the second field is always a wildcard: 1 bits are ignored. With 255.255.240.0, the first 20 bits are ignored (IOS stores permit 0.0.0.0, wildcard bits 255.255.240.0) and the last 12 must be zero; 172.16.45.200 ends in 1101 11001000, so it falls to the implicit deny. IOS does not convert masks, and the command is legal, so no error appears.
ProfessionalENARSI 300-410Q6

Which OSPF statement matches every interface address in 172.16.32.0/20 and nothing outside it?

  1. Anetwork 172.16.32.0 0.0.15.255 area 0
  2. Bnetwork 172.16.32.0 0.0.16.255 area 0
  3. Cnetwork 172.16.32.0 0.0.31.255 area 0
  4. Dnetwork 172.16.45.0 0.0.0.255 area 0
Show answer
Answer: A. The OSPF network statement takes a wildcard: 0.0.15.255 checks exactly the 20 network bits. 0.0.31.255 is a /19 and also catches 172.16.48.0 to 172.16.63.255; 0.0.0.255 on 172.16.45.0 covers only one /24 of the block; 0.0.16.255 ignores the wrong bit and matches only 172.16.32.x and 172.16.48.x.
ProfessionalENARSI 300-410Q7

A router has ip prefix-list BR seq 5 permit 172.16.32.0/20 le 24. Which received route does it permit?

  1. A172.16.32.0/19
  2. B172.16.40.0/22
  3. C172.16.48.0/24
  4. D172.16.32.0/25
Show answer
Answer: B. The route must sit inside 172.16.32.0/20 (172.16.32.0 to 172.16.47.255) and have a length from /20 to /24. 172.16.40.0/22 qualifies. 172.16.48.0/24 is outside the /20, the /19 is shorter than 20, and the /25 is longer than the le 24 limit.
CCIECCIE EI v1.1Q8

Which addresses does access-list 20 permit 10.0.5.0 0.255.0.255 match?

  1. ANone: IOS rejects the entry, since wildcards must be contiguous like masks
  2. BOnly 10.0.5.0 to 10.0.5.255, because IOS converts the wildcard to a contiguous one
  3. CAny address in 10.0.0.0/8, because the first 1 bit makes the rest ignored
  4. DAny address whose first octet is 10 and third octet is 5, i.e. 10.x.5.y
Show answer
Answer: D. Wildcard bits are checked one by one and need not be contiguous: 0.255.0.255 checks octets 1 and 3 (all 0 bits) and ignores octets 2 and 4, so 10.200.5.77 matches and 10.0.6.1 does not. Only masks must be contiguous; non-contiguous wildcards are legal and are used, for example, to match odd or even subnets.

Network, broadcast and usable hosts: the formula, /31 and /32

CCNA 200-301 v1.1ENCOR 350-401 v1.2ENARSI 300-410CCIE EI v1.1

TL;DRThe network address is the IP address AND the mask, the broadcast is the network OR the wildcard, and every address in between is a usable host: 2h − 2 of them, because the all-zeros and all-ones host values are reserved. The fast way is the block size of the interesting octet (256 − mask octet). Two exceptions: a /31 on a point-to-point link has two usable addresses and no broadcast (RFC 3021), and a /32 is a single host (loopbacks, host routes).

The terms, in short
Network address
All host bits 0: the address AND the mask. For 172.16.45.200/20 it is 172.16.32.0, the name the routing table uses for the subnet.
Broadcast address
All host bits 1: the network OR the wildcard. For the same /20 it is 172.16.47.255; a packet sent to it reaches every host in the subnet.
Wildcard mask
The mask inverted bit by bit: /20 = 255.255.240.0, wildcard 0.0.15.255. The same value appears in ACLs and OSPF network statements.
Usable hosts
2h − 2, with h = 32 − prefix: 212 − 2 = 4094 for a /20, 27 − 2 = 126 for Host A's /25.
Interesting octet, block size
The octet where the mask is neither 255 nor 0; block size = 256 − that octet (256 − 240 = 16), the step between consecutive networks.
/31 (RFC 3021)
Two addresses, both usable, no network and no broadcast: only for point-to-point links.
/32 and host route
One address, no host bits: loopbacks such as 10.255.0.1/32 and the L routes IOS installs for its own interface addresses.

4.1The step-by-step animation

  1. Start with the classic exam example, 172.16.45.200/20. A /20 mask has 20 ones: the first 20 bits name the network, the last 12 the host. AND-ing the address with the mask bit by bit keeps every network bit and turns every host bit into 0, so the result is the network address, 172.16.32.0.address 172.16.45.200 · mask 255.255.240.0 = /20 · AND = network 172.16.32.0
  2. The broadcast is the other end of the same block: keep the 20 network bits and set all 12 host bits to 1. The wildcard (the inverted mask, 0.0.15.255) has ones exactly on the host bits, so network OR wildcard = 172.16.47.255. Every address from 172.16.32.0 to 172.16.47.255 shares the same first 20 bits.network 172.16.32.0 · wildcard 0.0.15.255 · OR = broadcast 172.16.47.255
  3. The fast way, without writing 32 bits. The interesting octet is the one where the mask is neither 255 nor 0: here the third, 240. Block size = 256 − 240 = 16, so the /20 networks start at 0, 16, 32, 48… in that octet. 45 falls in the block that starts at 32: network 172.16.32.0, next network 172.16.48.0, so the broadcast is one less, 172.16.47.255. Between them: 212 − 2 = 4094 usable hosts.interesting octet 3rd, mask 240 · block size 256 − 240 = 16 · usable 172.16.32.1 – 172.16.47.254 · hosts 2^12 − 2 = 4094
  4. Same method on the company network. Host A has 192.168.10.37/25: the interesting octet is the fourth (mask 128), block size 128, so the /25 subnets start at .0 and .128. 37 is in the first: network 192.168.10.0, broadcast 192.168.10.127, hosts .1 to .126 (27 − 2 = 126). R1's Gi0/0 takes the first usable address, .1, and becomes the gateway of the Sales LAN.Host A 192.168.10.37/25 · network 192.168.10.0 · broadcast 192.168.10.127 · usable .1 – .126, 126 hosts
  5. Why −2? Host bits all 0 give the subnet's own name (192.168.10.0, the entry in the routing table) and host bits all 1 give its broadcast (192.168.10.127, received by every host in the LAN). Neither can belong to one device. Give R1 the broadcast address and IOS refuses it with Bad mask /25 for address 192.168.10.127; any address from .1 to .126 is accepted.host bits 0000000 192.168.10.0 = network · host bits 1111111 192.168.10.127 = broadcast · IOS Bad mask /25 for address 192.168.10.127
  6. A point-to-point link has exactly two devices, so a /30 wastes half of its block: .224 is the network, .227 the broadcast, and only .225 (R1) and .226 (R2) are hosts. RFC 3021 allows a /31 instead: two addresses, both usable, no network and no broadcast, because a link with a single neighbour has nobody else to broadcast to. IOS accepts it on Ethernet with a warning./30 4 addresses, 2 usable (50%) · /31 2 addresses, 2 usable · IOS % Warning: use /31 mask on non point-to-point interface cautiously
  7. At the other extreme, a /32 has no host bits: one address, and network = broadcast = the address itself. That is what a loopback uses (R1's Loopback0 10.255.0.1/32) and what a host route is. Since IOS 15 the router also installs a /32 L (local) route for each interface address next to the C route of its subnet; the /32 loopback gets only its C route, because it already is a host route.Loopback0 10.255.0.1/32, 1 address · C 192.168.10.0/25, the subnet · L 192.168.10.1/32, R1 itself

4.2Simulator: the subnet calculator

An address with its prefix or its dotted mask

Type any IPv4 address as 172.16.45.200/20 or 172.16.45.200 255.255.240.0. The calculator does what this section does by hand: AND with the mask, OR with the wildcard, count the hosts, and show the bits of the interesting octet.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

ValueResult
Address172.16.45.200/20 · host 3,528 of 4,094
Network address172.16.32.0 (host bits all 0)
First usable172.16.32.1
Last usable172.16.47.254
Broadcast address172.16.47.255 (host bits all 1)
Subnet mask255.255.240.0 = /20
Wildcard mask0.0.15.255
Addresses in the block212 = 4,096
Usable hosts212 − 2 = 4,094
Class (historical, §2)B: first bits 10, default mask /16
Address typePrivate-Use · 172.16.0.0/12 · RFC 1918 · §6

The interesting octet, bit by bit: octet 3, block size 256 − 240 = 16: networks at 0, 16, 32… in this octet

Octet 3 ofBits (network · host)Decimal
the address0010110145
the mask11110000240
AND = network0010000032
OR wildcard = broadcast0010111147
172.16.45.200 is host 3,528 of 4,094 in 172.16.32.0/20
  • Network = 172.16.45.200 AND 255.255.240.0 = 172.16.32.0; broadcast = 172.16.32.0 OR 0.0.15.255 = 172.16.47.255.
  • Usable = 212 − 2 = 4,094: the all-zeros host (172.16.32.0) and the all-ones host (172.16.47.255) are reserved.
  • Block size check: octet 3 of the mask is 240, block = 256 − 240 = 16; 45 falls in 32–47, so the network has 32 and the broadcast 47 in that octet.

4.3The configuration, line by line

R1 · IOS-XE

1interface GigabitEthernet0/0Sales LAN, VLAN 10.
2 description Sales LAN 192.168.10.0/25
3 ip address 192.168.10.1 255.255.255.128The first usable host of 192.168.10.0/25 (.1 to .126); Host A uses it as its default gateway.
4interface GigabitEthernet0/1Engineering LAN, VLAN 20.
5 ip address 192.168.10.129 255.255.255.192192.168.10.128/26: network .128, hosts .129 to .190, broadcast .191.
6interface GigabitEthernet0/2Point-to-point link to R2.
7 description P2P to R2 192.168.10.224/30
8 ip address 192.168.10.225 255.255.255.252/30: network .224, R1 .225, R2 .226, broadcast .227. Two usable addresses out of four.
9interface Loopback0A virtual interface that is always up, often used as the router ID and the management address.
10 ip address 10.255.0.1 255.255.255.255/32: a single address, no network or broadcast to reserve.

/31 link (RFC 3021)

1! Alternative: the R1-R2 link renumbered as a /31Two addresses instead of four; the /30 plan is kept in the rest of the guide.
2interface GigabitEthernet0/2R1
3 ip address 192.168.10.224 255.255.255.254R1 takes .224: on a /31 the "all zeros" address is a normal host.
4% Warning: use /31 mask on non point-to-point interface cautiouslyIOS output on an Ethernet interface: a warning, not an error. The address is applied.
5!
6interface GigabitEthernet0/0R2
7 ip address 192.168.10.225 255.255.255.254R2 takes .225, the "all ones" address. Both ends must use /31.

NX-OS · IOS-XR

1! NX-OS: the prefix length instead of a dotted mask
2interface Ethernet1/2
3 no switchportA routed port; NX-OS switch ports are Layer 2 by default.
4 ip address 192.168.10.225/30Same /30 as on IOS-XE, written as a prefix length.
5! IOS-XR: the command is ipv4 address
6interface GigabitEthernet0/0/0/2
7 ipv4 address 192.168.10.225 255.255.255.252IOS-XR uses ipv4 address (and ipv6 address); interfaces are named rack/slot/module/port.

Wrong

1interface GigabitEthernet0/0
2 ip address 192.168.10.127 255.255.255.128The broadcast address of 192.168.10.0/25 (all 7 host bits are 1).
3Bad mask /25 for address 192.168.10.127IOS rejects the command and keeps the previous address.
4 ip address 192.168.10.0 255.255.255.128The network address itself (all 7 host bits are 0).
5Bad mask /25 for address 192.168.10.0Same refusal. The fix: any host from .1 to .126, normally .1 for the gateway.

show ip route connected

1R1#show ip route connected
2 10.0.0.0/32 is subnetted, 1 subnetsThe loopback alone: a single /32 under the classful network 10.0.0.0.
3C 10.255.0.1 is directly connected, Loopback0A /32 gets its C route and no separate L route.
4 192.168.10.0/24 is variably subnetted, 6 subnets, 4 masksSix entries with four masks: /25, /26 and /30 for the C routes (VLSM, §8), plus /32 for the L routes.
5C 192.168.10.0/25 is directly connected, GigabitEthernet0/0C = the subnet (the network address, host bits 0).
6L 192.168.10.1/32 is directly connected, GigabitEthernet0/0L = R1's own address on that subnet, as a /32 host route (IOS 15 and later).
7C 192.168.10.128/26 is directly connected, GigabitEthernet0/1
8L 192.168.10.129/32 is directly connected, GigabitEthernet0/1
9C 192.168.10.224/30 is directly connected, GigabitEthernet0/2The /30 to R2.
10L 192.168.10.225/32 is directly connected, GigabitEthernet0/2

show ip interface Gi0/0

1GigabitEthernet0/0 is up, line protocol is up
2 Internet address is 192.168.10.1/25The address and the prefix: subnet 192.168.10.0/25.
3 Broadcast address is 255.255.255.255Not the subnet broadcast: it is the address R1 uses for its own broadcasts (limited broadcast). The directed broadcast of the subnet is still 192.168.10.127.
4 Address determined by non-volatile memory
5 MTU is 1500 bytes
6 Helper address is not set
7 Directed broadcast forwarding is disabledPackets to 192.168.10.127 arriving from other subnets are not turned into a LAN broadcast (the default since IOS 12.0, §7).

The outputs are typical for IOS-XE; details may vary between versions.

4.4Remember

Critical for the exam
Network = address AND mask; broadcast = network OR wildcard; first usable = network + 1; last usable = broadcast − 1; usable hosts = 2h − 2 with h = 32 − prefix. For 172.16.45.200/20: 172.16.32.0, 172.16.47.255, 172.16.32.1 – 172.16.47.254, 4094 hosts.
Theory
The −2 exists because the all-zeros host value names the subnet itself (it is what the routing table shows) and the all-ones value is the subnet's directed broadcast. A /31 has no room for either, so RFC 3021 lets both addresses be hosts: on a link with exactly one neighbour, "everyone else on the subnet" is just that neighbour.
Pitfall
"How many addresses" (2h) and "how many hosts" (2h − 2) are different questions. A /26 has 64 addresses but 62 hosts, so a LAN that must hold 64 hosts needs a /25, not a /26.
Numbers
/24 = 254 hosts, /25 = 126, /26 = 62, /27 = 30, /28 = 14, /29 = 6, /30 = 2 (the classic point-to-point), /31 = 2 with no broadcast (RFC 3021), /32 = 1 (loopback, host route). /20 = 4094, /16 = 65,534.
Pitfall
The block size counts in the interesting octet only, and the octets after it go to 0 (network) or 255 (broadcast). For 172.16.45.200/20 the broadcast is 172.16.47.255, not 172.16.45.255 (a /24 reflex) and not 172.16.47.0.
Platforms and standards
IOS rejects a network or broadcast address on an interface (Bad mask /25 for address 192.168.10.127), has supported /31 since 12.2(2)T (on Ethernet with % Warning: use /31 mask on non point-to-point interface cautiously) and, since IOS 15, adds an L /32 route for every interface address. NX-OS writes ip address 192.168.10.225/30, IOS-XR ipv4 address 192.168.10.225 255.255.255.252.
Verify withshow ip interface briefshow ip route connectedshow ip interface GigabitEthernet0/0

4.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

A host is configured with 172.16.45.200/20. What is the broadcast address of its subnet?

  1. A172.16.47.255
  2. B172.16.63.255
  3. C172.16.45.255
  4. D172.16.32.255
Show answer
Answer: A. A /20 leaves 12 host bits. The interesting octet is the third (mask 240, block size 16), and 45 lies in the 32–47 block: network 172.16.32.0, broadcast 172.16.47.255. 172.16.45.255 is the /24 reflex: it sets only the last octet to 255 and forgets the four host bits in the third octet.
CCNACCNA 200-301Q2

How many usable host addresses does a /21 subnet provide?

  1. A4094
  2. B1022
  3. C2048
  4. D2046
Show answer
Answer: D. h = 32 − 21 = 11, so the block has 211 = 2048 addresses; minus the network and broadcast addresses that leaves 2046 hosts. 2048 counts the whole block, 1022 is a /22 and 4094 a /20.
CCNACCNA 200-301Q3

Host A has 192.168.10.37/25. Which is the last usable host address of its subnet?

  1. A192.168.10.62
  2. B192.168.10.126
  3. C192.168.10.127
  4. D192.168.10.254
Show answer
Answer: B. A /25 has a block size of 128 in the fourth octet, so 37 lies in .0–.127: the broadcast is .127 and the last usable host is .126. .127 has all 7 host bits set to 1 and cannot be assigned; .254 is the last host of a /24 and .62 of a /26.
CCNACCNA 200-301Q4

Which of these addresses can be assigned to a host interface that uses the mask 255.255.255.240?

  1. A10.1.1.32
  2. B10.1.1.46
  3. C10.1.1.48
  4. D10.1.1.47
Show answer
Answer: B. 255.255.255.240 is a /28 with a block size of 16: the subnets around these addresses are .32–.47 and .48–.63. 10.1.1.46 is a host of 10.1.1.32/28 (hosts .33 to .46). .47 is the broadcast of that subnet, .48 the network address of the next one and .32 its own network address.
ProfessionalENARSI 300-410Q5

R1 and R2 share a point-to-point Ethernet link numbered 10.0.0.0/31: R1 has 10.0.0.0 and R2 has 10.0.0.1. What happens?

  1. AThe link works only after both ends move to a /30, because a /31 has 0 usable hosts
  2. BThe routers can ping each other, but OSPF cannot form an adjacency over a /31
  3. CBoth work as hosts: a /31 has no network and no broadcast address (RFC 3021)
  4. DIOS rejects 10.0.0.0 on R1 because it is the network address of the /31
Show answer
Answer: C. A /31 has exactly two addresses and, under RFC 3021, both are hosts: there is no network or broadcast address to reserve. IOS accepts it with % Warning: use /31 mask on non point-to-point interface cautiously. The 2h − 2 formula would give 0, which is exactly the case RFC 3021 changes; routing protocols, OSPF included, run over /31 links normally.
ProfessionalENARSI 300-410Q6

On IOS-XE, R1 gets interface Loopback0 with ip address 10.255.0.1 255.255.255.255 and interface GigabitEthernet0/2 with ip address 192.168.10.225 255.255.255.252. Which routes do these two interfaces add to show ip route connected?

  1. AC 10.255.0.1/32, C 192.168.10.224/30 and L 192.168.10.225/32
  2. BC 10.255.0.1/32 and C 192.168.10.224/30 only
  3. CC and L 10.255.0.1/32, C 192.168.10.224/30 and L 192.168.10.225/32
  4. DC 10.255.0.1/32, C 192.168.10.225/30 and L 192.168.10.224/32
Show answer
Answer: A. Since IOS 15 every interface address adds a C route for its subnet and an L /32 route for the address itself. A /32 loopback already is a host route, so it appears once, as C. The /30 gives C 192.168.10.224/30 (the network address, not .225) and L 192.168.10.225/32; swapping those two is the tempting mistake.
ProfessionalENARSI 300-410Q7

show ip interface GigabitEthernet0/0 on R1 (192.168.10.1/25) displays Broadcast address is 255.255.255.255. A colleague concludes the interface is misconfigured. What is correct?

  1. ANothing is wrong: it is where R1 sends its own broadcasts; the subnet broadcast is still 192.168.10.127
  2. BIt reflects the default no ip directed-broadcast; with ip directed-broadcast it would read 192.168.10.127
  3. CThe interface is misconfigured: for a /25 the line must read 192.168.10.127
  4. DR1 now treats 255.255.255.255 as the broadcast of 192.168.10.0/25 and ignores packets sent to 192.168.10.127
Show answer
Answer: A. The Broadcast address line is the destination IOS uses when it sends a broadcast out of that interface; it defaults to the limited broadcast 255.255.255.255 and changes only with ip broadcast-address. The subnet's directed broadcast comes from the address and the mask: 192.168.10.0 OR 0.0.0.127 = 192.168.10.127. ip directed-broadcast only decides whether R1 forwards packets for 192.168.10.127 onto the LAN; it does not change this line, so the output is normal.
CCIECCIE EI v1.1 · CCIE SP v5.0Q8

A provider must number 500 point-to-point core links from one contiguous block, using /31s instead of /30s. What is the smallest block that holds them all?

  1. AA /21 (2048 addresses)
  2. BA /22 (1024 addresses)
  3. CA /23 (512 addresses)
  4. DA /24 (256 addresses)
Show answer
Answer: B. 500 links × 2 addresses = 1000, and the next power of two is 1024 = 210: a /22. With /30s every link takes 4 addresses (2000), which needs a /21, the most tempting wrong answer. A /23 holds only 256 /31 links.

Subnetting step by step: borrowed bits and the block size

CCNA 200-301 v1.1ENCOR 350-401 v1.2ENARSI 300-410CCIE EI v1.1

TL;DRTo subnet, you borrow host bits and turn them into subnet bits: s borrowed bits give 2s subnets, and the h host bits left give 2h − 2 hosts in each. The subnets start every block size (256 − the mask's interesting octet), so 192.168.1.0/24 cut into /27s gives eight subnets at .0, .32, .64 … .224, with 30 hosts each. To find a host's subnet, round its interesting octet down to a multiple of the block size.

The terms, in short
Borrowed bits (subnet bits)
Host bits that become network bits: /24 → /27 borrows 3 bits, leaving 5 host bits.
2s subnets
s borrowed bits give 2s subnets: 23 = 8 /27s in a /24, 24 = 16 /20s in a /16.
Block size
256 − the mask's interesting octet, the value of the lowest borrowed bit: 256 − 224 = 32, so the /27s start at .0, .32, .64…
Subnet ID
The first address of a block, all host bits 0. For a host, round its interesting octet down to a multiple of the block: 130 → 128.
Subnet zero, all-ones subnet
The first (.0/27) and the last (.224/27) subnets. Both are usable (RFC 1878); ip subnet-zero is the IOS default since 12.0.
Major (classful) network
The class A, B or C network the subnets come from; IOS groups them under it, with the one mask they share: 192.168.1.0/27 is subnetted, 8 subnets.

5.1The step-by-step animation

  1. The lab has one block, 192.168.1.0/24, and needs eight separate LANs, VLANs 101 to 108. As it stands it is a single subnet: 24 network bits, 8 host bits, 254 hosts in one broadcast domain. The prefix of the block is fixed, so the only bits you can use to make more subnets are the 8 host bits.block 192.168.1.0/24 · host bits 8 → 2^8 − 2 = 254 hosts · need 8 subnets
  2. Borrow host bits and turn them into subnet bits. Eight subnets need 3 bits, because 23 = 8. The prefix grows from /24 to /27 (mask 255.255.255.224) and 5 host bits remain: 25 − 2 = 30 hosts per subnet. Every bit you borrow doubles the number of subnets and halves their size.borrowed s = 3 → 2^3 = 8 subnets · host bits left h = 5 → 2^5 − 2 = 30 hosts · new mask 255.255.255.224 = /27
  3. Now list them. The block size is 256 − 224 = 32, the value of the lowest borrowed bit, so a new /27 starts every 32 addresses: .0, .32, .64, .96, .128, .160, .192, .224. The 3 violet bits count from 000 to 111; in each block the first address is the subnet, the last is its broadcast and the 30 in between are hosts. R1 takes the first host of each as the gateway of its VLAN.block size 256 − 224 = 32 · subnets .0 .32 .64 .96 .128 .160 .192 .224 · each subnet, 30 hosts, broadcast
  4. Which /27 holds the PC, 192.168.1.130? Divide the interesting octet by the block size and keep the whole part: 130 ÷ 32 = 4.06, and 4 × 32 = 128. The binary says the same: the three borrowed bits of 130 are 100, subnet 4, and AND-ing with the mask gives 192.168.1.128/27: hosts .129 to .158, broadcast .159. The PC sends off-subnet traffic to .129, R1's Gi0/1.105.host 192.168.1.130 · 130 ÷ 32 4.06 → 4 × 32 = 128 · subnet 192.168.1.128/27 · range .129 – .158, broadcast .159
  5. Exam questions usually go the other way: "you need 6 subnets with up to 30 hosts each from 192.168.1.0/24". Subnets: 2s ≥ 6 gives s = 3. Hosts: 2h − 2 ≥ 30 gives h = 5. 3 + 5 = 8 bits, exactly what the /24 has, so the answer is /27. The trap: 31 hosts need h = 6 (25 − 2 is only 30), and 3 + 6 = 9 bits do not fit in 8: no equal-size answer exists.subnets 2^s ≥ 6 → s = 3 · hosts 2^h − 2 ≥ 30 → h = 5 · check 3 + 5 = 8 bits → /27 · 31 hosts 3 + 6 = 9 bits > 8: no fit
  6. R1 advertises its eight connected /27s with OSPF; a single network 192.168.1.0 0.0.0.255 statement covers them all. R2 lists them under their classful network, 192.168.1.0, with the one mask they all share: 192.168.1.0/27 is subnetted, 8 subnets. The first (.0, subnet zero) and the last (.224, the all-ones subnet) are ordinary usable subnets: ip subnet-zero has been the IOS default since 12.0, so you count 2s subnets, not 2s − 2.R2 192.168.1.0/27 is subnetted, 8 subnets · subnet zero 192.168.1.0/27, usable · all-ones subnet 192.168.1.224/27, usable

5.2Simulator: the subnet splitter

A block, how to cut it, and a host to place

Give the block and either the new prefix or a requirement (subnets needed, hosts per subnet, or both). The splitter counts the subnets, lists them (the table stops at 64 rows) and finds the subnet that holds the host.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

8 subnets of /27 · 30 hosts each · block size 32 in octet 4

#SubnetUsable hostsBroadcast
#0192.168.1.0/27192.168.1.1 – 192.168.1.30192.168.1.31
#1192.168.1.32/27192.168.1.33 – 192.168.1.62192.168.1.63
#2192.168.1.64/27192.168.1.65 – 192.168.1.94192.168.1.95
#3192.168.1.96/27192.168.1.97 – 192.168.1.126192.168.1.127
#4192.168.1.128/27192.168.1.129 – 192.168.1.158192.168.1.159
#5192.168.1.160/27192.168.1.161 – 192.168.1.190192.168.1.191
#6192.168.1.192/27192.168.1.193 – 192.168.1.222192.168.1.223
#7192.168.1.224/27192.168.1.225 – 192.168.1.254192.168.1.255
192.168.1.0/24 → /27: 8 subnets, 30 hosts each
  • Borrowed bits: s = 27 − 24 = 3 → 23 = 8 subnets. Host bits left: h = 5 → 25 − 2 = 30 hosts.
  • Block size: 256 − 224 = 32 in octet 4, so the subnets start every 32 in that octet.
  • Subnet #0 (192.168.1.0/27, subnet zero) and #7 (192.168.1.224/27, the all-ones subnet) are usable like the others.
  • 192.168.1.130 is in subnet #4, 192.168.1.128/27 (hosts 192.168.1.129 – 192.168.1.158, broadcast 192.168.1.159). Shortcut: octet 4 is 130; 130 ÷ 32 rounded down is 4, × 32 = 128.

5.3The configuration, line by line

R1 · IOS-XE

1ip subnet-zeroThe default since IOS 12.0, so it does not even appear in the running configuration: subnet zero (192.168.1.0/27) is usable.
2interface GigabitEthernet0/1The 802.1Q trunk to SW1; each subinterface is one VLAN and one /27.
3 no shutdown
4interface GigabitEthernet0/1.101Subnet 0, borrowed bits 000: subnet zero.
5 encapsulation dot1Q 101
6 ip address 192.168.1.1 255.255.255.224192.168.1.0/27: gateway .1, hosts .1 – .30, broadcast .31.
7interface GigabitEthernet0/1.102Subnet 1 (001), one block of 32 further.
8 encapsulation dot1Q 102
9 ip address 192.168.1.33 255.255.255.224192.168.1.32/27: hosts .33 – .62, broadcast .63.
10interface GigabitEthernet0/1.103
11 encapsulation dot1Q 103
12 ip address 192.168.1.65 255.255.255.224192.168.1.64/27.
13interface GigabitEthernet0/1.104
14 encapsulation dot1Q 104
15 ip address 192.168.1.97 255.255.255.224192.168.1.96/27.
16interface GigabitEthernet0/1.105Subnet 4 (100): the one that holds the PC, 192.168.1.130.
17 encapsulation dot1Q 105
18 ip address 192.168.1.129 255.255.255.224192.168.1.128/27: hosts .129 – .158, broadcast .159.
19interface GigabitEthernet0/1.106
20 encapsulation dot1Q 106
21 ip address 192.168.1.161 255.255.255.224192.168.1.160/27.
22interface GigabitEthernet0/1.107
23 encapsulation dot1Q 107
24 ip address 192.168.1.193 255.255.255.224192.168.1.192/27.
25interface GigabitEthernet0/1.108Subnet 7 (111): the all-ones subnet.
26 encapsulation dot1Q 108
27 ip address 192.168.1.225 255.255.255.224192.168.1.224/27: its broadcast, .255, is also the broadcast of the whole /24, the old reason it was avoided.
28interface GigabitEthernet0/2Point-to-point link to R2.
29 ip address 10.0.12.1 255.255.255.252
30router ospf 1
31 network 192.168.1.0 0.0.0.255 area 0One statement with the /24 wildcard matches all eight /27 interfaces.
32 network 10.0.12.0 0.0.0.3 area 0

NX-OS · SVIs

1feature interface-vlanOn a Layer 3 switch the /27s live on SVIs; NX-OS needs the feature first.
2interface Vlan101
3 no shutdown
4 ip address 192.168.1.1/27Same subnet as Gi0/1.101, with a prefix length instead of a mask.
5interface Vlan105
6 no shutdown
7 ip address 192.168.1.129/27Subnet 4, the PC's gateway.
8! Vlan102-104 and Vlan106-108: the same pattern, every 32 addresses

Wrong

1no ip subnet-zeroBrings back the pre-RFC 1878 rule.
2interface GigabitEthernet0/1.101
3 ip address 192.168.1.1 255.255.255.224An address in subnet zero, 192.168.1.0/27.
4Bad mask /27 for address 192.168.1.1IOS refuses it. The all-ones subnet (.224/27) has always been allowed. Fix: ip subnet-zero, the default.

show ip route connected (R1)

1R1#show ip route connected
2 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
3C 10.0.12.0/30 is directly connected, GigabitEthernet0/2
4L 10.0.12.1/32 is directly connected, GigabitEthernet0/2
5 192.168.1.0/24 is variably subnetted, 16 subnets, 2 masksEight /27 C routes plus eight /32 L routes: two masks, so "variably subnetted" on R1 even though every subnet is a /27.
6C 192.168.1.0/27 is directly connected, GigabitEthernet0/1.101Subnet zero.
7L 192.168.1.1/32 is directly connected, GigabitEthernet0/1.101
8C 192.168.1.32/27 is directly connected, GigabitEthernet0/1.102
9L 192.168.1.33/32 is directly connected, GigabitEthernet0/1.102
10C 192.168.1.64/27 is directly connected, GigabitEthernet0/1.103
11L 192.168.1.65/32 is directly connected, GigabitEthernet0/1.103
12C 192.168.1.96/27 is directly connected, GigabitEthernet0/1.104
13L 192.168.1.97/32 is directly connected, GigabitEthernet0/1.104
14C 192.168.1.128/27 is directly connected, GigabitEthernet0/1.105
15L 192.168.1.129/32 is directly connected, GigabitEthernet0/1.105
16C 192.168.1.160/27 is directly connected, GigabitEthernet0/1.106
17L 192.168.1.161/32 is directly connected, GigabitEthernet0/1.106
18C 192.168.1.192/27 is directly connected, GigabitEthernet0/1.107
19L 192.168.1.193/32 is directly connected, GigabitEthernet0/1.107
20C 192.168.1.224/27 is directly connected, GigabitEthernet0/1.108The all-ones subnet, in the table like any other.
21L 192.168.1.225/32 is directly connected, GigabitEthernet0/1.108

show ip route (R2)

1R2#show ip route
2Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
3! (rest of the legend omitted)
4Gateway of last resort is not set
5 
6 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
7C 10.0.12.0/30 is directly connected, GigabitEthernet0/0
8L 10.0.12.2/32 is directly connected, GigabitEthernet0/0
9 192.168.1.0/27 is subnetted, 8 subnetsThe classful network 192.168.1.0, the one mask all its subnets share (/27, not the classful /24) and the count, 23 = 8. With a single mask the route lines below carry no length.
10O 192.168.1.0 [110/2] via 10.0.12.1, 00:12:41, GigabitEthernet0/0Subnet zero, learned like any other. Cost 2 = R2's link (1) + R1's subinterface (1).
11O 192.168.1.32 [110/2] via 10.0.12.1, 00:12:41, GigabitEthernet0/0
12O 192.168.1.64 [110/2] via 10.0.12.1, 00:12:41, GigabitEthernet0/0
13O 192.168.1.96 [110/2] via 10.0.12.1, 00:12:41, GigabitEthernet0/0
14O 192.168.1.128 [110/2] via 10.0.12.1, 00:12:41, GigabitEthernet0/0The PC's subnet.
15O 192.168.1.160 [110/2] via 10.0.12.1, 00:12:41, GigabitEthernet0/0
16O 192.168.1.192 [110/2] via 10.0.12.1, 00:12:41, GigabitEthernet0/0
17O 192.168.1.224 [110/2] via 10.0.12.1, 00:12:41, GigabitEthernet0/0The all-ones subnet.

The outputs are typical for IOS-XE; details may vary between versions.

5.4Remember

Critical for the exam
s borrowed bits give 2s subnets, the h host bits left give 2h − 2 hosts, and the block size is 256 − the interesting mask octet. 192.168.1.0/24 → /27: 3 bits borrowed, 8 subnets, 30 hosts each, block 32 (.0, .32 … .224). 172.16.0.0/16 → /20: 16 subnets of 4094.
Theory
The block size works because the borrowed bits are the high-order bits of the interesting octet: the lowest borrowed bit is worth 256 − mask (32 for /27), so each subnet starts one such step after the previous. Finding a host's subnet means zeroing its host bits, which is the same as rounding that octet down to a multiple of the block: 130 → 128.
Pitfall
Count 2s subnets, not 2s − 2: subnet zero and the all-ones subnet are usable (RFC 1878; ip subnet-zero by default since IOS 12.0). The −2 applies to hosts only. The old 2s − 2 rule comes from RFC 950 and still shows up in older study material.
Numbers
Mask octet → block size: 128 → 128, 192 → 64, 224 → 32, 240 → 16, 248 → 8, 252 → 4, 254 → 2, 255 → 1. Hosts per subnet: /25 126, /26 62, /27 30, /28 14, /29 6, /30 2. A /24 cut into /26s gives 4 subnets of 62; a /16 cut into /24s gives 256 subnets of 254.
Pitfall
Check both sides of a requirement. 6 subnets of 30 hosts fit a /24 exactly (/27: 3 + 5 bits), but 6 subnets of 31 hosts need 3 + 6 = 9 bits, one more than the /24 has. Six /26s take 384 addresses, so only a larger block (a /23) holds them; VLSM (§8) helps only when some of the subnets are smaller. Likewise 32 hosts need 6 host bits, because 25 − 2 = 30.
Platforms and standards
IOS has allowed subnet zero by default since 12.0 (the all-ones subnet was always allowed) and groups routes under their classful network. With one mask the header carries that mask (192.168.1.0/27 is subnetted, 8 subnets); with several it carries the classful mask (192.168.1.0/24 is variably subnetted, 16 subnets, 2 masks). On IOS 15+ the L /32 routes alone make a router's own connected subnets "variably subnetted". NX-OS prints each prefix on its own (192.168.1.0/27, ubest/mbest: 1/0, attached) with no classful parent line.
Verify withshow ip interface briefshow ip route connectedshow ip route 192.168.1.0 255.255.255.0 longer-prefixes

5.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

192.168.1.0/24 is cut into /27 subnets. Which subnet holds the host 192.168.1.130?

  1. A192.168.1.192/27
  2. B192.168.1.96/27
  3. C192.168.1.160/27
  4. D192.168.1.128/27
Show answer
Answer: D. The block size of a /27 is 256 − 224 = 32. 130 ÷ 32 = 4.06, and 4 × 32 = 128, so the host is in 192.168.1.128/27 (hosts .129 to .158, broadcast .159). 192.168.1.160/27 is the next subnet: rounding up instead of down is the classic slip.
CCNACCNA 200-301Q2

You must divide 192.168.1.0/24 into at least 6 subnets with at least 30 hosts each. Which mask do you use?

  1. A255.255.255.224
  2. B255.255.255.248
  3. C255.255.255.240
  4. D255.255.255.192
Show answer
Answer: A. 6 subnets need 3 borrowed bits (23 = 8) and 30 hosts need 5 host bits (25 − 2 = 30). 3 + 5 = 8 bits, so /27 = 255.255.255.224 is the only mask that meets both. 255.255.255.192 (/26) gives 62 hosts but only 4 subnets; 255.255.255.240 (/28) gives 16 subnets of only 14 hosts.
CCNACCNA 200-301Q3

How many /20 subnets does 172.16.0.0/16 contain, and how many usable hosts does each one have?

  1. A4096 subnets of 14 hosts
  2. B16 subnets of 4096 hosts
  3. C16 subnets of 4094 hosts
  4. D14 subnets of 4094 hosts
Show answer
Answer: C. /16 → /20 borrows 4 bits: 24 = 16 subnets, subnet zero and the all-ones subnet included. 12 host bits remain: 212 − 2 = 4094 hosts. 4096 also counts the network and broadcast addresses, and 14 subnets applies the old 2s − 2 rule that IOS dropped with ip subnet-zero.
CCNACCNA 200-301Q4

10.10.10.0/24 is subnetted with the mask 255.255.255.192. Counting subnet zero as the first, which is the third subnet?

  1. A10.10.10.96/26
  2. B10.10.10.192/26
  3. C10.10.10.64/26
  4. D10.10.10.128/26
Show answer
Answer: D. The block size is 256 − 192 = 64, so the /26 subnets are .0, .64, .128 and .192: the third is 10.10.10.128/26. 10.10.10.192/26 is what you get if you skip subnet zero, which has been usable since IOS 12.0. 10.10.10.64/26 is the second subnet, and .96 is not a /26 boundary at all (it needs a block size of 32).
ProfessionalENARSI 300-410Q5

R1 has eight subinterfaces, each with a /27 from 192.168.1.0/24. On R1, show ip route shows 192.168.1.0/24 is variably subnetted, 16 subnets, 2 masks; R2, which learns the same subnets through OSPF, shows 192.168.1.0/27 is subnetted, 8 subnets. Why the difference?

  1. AR1 also holds an L /32 route for each of its eight interface addresses
  2. BOne of R1's subinterfaces has a different mask, which only R1 can see
  3. COSPF advertises only the /27 subnets that have active hosts
  4. DR2 summarizes the /27s in pairs, so it shows half of the entries
Show answer
Answer: A. Since IOS 15 every interface address adds a C route for its subnet and an L /32 route for the address itself: 8 + 8 = 16 entries with two masks, so R1's header shows the classful /24 and "variably subnetted". OSPF advertises the eight /27 subnets, not the local /32s, so R2 has one mask and its header shows that mask, /27. Nothing is wrong with the design.
ProfessionalENARSI 300-410Q6

On a router running IOS 15, ip address 192.168.1.1 255.255.255.224 is entered on a subinterface. The address lies in subnet zero of 192.168.1.0/24. What happens?

  1. AIt is rejected with a Bad mask error, because RFC 950 reserves subnet zero
  2. BIt is accepted only while the all-ones subnet 192.168.1.224/27 stays unused
  3. CIt is accepted: ip subnet-zero is on by default since IOS 12.0
  4. DIt is accepted, but routing protocols will not advertise subnet zero
Show answer
Answer: C. RFC 950 originally excluded subnet zero and the all-ones subnet; RFC 1878 lifted the restriction and IOS made ip subnet-zero the default in 12.0. Only after no ip subnet-zero would IOS refuse the address with Bad mask /27 for address 192.168.1.1. The all-ones subnet has always been allowed and does not depend on subnet zero.
ProfessionalSPCOR 350-501Q7

A provider holds 172.20.0.0/16 and must give at least 200 customers equal-size subnets with as many hosts as possible. Which prefix does it use?

  1. A/22: 64 subnets of 1022 hosts
  2. B/25: 512 subnets of 126 hosts
  3. C/23: 128 subnets of 510 hosts
  4. D/24: 256 subnets of 254 hosts
Show answer
Answer: D. 200 subnets need 8 borrowed bits (27 = 128 is too few, 28 = 256 is enough): /16 + 8 = /24, which leaves 8 host bits and 254 hosts per subnet. /23 gives only 128 subnets; /25 also meets the count but halves the hosts, which the requirement rules out.
CCIECCIE EI v1.1Q8

An enterprise gives each branch a /26 from 10.64.0.0/16, in order, starting with 10.64.0.0/26 for branch 1. Which subnet does branch 600 receive?

  1. A10.64.150.0/26
  2. B10.64.149.128/26
  3. C10.64.150.64/26
  4. D10.64.149.192/26
Show answer
Answer: D. Branch 600 is subnet #599. Each /26 holds 64 addresses, so its offset is 599 × 64 = 38,336 = 149 × 256 + 192: 10.64.149.192/26. 10.64.150.0/26 belongs to branch 601, the off-by-one you get by numbering branch 1 as subnet #1. The /16 holds 210 = 1024 such /26s.

Private and public addresses: RFC 1918, shared space and NAT

CCNA 200-301 v1.1ENCOR 350-401 v1.2SPCOR 350-501 v1.1CCIE EI v1.1

TL;DRPrivate addresses (RFC 1918: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16) can be reused by every network because they are never routed on the Internet; public addresses are globally unique and come from IANA through a RIR and an ISP. A private host reaches the Internet only through NAT/PAT on the edge router, which swaps its source for a public address; a router that forgets NAT leaks private sources that the ISP drops. Carrier-grade NAT adds a second translation, using 100.64.0.0/10, the shared address space of RFC 6598.

The terms, in short
Private address (RFC 1918)
An address from 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16: free to use inside any network, never routed on the Internet. HQ uses 192.168.10.0/24.
Public address
Globally unique, delegated by IANA to a RIR (RIPE NCC, ARIN, APNIC, LACNIC, AFRINIC) and by the RIR to an ISP: R1's 198.51.100.2 stands for one in this guide.
NAT / PAT (overload)
The edge router rewrites the private source to a public address; PAT also rewrites the port, so the whole LAN shares the single address 198.51.100.2.
Inside local / inside global
The same host seen before and after translation: 192.168.10.37 inside, 198.51.100.2 on the Internet.
Bogon
An address that must never appear as a source on the Internet: RFC 1918, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, multicast, class E and unallocated space.
BCP 38 (RFC 2827)
Ingress filtering: the ISP accepts from a customer only sources inside the customer's own block (198.51.100.0/29), so spoofed and leaked sources die at the first hop.
CGN and shared address space
Carrier-grade NAT: the ISP translates its customers a second time. The link between the customer and the CGN uses 100.64.0.0/10 (RFC 6598), which clashes with nobody's RFC 1918 LAN.

6.1The step-by-step animation

  1. IPv4 has 232 addresses, about 4.3 billion, and IANA handed its last five /8 blocks to the five RIRs on 3 February 2011. Long before that, RFC 1918 set aside three blocks that anyone may use inside a network and that are never routed on the Internet: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. That is why HQ can number its LANs out of 192.168.10.0/24 without asking anybody, while R1 needs one public address from its ISP to talk to the Internet.private 10/8 · 172.16/12 · 192.168/16 · public unique, IANA → RIR → ISP · HQ 192.168.10.0/24 (private) · R1 outside 198.51.100.2 (public)
  2. The exam trap is the middle block. /12 fixes the first 12 bits: the 8 bits of 172 plus the first 4 bits of the second octet, 0001. The second octet can only run from 00010000 = 16 to 00011111 = 31, so the block ends at 172.31.255.255. In 172.32.0.1 the second octet is 0010 0000: the prefix bits differ, so the address is public, not private.172.16.0.0/12 172.16.0.0 – 172.31.255.255 · mask 255.240.0.0 · 172.32.0.1 public
  3. Host A opens https://203.0.113.10. The packet leaves with source 192.168.10.37:51000. R1 has ip nat inside on Gi0/0 and ip nat outside on Gi0/4, and the source matches the NAT-LAN ACL, so PAT rewrites it to 198.51.100.2:51000 and records the pair. The server answers 198.51.100.2; R1 finds the entry by the port and rewrites the destination back to 192.168.10.37.inside local 192.168.10.37:51000 · inside global 198.51.100.2:51000 · outside 203.0.113.10:443
  4. Now a router that forgot NAT: ip nat outside is missing on Gi0/4, so nothing is translated and the packet leaves R1 with its private source, 192.168.10.37. The ISP filters what its customers send (bogon filtering and BCP 38, RFC 2827): a 192.168.0.0/16 source is dropped at the first hop. Even without the filter it would fail, because no Internet router has a route back to 192.168.10.37.source 192.168.10.37 (not translated) · ISP filter deny 192.168.0.0/16 → dropped · without the filter the reply has no route back
  5. An ISP that has run out of public IPv4 puts its customers behind carrier-grade NAT. R1's WAN link is renumbered and R1 gets 100.64.1.1, from the shared address space 100.64.0.0/10 (RFC 6598), and R1 translates to it exactly as before (NAT #1). The ISP's CGN translates again, to an address of its public pool, 192.0.2.10 (NAT #2). The ISP could not safely use RFC 1918 space on this link: its customers already use it inside, and R1 could end up with the same prefix on both sides.inside 192.168.10.37:51000 · after R1 100.64.1.1:51000 · after the CGN 192.0.2.10:20480
  6. Private space has one more catch: it is unique only inside one organization. HQ buys a company that also numbered its LAN 192.168.10.0/24, and the two networks are joined. Host A asks for the new colleagues' file server, 192.168.10.150, but R1 has 192.168.10.128/26 as a connected route and delivers the packet to the local Host B. The fixes: renumber one side (the clean one); until then NAT one side into a free range such as 10.99.10.0/24; or keep the two in separate VRFs, which still need NAT to talk to each other.destination 192.168.10.150 · R1 route 192.168.10.128/26, connected · result delivered to the wrong host

6.2Simulator: can this host reach the Internet?

The host's address, NAT on R1 and what the ISP does

Host → R1 → ISP → server 203.0.113.10. Type any IPv4 address and switch NAT, the ISP's source filter and CGN on or off: the path shows the source address at every hop, and the verdict says whether the reply can come back.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

192.168.10.37: Private-Use · 192.168.0.0/16 · RFC 1918

HopSourceDestinationWhat happens
Host → R1192.168.10.37203.0.113.10203.0.113.10 is not on the host's subnet, so the packet goes to the default gateway, R1
R1 → ISP198.51.100.2203.0.113.10PAT on R1: 192.168.10.37:51000 → 198.51.100.2:51000 (inside local → inside global)
ISP → Internet198.51.100.2203.0.113.10Forwarded: the source is in your /29, so the filter permits it
Reply203.0.113.10198.51.100.2✓ R1 finds the PAT entry and rewrites 198.51.100.2 back to 192.168.10.37
Yes: R1 translates 192.168.10.37 to 198.51.100.2 (PAT)
  • R1 keeps the pair 192.168.10.37:51000 ↔ 198.51.100.2:51000 in its NAT table (show ip nat translations): every inside host shares the one public address, told apart by the port.

6.3The configuration, line by line

R1 · IOS-XE

1ip access-list standard NAT-LANWhich inside sources get translated. A deny here means "do not translate", not "drop".
2 permit 192.168.10.0 0.0.0.255The whole HQ block: Sales, Eng, Mgmt and the R1–R2 link (wildcard 0.0.0.255 = /24).
3!
4interface GigabitEthernet0/0Sales LAN, VLAN 10.
5 ip address 192.168.10.1 255.255.255.128
6 ip nat insidePackets arriving here are candidates for inside source translation.
7interface GigabitEthernet0/1Engineering LAN, VLAN 20.
8 ip address 192.168.10.129 255.255.255.192
9 ip nat inside
10interface GigabitEthernet0/4Toward the ISP: the only public address R1 has.
11 ip address 198.51.100.2 255.255.255.248198.51.100.0/29 from the ISP: .1 the ISP, .2 R1, .3 to .6 free for public hosts.
12 ip nat outsideThe translated side. Without it, nothing is translated at all.
13!
14ip nat inside source list NAT-LAN interface GigabitEthernet0/4 overloadPAT: every inside host shares 198.51.100.2, told apart by the source port. Without overload, one inside host at a time could use the single address.
15ip route 0.0.0.0 0.0.0.0 198.51.100.1The default route to the ISP. Inside-to-outside translation happens after routing has chosen Gi0/4.

Wrong · no NAT

1interface GigabitEthernet0/4
2 ip address 198.51.100.2 255.255.255.248
3! ip nat outsideMissing: R1 has inside interfaces but no outside one, so no packet crosses from inside to outside in the NAT sense.
4ip nat inside source list NAT-LAN interface GigabitEthernet0/4 overloadPresent, but useless on its own: show ip nat translations stays empty.
5! Result: 192.168.10.37 leaves R1 untranslated and the ISP drops itThe same leak happens when the ACL does not match the subnet (for example permit 192.168.1.0 0.0.0.255), because a deny in the NAT ACL means "send as it is".

R1 behind a CGN

1interface GigabitEthernet0/4
2 description To ISP with CGN (shared address space)
3 ip address 100.64.1.1 255.255.255.252The ISP has no public IPv4 left for R1: the WAN gets an address from 100.64.0.0/10 (often by DHCP: ip address dhcp). The ISP side of this /30 is 100.64.1.2.
4 ip nat outside
5ip nat inside source list NAT-LAN interface GigabitEthernet0/4 overloadUnchanged: R1 now translates to 100.64.1.1 (NAT #1).
6ip route 0.0.0.0 0.0.0.0 100.64.1.2
7! the ISP's CGN translates 100.64.1.1 to its public pool 192.0.2.0/24 (NAT #2)Inbound sessions now need a mapping on the CGN too: port forwarding on R1 alone no longer works.

show ip nat translations

1R1#show ip nat translations
2Pro Inside global Inside local Outside local Outside global
3tcp 198.51.100.2:51000 192.168.10.37:51000 203.0.113.10:443 203.0.113.10:443Host A's HTTPS session: inside local (private) ↔ inside global (public). The outside columns are equal: the server is not translated.
4tcp 198.51.100.2:51001 192.168.10.150:51000 203.0.113.10:443 203.0.113.10:443Host B picked the same source port, 51000: PAT gives it another free port on the global side (51001 here), so the replies can be told apart.
5icmp 198.51.100.2:7 192.168.10.37:7 203.0.113.10:7 203.0.113.10:7ICMP has no ports: the echo identifier plays their role.
6Total number of translations: 3

ISP · bogon ACL

1ip access-list extended CUST-R1-INOn the ISP router, inbound on the port that faces R1: it checks the source of everything the customer sends.
2 deny ip 0.0.0.0 0.255.255.255 any0.0.0.0/8, "this network" (§7).
3 deny ip 10.0.0.0 0.255.255.255 anyRFC 1918.
4 deny ip 100.64.0.0 0.63.255.255 anyShared address space: valid only between a CGN and its own subscribers. Wildcard 0.63.255.255 = /10.
5 deny ip 127.0.0.0 0.255.255.255 anyLoopback.
6 deny ip 169.254.0.0 0.0.255.255 anyLink-local (APIPA).
7 deny ip 172.16.0.0 0.15.255.255 anyRFC 1918: wildcard 0.15.255.255 = /12, so 172.16 to 172.31 only.
8 deny ip 192.168.0.0 0.0.255.255 anyRFC 1918: this line catches the 192.168.10.37 leak.
9 deny ip 224.0.0.0 31.255.255.255 any224.0.0.0/3: multicast and class E are never a valid source.
10 permit ip 198.51.100.0 0.0.0.7 anyBCP 38: the only sources R1 may use, its own /29. Public but foreign sources such as 172.32.1.1 fall to the implicit deny.
11interface GigabitEthernet0/1
12 description Customer R1
13 ip address 198.51.100.1 255.255.255.248
14 ip access-group CUST-R1-IN in
15! or: ip verify unicast source reachable-via rxuRPF in strict mode: the same BCP 38 check, driven by the routing table instead of an ACL to maintain (BCP 84, RFC 3704).

show access-lists (ISP)

1ISP#show access-lists CUST-R1-IN
2Extended IP access list CUST-R1-IN
3 10 deny ip 0.0.0.0 0.255.255.255 any
4 20 deny ip 10.0.0.0 0.255.255.255 any
5 30 deny ip 100.64.0.0 0.63.255.255 any
6 40 deny ip 127.0.0.0 0.255.255.255 any
7 50 deny ip 169.254.0.0 0.0.255.255 any
8 60 deny ip 172.16.0.0 0.15.255.255 any
9 70 deny ip 192.168.0.0 0.0.255.255 any (12 matches)The leak from step 4: twelve packets from 192.168.10.37 dropped while NAT was broken.
10 80 deny ip 224.0.0.0 31.255.255.255 any
11 90 permit ip 198.51.100.0 0.0.0.7 any (48210 matches)Normal traffic, translated to 198.51.100.2.

The outputs are typical for IOS-XE; details may vary between versions.

6.4Remember

Critical for the exam
RFC 1918 reserves exactly three blocks: 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16. Anything else is public unless it is in a special-purpose block (§7): 172.32.0.1 and 192.169.0.1 are public. 100.64.0.0/10 is shared address space for CGN (RFC 6598), not RFC 1918.
Theory
Private space works because Internet routing never carries those prefixes: the same 192.168.10.0/24 can exist in a million companies without conflict, as long as every packet that leaves is translated. PAT tells the inside hosts apart by the source port, so a whole LAN shares the single public address 198.51.100.2 (the NAT guide covers static NAT, pools, PAT and timeouts).
Pitfall
172.16.0.0/12 is the classic trap: the /12 fixes the first 4 bits of the second octet (0001), so only 16 to 31 qualify. A LAN numbered 172.32.1.0/24 "because it looks private" works behind NAT, but its users can no longer reach the real 172.32.1.0/24 hosts on the Internet, and without NAT the ISP's BCP 38 filter drops every packet as spoofed.
Numbers
10.0.0.0/8 = 16,777,216 addresses; 172.16.0.0/12 = 1,048,576; 192.168.0.0/16 = 65,536; 100.64.0.0/10 = 4,194,304. IANA gave the last five /8 blocks to the five RIRs on 3 February 2011; ARIN ran out of its free pool in September 2015 and RIPE NCC made its last /22 allocation in November 2019.
Pitfall
A router that forgets ip nat outside, or whose NAT ACL does not match the LAN, sends private sources to the ISP: bogon filters drop them, and even without a filter the replies have no route back. The symptom: show ip nat translations is empty while the default route and the ISP link look fine.
Platforms and standards
BCP 38 is RFC 2827 (ingress filtering) and BCP 84 is RFC 3704 (uRPF for multihomed sites): on IOS ip verify unicast source reachable-via rx (strict) or any (loose). RFC 6598 says packets from or to 100.64.0.0/10 must not cross provider boundaries, and RFC 6888 lists the CGN requirements. NX-OS needs feature nat before any NAT command; IOS-XR CGN (CGv6) typically runs on service cards, such as the ASR 9000 VSM, rather than as an interface command.
Verify withshow ip nat translationsshow ip nat statisticsshow ip interface GigabitEthernet0/4 | include translationshow access-lists CUST-R1-IN

6.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

A junior admin plans four LAN ranges and wants every one of them to be RFC 1918 private space. Which range is not private?

  1. A10.255.0.0/24
  2. B192.168.200.0/24
  3. C172.31.255.0/24
  4. D172.32.10.0/24
Show answer
Answer: D. 172.16.0.0/12 covers only 172.16.0.0 to 172.31.255.255: the /12 fixes the first four bits of the second octet to 0001, so only 16 to 31 qualify. 172.32.10.0/24 is public space that belongs to someone else. 172.31.255.0/24 is the last /24 inside the /12, and the other two sit inside 10.0.0.0/8 and 192.168.0.0/16.
CCNACCNA 200-301Q2

Which range is exactly the private block written as 172.16.0.0/12?

  1. A172.0.0.0 to 172.31.255.255
  2. B172.16.0.0 to 172.16.255.255
  3. C172.16.0.0 to 172.32.255.255
  4. D172.16.0.0 to 172.31.255.255
Show answer
Answer: D. A /12 keeps 20 host bits: 220 = 1,048,576 addresses, which is 16 values of the second octet starting at 16 (16 to 31). 172.16.0.0 to 172.16.255.255 is only a /16, the reflex of reading the block as 172.16.x.x. 172.32 is already outside the block, and 172.0 to 172.15 were never private.
CCNACCNA 200-301Q3

On R1, show ip nat translations shows tcp 198.51.100.2:51000 192.168.10.37:51000 203.0.113.10:443 203.0.113.10:443. What is 198.51.100.2 in this entry?

  1. AThe outside local address of the web server, seen from the LAN
  2. BThe inside global address: Host A as the Internet sees it
  3. CThe inside local address: Host A's own configured address
  4. DThe outside global address of the web server
Show answer
Answer: B. The columns are inside global, inside local, outside local, outside global. 198.51.100.2 is the inside global address, R1's public address that PAT gave to Host A's session; 192.168.10.37 is the inside local address configured on Host A. Both outside columns hold 203.0.113.10 because the server is not translated.
CCNACCNA 200-301Q4

R1 still has ip nat inside on its LAN interfaces and the overload rule, but someone removed ip nat outside from Gi0/4, its link to the ISP. Host A (192.168.10.37) opens a page on 203.0.113.10. What happens?

  1. AR1 drops it itself, because the NAT ACL matches but no interface is marked outside
  2. BIt leaves R1 untranslated, with source 192.168.10.37, and no reply ever comes back
  3. CR1 still translates it to 198.51.100.2, because the overload rule names Gi0/4
  4. DThe ISP's router translates 192.168.10.37 for R1, and the page loads normally
Show answer
Answer: B. NAT only translates packets that cross from an inside interface to an outside one; without ip nat outside nothing is translated and R1 routes the packet as it is. A private source is a bogon: the ISP's ingress filter drops it, and even without a filter no Internet router has a route back to 192.168.10.37. The overload rule naming Gi0/4 does not mark Gi0/4 as outside.
ProfessionalSPCOR 350-501Q5

Why does an ISP number the links between its customers' routers and its carrier-grade NAT from 100.64.0.0/10 rather than from 10.0.0.0/8?

  1. AA CGN cannot translate 10.0.0.0/8, because it is a classful class A network
  2. BCustomers already use RFC 1918 inside, so a 10.x link could overlap their own LAN
  3. C100.64.0.0/10 is routable on the Internet, so the CGN does not need a second translation
  4. DRFC 1918 forbids ISPs from using private addresses on any link they operate
Show answer
Answer: B. RFC 6598 reserved 100.64.0.0/10 (4,194,304 addresses) as shared address space precisely because the space between the CPE and the CGN must not clash with whatever RFC 1918 range the customer uses inside. It is not routed on the Internet either, so the CGN still translates it to a public address. RFC 1918 does not forbid ISPs anything; it simply cannot guarantee uniqueness.
ProfessionalENARSI 300-410 · SPCOR 350-501Q6

The ISP filters its port toward R1 so that it accepts only sources in 198.51.100.0/29 (BCP 38). Which packet sent by R1 is dropped?

  1. ASource 198.51.100.2, destination 203.0.113.10
  2. BSource 198.51.100.2, destination 172.32.1.1
  3. CSource 172.32.1.1, destination 203.0.113.10
  4. DSource 198.51.100.6, destination 192.0.2.25
Show answer
Answer: C. 198.51.100.0/29 runs from .0 to .7, so sources .2 and .6 pass. 172.32.1.1 is a public address, but not R1's: to the ISP it is a spoofed source and BCP 38 (RFC 2827) drops it. An ingress filter checks the source, so a packet whose destination is 172.32.1.1 is not affected.
CCIECCIE EI v1.1Q7

After an acquisition both companies use 192.168.10.0/24, and they must exchange traffic before anyone has time to renumber. Which design lets hosts on both sides reach each other?

  1. ANAT one side into a free range, such as 10.99.10.0/24, on the border router
  2. BEnable proxy ARP on the border router, so it answers ARP for the partner's hosts
  3. CPut each company in its own VRF on the border router and leak 192.168.10.0/24 between the two VRFs
  4. DAdd a static route for the partner's 192.168.10.0/24 with a lower administrative distance than the connected route
Show answer
Answer: A. Overlapping space can only be reached through addresses that are unique from the sender's point of view, which is what NAT provides (outside source NAT, or NAT in both directions). VRFs keep the two tables apart, but leaking the identical prefix recreates the conflict. A connected route has administrative distance 0, which no static route can beat, and proxy ARP cannot help either: the local Host B already answers for 192.168.10.150.
ProfessionalSPCOR 350-501Q8

A subscriber behind its home router (NAT #1) and the ISP's CGN (NAT #2) forwards TCP 8443 on the home router to an inside server. Users on the Internet still cannot connect. Why?

  1. AThe home router must forward the port to its own 100.64.x.x WAN address, not to the server
  2. BInbound connections reach the CGN's public address, where no mapping exists for TCP 8443
  3. CThe CGN blocks every destination port above 1023, so the server must use TCP 443
  4. DTCP sessions cannot cross two layers of NAT, so the server must switch to UDP
Show answer
Answer: B. Behind a CGN the address the world sees belongs to the ISP's pool, shared by many subscribers. An inbound connection to it reaches the CGN, which has no entry for TCP 8443 unless the ISP creates one (or offers port control such as PCP). Outbound sessions work through both NATs; the limitation is only for connections that start outside.

Special IPv4 addresses: loopback, APIPA, broadcasts and the other exceptions

CCNA 200-301 v1.1ENCOR 350-401 v1.2ENARSI 300-410CCIE EI v1.1

TL;DRSome IPv4 blocks are not ordinary host addresses, and the IANA special-purpose registry (RFC 6890) says for each one whether it may be a source, a destination, and whether routers forward it. The ones you meet daily: 0.0.0.0 (a host with no address yet), 127.0.0.0/8 (the host itself), 169.254.0.0/16 (APIPA, when DHCP fails), 255.255.255.255 (this link only), 224.0.0.0/4 (multicast, with 224.0.0.0/24 never routed) and 240.0.0.0/4 (reserved). Routers never forward 0.0.0.0, loopback, APIPA, the limited broadcast or 224.0.0.0/24, and since IOS 12.0 they also drop directed broadcasts such as 192.168.10.191 by default.

The terms, in short
Limited broadcast
255.255.255.255: every host on this link, never forwarded by a router. The DHCP Discover is sent to it.
Directed broadcast
The all-ones host address of one subnet, such as 192.168.10.191 for 192.168.10.128/26: routed like unicast to the last router, which drops it by default.
Loopback (127.0.0.0/8)
The host's own IP stack: ping 127.0.0.1 never touches the network card. Not the same as a router's Loopback0 interface.
APIPA (IPv4 link-local)
169.254.0.0/16, self-assigned when DHCP fails (RFC 3927): mask 255.255.0.0, no gateway, reachable only on the same link.
0.0.0.0
"This host": the source of a DHCP Discover. Written 0.0.0.0/0 it is the default route, a prefix that matches every destination.
DHCP relay (ip helper-address)
R1 turns the client's broadcast into a unicast to the server, with giaddr = its own address on the client subnet (192.168.10.1).
Link-local multicast (224.0.0.0/24)
Groups for protocols on one link, such as 224.0.0.5 (OSPF) and 224.0.0.10 (EIGRP): never forwarded off the link, whatever the TTL.

7.1The step-by-step animation

  1. A new laptop on the Sales LAN boots with no address at all. Its first DHCP Discover uses the two addresses that need no configuration: source 0.0.0.0 ("this host", RFC 1122) and destination 255.255.255.255, the limited broadcast ("everyone on this link"). The destination MAC is ffff.ffff.ffff, so SW1 floods the frame to every port in VLAN 10: the printer and Host A ignore it, and R1's Gi0/0 receives it too.src 0.0.0.0:68 · dst 255.255.255.255:67 · dst MAC ffff.ffff.ffff · message DHCPDISCOVER
  2. R1 never forwards a limited broadcast: it is the edge of the broadcast domain. But Gi0/0 has ip helper-address 192.168.10.226, so R1 acts as a DHCP relay: it rebuilds the Discover as a unicast from 192.168.10.1 to R2 and writes giaddr 192.168.10.1 into it, which tells R2 to lease from the pool that contains that subnet. Today R2's DHCP service is down: no Offer ever comes back.relayed src 192.168.10.1 · relayed dst 192.168.10.226 · giaddr 192.168.10.1 · answer none: the server is down
  3. After its retries fail, the laptop configures itself (APIPA, RFC 3927). It picks a random address between 169.254.1.0 and 169.254.254.255, here 169.254.23.45, sends ARP probes with sender IP 0.0.0.0 to make sure nobody else has it, and keeps it with mask 255.255.0.0 and no default gateway. Windows shows it as "Autoconfiguration IPv4 Address": the classic sign that DHCP failed, not that someone typed a wrong address.address 169.254.23.45 · mask 255.255.0.0 (/16) · gateway none · ARP probe sender IP 0.0.0.0
  4. With a link-local address the laptop reaches only other 169.254.x.x hosts on the same link. The printer also failed DHCP and picked 169.254.77.3: same /16, so the laptop ARPs for it directly and the ping works. Anything else needs a router, and the laptop has no gateway; RFC 3927 also forbids routers to forward a packet with a 169.254.0.0/16 source or destination. In the background, Windows retries DHCP every five minutes.ping 169.254.77.3 reply: same link · ping 192.168.10.1 no route, no gateway · routers never forward 169.254.0.0/16
  5. Now Host A pings 192.168.10.191. With its /25 mask that is not its own subnet, so A sends an ordinary unicast to its gateway. R1 sees that .191 has all six host bits of the Engineering subnet 192.168.10.128/26 set to 1: it is that subnet's directed broadcast. Since IOS 12.0 the default is no ip directed-broadcast (RFC 2644), so R1 drops it instead of flooding it on Gi0/1 as ffff.ffff.ffff.destination 192.168.10.191 · Host A (/25) not my subnet → gateway R1 · R1 Gi0/1 (/26) the subnet's broadcast
  6. Why that default exists: someone types ip directed-broadcast on Gi0/1, to wake PCs with Wake-on-LAN for example. Now a compromised Host A sends one ping to 192.168.10.191 with a spoofed source, R2's 192.168.10.226. R1 floods it on the Engineering LAN and every host that answers broadcast pings replies to the victim: one packet in, up to 62 replies out of a /26. That is the smurf attack, and the reason RFC 2644 changed the default for routers in 1999.src 192.168.10.226 (spoofed: the victim) · dst 192.168.10.191 · result the Eng hosts reply to R2
  7. The rule behind the whole section: R1 is the boundary. The limited broadcast, link-local 169.254.0.0/16, link-local multicast 224.0.0.0/24 (OSPF hellos to 224.0.0.5, EIGRP to 224.0.0.10) and loopback 127.0.0.0/8 never cross it; a directed broadcast is routed up to the last router, which drops it by default. DHCP crosses only because the helper turns the broadcast into a unicast: with R2's DHCP service back up, the laptop finally gets 192.168.10.50 from the SALES pool.crosses R1 unicast, and DHCP through the helper · stops at R1 255.255.255.255, 169.254/16, 224.0.0.x, directed bc

7.2Simulator: look an address up in the special-purpose registry

Any IPv4 address, optionally with the prefix of its subnet

The lookup does what the IANA registry (RFC 6890) does: the most specific block, its purpose, and whether the address may be a source or a destination, whether routers forward it and whether it is reachable from the Internet. Add the subnet's prefix, as in 192.168.10.191/26, to spot network and directed-broadcast addresses.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

127.1.2.3Registry answer
Most specific block127.0.0.0/8 · Loopback
Also inside—
StandardRFC 1122
PurposeThe host itself; never leaves the IP stack
Valid as sourceNo: never on the wire
Valid as destinationNo: never on the wire
Forwarded by routersNo: never leaves the host
Globally reachableNo
On EthernetNone: it never reaches the network card
Class (historical, §2)A: first bits 0
127.1.2.3 is loopback (127.0.0.0/8): the host talking to itself
  • The whole /8 is loopback, not only 127.0.0.1: 127.1.2.3 answers too, and none of it ever leaves the IP stack.
  • ping 127.0.0.1 tests the host's own TCP/IP stack: it succeeds with the cable unplugged, so it proves nothing about the network.
  • A router's interface Loopback0 is a different thing: a virtual interface with an ordinary address such as 10.255.0.1/32 (§4).

7.3The configuration, line by line

R1 · IOS-XE

1interface GigabitEthernet0/0Sales LAN, VLAN 10: the DHCP clients live here.
2 ip address 192.168.10.1 255.255.255.128The relay's address on the client subnet: it becomes giaddr, and R2 picks the pool that contains it.
3 ip helper-address 192.168.10.226On the interface that faces the clients. UDP broadcasts arriving here (DHCP and seven other services by default) are relayed as unicasts to R2.
4!
5interface GigabitEthernet0/1Engineering LAN, VLAN 20: 192.168.10.128/26, directed broadcast .191.
6 ip address 192.168.10.129 255.255.255.192
7 ! no ip directed-broadcastThe default since IOS 12.0, so the running-config does not show it: packets to 192.168.10.191 from other subnets are dropped.
8!
9no ip forward-protocol udp tftpOptional trimming. By default the helper relays TFTP (69), DNS (53), Time (37), NetBIOS (137, 138), TACACS (49), IEN-116 (42) and BOOTP/DHCP (67, 68); remove what must not cross.

R2 · DHCP server

1ip dhcp excluded-address 192.168.10.1 192.168.10.49Never leased: the gateway .1 and the static hosts, Host A (.37) among them.
2ip dhcp pool SALES
3 network 192.168.10.0 255.255.255.128R2 chooses this pool because the relayed Discover carries giaddr 192.168.10.1, which falls inside it.
4 default-router 192.168.10.1Option 3: the gateway the clients receive. Without it they get an address but no way off the LAN.
5 dns-server 192.168.10.194Option 6: a DNS server in the Management subnet.
6 lease 0 8Eight hours instead of the default one day.
7!
8interface GigabitEthernet0/0R2's end of the R1–R2 link.
9 ip address 192.168.10.226 255.255.255.252
10ip route 192.168.10.0 255.255.255.0 192.168.10.225The Offer goes back as a unicast to giaddr 192.168.10.1: R2 needs a route to it.

Wrong

1interface GigabitEthernet0/1
2 ip directed-broadcastPackets to 192.168.10.191 from any other subnet are now flooded on the Eng LAN as ffff.ffff.ffff: one spoofed ping, up to 62 replies (the smurf attack).
3! safer: ip directed-broadcast 110Only what ACL 110 permits is converted, for example Wake-on-LAN (UDP 9) from one management station.
4! access-list 110 permit udp host 192.168.10.194 host 192.168.10.191 eq 9
5interface GigabitEthernet0/0
6 ! ip helper-address 192.168.10.226A missing helper: the Discover dies at R1 and every client ends up on 169.254.x.y, exactly as if the server were down.

show ip interface

1R1#show ip interface GigabitEthernet0/0 | include Internet|Helper|Directed
2 Internet address is 192.168.10.1/25
3 Helper address is 192.168.10.226The relay is set on the client side.
4 Directed broadcast forwarding is disabled
5R1#show ip interface GigabitEthernet0/1 | include Internet|Helper|Directed
6 Internet address is 192.168.10.129/26
7 Helper address is not set
8 Directed broadcast forwarding is disabledThe default: packets to 192.168.10.191 are dropped instead of flooded on this LAN. With the wrong configuration this line says "enabled".

NX-OS · IOS-XR

1! NX-OS: the relay is a feature
2feature dhcpWithout it, the relay command does not exist.
3interface Vlan10NX-OS switches route on SVIs, which need feature interface-vlan.
4 ip address 192.168.10.1/25
5 ip dhcp relay address 192.168.10.226The NX-OS form of ip helper-address.
6! IOS-XR: a relay profile bound to the interface
7dhcp ipv4
8 profile RELAY relay
9 helper-address vrf default 192.168.10.226
10 interface GigabitEthernet0/0/0/0 relay profile RELAYThe profile is attached per interface, under dhcp ipv4.

Laptop · Windows

1C:\> ipconfig
2Ethernet adapter Ethernet:
3 Autoconfiguration IPv4 Address. . : 169.254.23.45"Autoconfiguration" = APIPA: the laptop chose this address itself after DHCP got no answer.
4 Subnet Mask . . . . . . . . . . . : 255.255.0.0Always /16 for link-local.
5 Default Gateway . . . . . . . . . :Empty: nothing beyond the link is reachable.
6C:\> ipconfig /renew
7An error occurred while renewing interface Ethernet : unable to contact your DHCP server. Request has timed out.The proof: Discovers leave, no Offer comes back. Check the VLAN, the helper and the server.
8C:\> ping 127.0.0.1
9Reply from 127.0.0.1: bytes=32 time<1ms TTL=128Loopback answers even with the cable unplugged: it tests the TCP/IP stack, not the network.

The outputs are typical for IOS-XE and Windows; details may vary between versions.

7.4Remember

Critical for the exam
Recognize them on sight: 127.0.0.0/8 loopback (the whole /8, not only 127.0.0.1), 169.254.0.0/16 APIPA, 255.255.255.255 limited broadcast, 224.0.0.0/4 multicast (224.0.0.0/24 link-local), 240.0.0.0/4 class E, 0.0.0.0 "this host" (a source only) and 0.0.0.0/0 the default route. None of these single addresses can be a host's interface address.
Theory
A router is the edge of a broadcast domain: if it forwarded 255.255.255.255, one ARP or DHCP broadcast would reach every host of every network. That is why DHCP needs a relay (ip helper-address), which turns the broadcast into a unicast carrying giaddr, and why a directed broadcast travels as unicast until the last router, which decides whether to flood it.
Pitfall
169.254.x.x on a host is a symptom, not a configuration: the host asked DHCP and nobody answered. Check the link and the VLAN, the ip helper-address on the client-facing interface, the server, its pool and its route back to the giaddr. Typing a 169.254 address by hand fixes nothing.
Numbers
127.0.0.0/8 = 16,777,216 addresses for one function. APIPA picks from 169.254.1.0 to 169.254.254.255 (the first and last 256 are reserved, RFC 3927). Link-local multicast: 224.0.0.1 all hosts, .2 all routers and HSRPv1, .5 and .6 OSPF, .9 RIPv2, .10 EIGRP, .13 PIM, .18 VRRP, .102 HSRPv2. Documentation: 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 (RFC 5737); benchmarking 198.18.0.0/15 (RFC 2544).
Pitfall
Limited and directed broadcasts are different questions. 255.255.255.255 never leaves the link; 192.168.10.191 (the broadcast of 192.168.10.128/26) is routed as unicast to R1, which drops it because no ip directed-broadcast is the default since IOS 12.0 (RFC 2644). Enabling it for Wake-on-LAN turns the LAN into a smurf amplifier unless an ACL limits it (ip directed-broadcast 110).
Platforms and standards
Windows shows APIPA as "Autoconfiguration IPv4 Address" and retries DHCP every 5 minutes; macOS also self-assigns 169.254.x.x; most Linux distributions do it only when configured to (NetworkManager's link-local method, avahi-autoipd). IOS relays with ip helper-address, NX-OS with ip dhcp relay address after feature dhcp, IOS-XR with a dhcp ipv4 relay profile. The list itself is IANA's IPv4 Special-Purpose Address Registry (RFC 6890).
Verify withshow ip interface GigabitEthernet0/0show ip interface GigabitEthernet0/1 | include Directedshow ip dhcp bindingshow ip dhcp pool SALESdebug ip dhcp server packet

7.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

A Windows PC shows Autoconfiguration IPv4 Address 169.254.37.5, mask 255.255.0.0 and no default gateway. What is the most likely cause?

  1. AThe DHCP server leased it an address from a 169.254.0.0/16 pool
  2. BIts default gateway stopped answering, so it swapped its address for a link-local one
  3. CIt detected a duplicate static address and moved to its 169.254 backup range
  4. DDHCP got no answer, so the PC assigned itself a link-local address (APIPA)
Show answer
Answer: D. 169.254.0.0/16 is IPv4 link-local (RFC 3927): a host picks it itself when DHCP fails, and Windows labels it "Autoconfiguration". No DHCP server hands it out and it has nothing to do with the gateway's state. The fix is on the DHCP path: the link, the VLAN, the ip helper-address, the server and its pool.
CCNACCNA 200-301Q2

Which source and destination addresses does a client use in its first DHCP Discover?

  1. A0.0.0.0 to 255.255.255.255
  2. B127.0.0.1 to its subnet's broadcast address
  3. C169.254.x.y to 255.255.255.255
  4. D0.0.0.0 to 224.0.0.1
Show answer
Answer: A. The client has no address yet, so it uses 0.0.0.0 ("this host", RFC 1122) as the source, and it does not know its subnet, so it sends to the limited broadcast 255.255.255.255 (UDP 68 to 67). A 169.254 address appears only after DHCP has failed, 224.0.0.1 is the all-hosts multicast group and 127.0.0.1 never leaves the host.
CCNACCNA 200-301Q3

Which multicast address does EIGRP use for its hellos and updates?

  1. A224.0.0.5
  2. B224.0.0.18
  3. C224.0.0.9
  4. D224.0.0.10
Show answer
Answer: D. EIGRP uses 224.0.0.10. 224.0.0.9 is RIPv2, 224.0.0.5 is OSPF (all OSPF routers) and 224.0.0.18 is VRRP. All of them are in 224.0.0.0/24, the link-local block that routers never forward.
CCNACCNA 200-301Q4

Host A (192.168.10.37/25) pings 192.168.10.191. R1 is its gateway and has 192.168.10.129/26 on Gi0/1, with the default configuration. What happens?

  1. AR1 floods it on Gi0/1 and every host in 192.168.10.128/26 replies to Host A
  2. BHost A floods it in its own VLAN, because .191 is a broadcast address
  3. CA sends it to R1 as a unicast, and R1 drops it as a directed broadcast
  4. DR1 sends it toward the ISP, because .191 is outside every connected subnet
Show answer
Answer: C. For Host A's /25, .191 is a remote address, so it goes to the gateway as an ordinary unicast. For R1 it is the broadcast of the connected 192.168.10.128/26 (host bits all 1), a directed broadcast, and no ip directed-broadcast has been the default since IOS 12.0 (RFC 2644). Only with ip directed-broadcast on Gi0/1 would every Engineering host reply.
ProfessionalENARSI 300-410Q5

R1 has ip helper-address 192.168.10.226 on Gi0/0 and no other related commands. Besides DHCP, which client broadcast does it also relay to 192.168.10.226 by default?

  1. AAn OSPF hello sent to 224.0.0.5
  2. BA TFTP request to UDP port 69
  3. CAn ICMP echo sent to 255.255.255.255
  4. DAn ARP request for the server's MAC address
Show answer
Answer: B. ip helper-address relays UDP broadcasts for eight services by default: TFTP (69), DNS (53), Time (37), NetBIOS name and datagram (137, 138), TACACS (49), IEN-116 (42) and BOOTP/DHCP (67, 68). ARP is not IP at all, OSPF hellos are link-local multicast, and ICMP is not UDP. no ip forward-protocol udp tftp removes TFTP from the list.
ProfessionalENARSI 300-410Q6

Clients behind R1's Gi0/0 (192.168.10.1/25, helper 192.168.10.226) get no address. On R2 the pool is network 192.168.10.0 255.255.255.128, and a debug shows the relayed Discovers arriving. What most likely breaks it?

  1. AThe pool must use 192.168.10.224/30, the subnet where R2 itself is
  2. BThe clients must send their Discover to 192.168.10.226 instead of 255.255.255.255
  3. CR1 needs ip directed-broadcast on Gi0/0 to deliver the Offer to the clients
  4. DR2 has no route back to the giaddr 192.168.10.1, so its Offers are lost
Show answer
Answer: D. The relay writes its client-side address, 192.168.10.1, as giaddr; R2 uses it to pick the SALES pool and sends the Offer back to it as a unicast. Without a route to 192.168.10.0/25 the Offer is lost. The pool must match the clients' subnet, not R2's link, directed broadcasts play no part, and clients without an address cannot know the server's address.
CCIECCIE EI v1.1Q7

R1's Gi0/0 (192.168.10.1/25, ip helper-address 192.168.10.226) gets an inbound anti-spoofing ACL: permit ip 192.168.10.0 0.0.0.127 any, then the implicit deny. Hosts with static addresses keep working, but new DHCP clients get no lease. Which entry must be added before the permit?

  1. Apermit udp host 0.0.0.0 eq 68 host 255.255.255.255 eq 67
  2. Bpermit udp any host 192.168.10.226 eq 67
  3. Cpermit udp host 192.168.10.1 eq 67 any eq 68
  4. Dpermit udp 169.254.0.0 0.0.255.255 host 255.255.255.255 eq 67
Show answer
Answer: A. A client without an address sends its Discover, and its first Request, from 0.0.0.0:68 to 255.255.255.255:67; the anti-spoofing line permits only 192.168.10.0/25 sources, so the inbound ACL drops them before the helper sees them. The unicast to 192.168.10.226 is built by R1 itself after the ACL, so a line for it on Gi0/0 inbound never matches. A 169.254 source appears only after DHCP has failed, and server-to-client traffic does not enter Gi0/0.
ProfessionalENCOR 350-401Q8

Which statement about 224.0.0.0/24 is true?

  1. AIt is the administratively scoped range, private to one organization
  2. BRouters forward it only on interfaces where PIM sparse mode is enabled
  3. CHosts may use an address from it as the source of a multicast stream
  4. DRouters never forward it, even with PIM enabled on every interface
Show answer
Answer: D. 224.0.0.0/24 is the local network control block (RFC 5771): routing and first-hop protocols use it for hellos (224.0.0.5 OSPF, 224.0.0.10 EIGRP, 224.0.0.18 VRRP), and routers never forward it off the link, whatever its TTL (VRRP even sends it with TTL 255). PIM forwards other groups; the administratively scoped range is 239.0.0.0/8 (RFC 2365); and a multicast address is never a source.

VLSM: subnets of different sizes, largest first

CCNA 200-301 v1.1ENARSI 300-410CCIE EI v1.1

TL;DRVLSM gives every subnet the prefix length its own need calls for, instead of one mask for all. Sort the needs largest first, round each one up to a power of two that also holds the 2 reserved addresses, and place each block at the next free address, which is then always on its boundary. HQ's 192.168.10.0/24 becomes Sales /25, Engineering /26, Management /27 and the R1–R2 link /30, with 28 addresses left to grow; a classless routing protocol carries each mask.

The terms, in short
VLSM
Variable-length subnet masking: different prefix lengths inside one block, here a /25, a /26, a /27 and a /30 inside 192.168.10.0/24.
FLSM
Fixed-length subnet masking: one mask for every subnet (§5). The /24 cut into /26s gives 4 subnets of 62 hosts, too small for Sales (100).
Block size
232 − prefix addresses: 128 for a /25, 64 for a /26, 32 for a /27, 4 for a /30. A need of h hosts takes the smallest block with 2n − 2 ≥ h.
Block boundary
A block starts at a multiple of its own size: a /26 at .0, .64, .128 or .192 only. 192.168.10.4 cannot start a /27.
Largest first
Allocating in decreasing size puts every block on its boundary with no gaps: .0/25, .128/26, .192/27, .224/30.
Classless routing protocol
Sends the mask with every prefix (OSPF, EIGRP, IS-IS, BGP, RIPv2), which VLSM needs. RIPv1 sends none.

8.1The step-by-step animation

  1. HQ has one block, 192.168.10.0/24 (256 addresses), and four needs of very different sizes: Sales 100 hosts, Engineering 50, Management 20 and the R1–R2 link 2. One mask for everybody cannot serve them: a /25 gives 126 hosts but only 2 subnets, a /26 gives 4 subnets but only 62 hosts, too few for Sales. VLSM gives each subnet its own prefix length.The plan: block 192.168.10.0/24 · 256 addresses · needs 100 · 50 · 20 · 2 · one mask /25: 2 subnets · /26: 62 hosts max
  2. The method: list the needs, sort them largest first, and round each one up to a power of two that also holds the 2 reserved addresses (network and broadcast). 100 + 2 = 102 → 128, a /25; 50 + 2 = 52 → 64, a /26; 20 + 2 = 22 → 32, a /27; the link 2 + 2 = 4, a /30. Together 228 of the 256 addresses: it fits, with 28 left.The plan: Sales 100 + 2 → 128 = /25 · Eng 50 + 2 → 64 = /26 · Mgmt 20 + 2 → 32 = /27 · link 2 + 2 → 4 = /30 · total 228 of 256
  3. Sales goes first, at the start of the block: 192.168.10.0/25, hosts .1 to .126, broadcast .127, gateway .1 on Gi0/0. In binary the /25 adds one prefix bit to the /24 (violet) and keeps 7 host bits (green), all 0 at the start of the block. The next free address is .128, and 128 is a multiple of 64: the next block can start there.The plan: Sales 192.168.10.0/25 · hosts .1 – .126 · broadcast .127 · gateway 192.168.10.1 (Gi0/0) · next free .128
  4. Engineering takes the next free address, 192.168.10.128/26 (hosts .129 – .190, broadcast .191), and Management the one after it, 192.168.10.192/27 (hosts .193 – .222, broadcast .223). No gap is needed: 128 is a multiple of 64 and 192 a multiple of 32. Decreasing sizes guarantee it, because every earlier block was a larger power of two.The plan: Eng 192.168.10.128/26 · gw .129 · Mgmt 192.168.10.192/27 · gw .193 · next free .224
  5. The point-to-point link goes last, as a /30: 192.168.10.224/30, R1 .225, R2 .226, broadcast .227 (a /31 would also do, RFC 3021). What remains, .228 to .255, stays together at the end for growth: a /30, a /29 and a /28 that can still be handed out. Because the four blocks are contiguous, the whole site can still be advertised as one route, 192.168.10.0/24 (§9).The plan: R1–R2 192.168.10.224/30 · .225 and .226 · free .228 – .255 (28 addresses) · summary 192.168.10.0/24 (§9)
  6. Wrong: the same needs, smallest first and packed end to end. The /30 takes .0 – .3, so Management would start at .4, Engineering at .36 and Sales at .100. None of these is a boundary: a /27 must start on a multiple of 32, so 192.168.10.4/27 is only a host inside 192.168.10.0/27 (.0 – .31), which already holds the link. IOS refuses it: % 192.168.10.0 overlaps with GigabitEthernet0/2. Aligning the blocks would cure the overlap, at the cost of a hole (.4 – .31) between them.The plan: R1–R2 192.168.10.0/30 · Mgmt "at .4" .4 AND /27 = .0 → .0 – .31 · result overlaps the /30: refused
  7. Fix and verify: allocate largest first, as in steps 3 to 5, and run a classless routing protocol, which carries every prefix with its own mask. R1 advertises the /25, /26 and /27 with OSPF; R2 files them under 192.168.10.0/24 is variably subnetted, 5 subnets, 5 masks. RIPv1 puts no mask in its updates and cannot carry this plan; OSPF, EIGRP, IS-IS, BGP and RIPv2 can.Routing table: R2 learns /25 · /26 · /27 via OSPF · R2 table variably subnetted, 5 subnets, 5 masks · RIPv1 no mask: no VLSM

8.2Simulator: the VLSM planner

A block and the hosts each subnet needs

Type the base network and the needs as a list (a name before a number is optional: Sales 100). Count the router's interface as a host; a need of exactly 2 is treated as a point-to-point link. The planner rounds each need up, sorts largest first and places every block on its boundary.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

192.168.10.0/24 · 256 addresses · 4 subnets, largest first

Sales /25
Eng /26
Mgmt /27
free
.0.128.192.224
#NeedHosts + 2 → blockSubnetUsable hostsBroadcastWaste
1Sales100 + 2 → 128192.168.10.0/25192.168.10.1 – 192.168.10.126 (126)192.168.10.12726
2Eng50 + 2 → 64192.168.10.128/26192.168.10.129 – 192.168.10.190 (62)192.168.10.19112
3Mgmt20 + 2 → 32192.168.10.192/27192.168.10.193 – 192.168.10.222 (30)192.168.10.22310
4R1-R2 (link)2 + 2 → 4192.168.10.224/30192.168.10.225 – 192.168.10.226 (2)192.168.10.2270
free28192.168.10.228 – 192.168.10.255 = 192.168.10.228/30 + 192.168.10.232/29 + 192.168.10.240/28
4 subnets in 192.168.10.0/24: 228 of 256 addresses used, 28 free
  • Each need is rounded up to a power of two that holds hosts + 2, then the blocks are placed largest first: 128 + 64 + 32 + 4 = 228. Every block starts where the previous one ended, which is always a multiple of its own size: no gaps, no overlaps.
  • Free for growth: 192.168.10.228 – 192.168.10.255 (28 addresses) = 192.168.10.228/30 + 192.168.10.232/29 + 192.168.10.240/28, all at the end of the block.
  • The 1 point-to-point link uses /30 (2 usable of 4). /31 (RFC 3021) would save 2 addresses per link.
  • All blocks are contiguous inside 192.168.10.0/24, so the rest of the network can reach them through that single route (§9).

8.3The configuration, line by line

R1 · IOS-XE

1interface GigabitEthernet0/0Sales, VLAN 10: the largest need gets the first block.
2 description Sales VLAN 10 - 100 hosts
3 ip address 192.168.10.1 255.255.255.128/25: 192.168.10.0 – .127, 126 usable hosts, gateway .1.
4interface GigabitEthernet0/1Engineering, VLAN 20.
5 description Eng VLAN 20 - 50 hosts
6 ip address 192.168.10.129 255.255.255.192/26: .128 – .191, 62 usable hosts. It starts exactly where Sales ends.
7interface GigabitEthernet0/3Management, VLAN 99.
8 description Mgmt VLAN 99 - 20 hosts
9 ip address 192.168.10.193 255.255.255.224/27: .192 – .223, 30 usable hosts.
10interface GigabitEthernet0/2The link to R2, allocated last.
11 description P2P to R2
12 ip address 192.168.10.225 255.255.255.252/30: .224 – .227; R1 .225, R2 .226. Free after it: .228 – .255.
13!
14router ospf 1OSPF is classless: every LSA carries the prefix with its mask.
15 network 192.168.10.0 0.0.0.255 area 0One statement matches all four interfaces; each subnet is still advertised with its own mask.

NX-OS · IOS-XR

1! NX-OS: a prefix length instead of a mask
2interface Ethernet1/1
3 no switchportA routed port.
4 ip address 192.168.10.1/25The same Sales /25.
5interface Ethernet1/2
6 no switchport
7 ip address 192.168.10.129/26
8! IOS-XR: ipv4 address, with a mask
9interface GigabitEthernet0/0/0/2
10 ipv4 address 192.168.10.225 255.255.255.252The /30 link. IOS-XR also accepts 192.168.10.225/30.

Wrong

1! smallest first, packed end to end
2interface GigabitEthernet0/2
3 ip address 192.168.10.1 255.255.255.252The /30 at .0 – .3.
4interface GigabitEthernet0/3
5 ip address 192.168.10.5 255.255.255.224Meant as "the /27 that starts at .4". With a /27 mask, .5 belongs to 192.168.10.0/27 (.0 – .31).
6% 192.168.10.0 overlaps with GigabitEthernet0/2IOS refuses it: that /27 contains the /30 already on Gi0/2. The fix is the largest-first plan, not a different host address.
7!
8router rip
9 version 1Classful: the updates carry no mask.
10 network 192.168.10.0RIPv1 on IOS sends a subnet of the same major network only out of interfaces with the same mask, so R2 (on the /30) never learns the /25, /26 or /27.

show ip route connected (R1)

1R1#show ip route connected
2 192.168.10.0/24 is variably subnetted, 8 subnets, 5 masks4 connected (C) and 4 local /32 (L) routes; masks /25, /26, /27, /30 and /32.
3C 192.168.10.0/25 is directly connected, GigabitEthernet0/0Sales.
4L 192.168.10.1/32 is directly connected, GigabitEthernet0/0
5C 192.168.10.128/26 is directly connected, GigabitEthernet0/1Engineering.
6L 192.168.10.129/32 is directly connected, GigabitEthernet0/1
7C 192.168.10.192/27 is directly connected, GigabitEthernet0/3Management.
8L 192.168.10.193/32 is directly connected, GigabitEthernet0/3
9C 192.168.10.224/30 is directly connected, GigabitEthernet0/2The link to R2.
10L 192.168.10.225/32 is directly connected, GigabitEthernet0/2

show ip route ospf (R2)

1R2#show ip route ospf
2Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
3! (rest of the legend omitted)
4 
5 192.168.10.0/24 is variably subnetted, 5 subnets, 5 masksThe parent line counts every route of the major network on R2: 3 OSPF + its connected /30 and local /32, with 5 different masks.
6O 192.168.10.0/25 [110/2] via 192.168.10.225, 00:03:11, GigabitEthernet0/0Sales, with its own /25: OSPF carried the mask.
7O 192.168.10.128/26 [110/2] via 192.168.10.225, 00:03:11, GigabitEthernet0/0
8O 192.168.10.192/27 [110/2] via 192.168.10.225, 00:03:11, GigabitEthernet0/0Cost 2: R2's Gi0/0 (1) + R1's LAN interface (1).

The outputs are typical for IOS-XE; details may vary between versions.

8.4Remember

Critical for the exam
The VLSM method: sort the needs largest first and give each the smallest block with 2h − 2 ≥ hosts, then allocate at the next free address. For 192.168.10.0/24: Sales 100 → /25 at .0, Engineering 50 → /26 at .128, Management 20 → /27 at .192, the R1–R2 link → /30 at .224. Point-to-point links go last.
Theory
Largest first works because the blocks are powers of two and each must start on a multiple of its own size. In decreasing order the running total is always a multiple of the next block (128 = 2 × 64, then 192 = 6 × 32, then 224 = 56 × 4), so every block lands on its boundary with no gap. Smallest first needs padding, and skipping it creates overlaps.
Pitfall
Count the 2 reserved addresses and the router: 30 hosts fit a /27 (30 usable) but 31 need a /26; 62 fit a /26 but 63 need a /25. A block that is exactly full on day one (62 hosts in a /26) has no room for the next device.
Numbers
Usable hosts: /25 126, /26 62, /27 30, /28 14, /29 6, /30 2, /31 2 (RFC 3021, point-to-point only). Block sizes 128, 64, 32, 16, 8, 4, 2. The company plan uses 128 + 64 + 32 + 4 = 228 of 256; free .228 – .255 = .228/30 + .232/29 + .240/28. RFC 1878 tabulates the variable-length masks.
Pitfall
A block that does not start on its boundary does not exist: 192.168.10.4/27 is just a host address in 192.168.10.0/27. IOS rejects an overlap between two of its own interfaces (% 192.168.10.0 overlaps with GigabitEthernet0/2), but it cannot see an overlap between subnets on different routers: that one only shows up as unreachable hosts.
Platforms and standards
VLSM needs a classless routing protocol that sends the mask with each prefix: OSPF, EIGRP, IS-IS, BGP and RIPv2 (RFC 2453). RIPv1 (RFC 1058) sends none. EIGRP auto-summary is off by default since IOS 15.0(1)M. NX-OS writes ip address 192.168.10.1/25, IOS-XR ipv4 address 192.168.10.1 255.255.255.128.
Verify withshow ip interface briefshow ip route connectedshow ip route 192.168.10.0 255.255.255.0 longer-prefixesshow ip ospf interface brief

8.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

You cut 192.168.10.0/24 with VLSM, largest first. Sales (100 hosts) already has 192.168.10.0/25. Engineering needs 50 hosts. Which subnet should it get next?

  1. A192.168.10.128/25
  2. B192.168.10.128/26
  3. C192.168.10.100/26
  4. D192.168.10.127/26
Show answer
Answer: B. 50 + 2 = 52 addresses round up to 64, a /26, and the next free address after the /25 is .128, which is a multiple of 64, so 192.168.10.128/26 (hosts .129 – .190). .127 is the broadcast of Sales, a /25 at .128 would be twice too large, and .100 is not a /26 boundary (it would mean 192.168.10.64/26, overlapping Sales).
CCNACCNA 200-301Q2

One /24 must hold a 20-host LAN, a 2-address WAN link, a 100-host LAN and a 50-host LAN. In which order should you allocate them with VLSM?

  1. A100, 50, the WAN link, then 20: links go next to their LANs
  2. BAny order works, as long as each block is rounded up to a power of two
  3. C100, 50, 20, then the WAN link
  4. DWAN link, 20, 50, 100: smallest first saves space
Show answer
Answer: C. Largest first: the running total is then always a multiple of the next, smaller block, so every block starts on its boundary with no gap. Rounding the sizes is not enough on its own: in a careless order a /27 placed after a /30 would start at .4, which is not a /27 boundary and overlaps the link. Another order only works if you skip ahead to each boundary, which leaves holes (smallest first here: .4 – .31 unused).
CCNACCNA 200-301Q3

A VLSM plan gives the Management VLAN 192.168.10.192/27. What are its broadcast address and its number of usable hosts?

  1. A192.168.10.255 and 30 hosts
  2. B192.168.10.223 and 32 hosts
  3. C192.168.10.223 and 30 hosts
  4. D192.168.10.224 and 30 hosts
Show answer
Answer: C. A /27 is a block of 32 addresses: .192 to .223. The first is the subnet, the last (.223) the broadcast, so 32 − 2 = 30 hosts remain. .224 is the start of the next block, and .255 is the broadcast of the whole /24, not of this subnet.
CCNACCNA 200-301Q4

R1 has ip address 192.168.10.1 255.255.255.252 on Gi0/2. You then enter ip address 192.168.10.5 255.255.255.224 on Gi0/3. What happens?

  1. AIOS accepts it: .5 is outside the /30, which ends at .3
  2. BIOS accepts it but shuts down Gi0/2 to avoid the overlap
  3. CIOS accepts it and creates the subnet 192.168.10.4/27
  4. DIOS rejects it: 192.168.10.0/27 overlaps the /30 on Gi0/2
Show answer
Answer: D. With a /27 mask, 192.168.10.5 belongs to 192.168.10.0/27 (.0 – .31), because a /27 can only start on a multiple of 32. That subnet contains the /30 on Gi0/2, so IOS answers % 192.168.10.0 overlaps with GigabitEthernet0/2. A subnet 192.168.10.4/27 does not exist.
ProfessionalENARSI 300-410Q5

R2 shows 192.168.10.0/24 is variably subnetted, 5 subnets, 5 masks. What does this line tell you?

  1. A5 equal-cost paths toward 192.168.10.0/24 are installed
  2. BOne of the 5 routes is a summary hiding the other 4
  3. C192.168.10.0/24 was cut into 5 subnets of the same size
  4. D5 routes inside the classful 192.168.10.0/24, with 5 different masks
Show answer
Answer: D. IOS groups routes under their classful network and counts both the routes and the distinct masks. 'Variably subnetted' means more than one mask, the mark of VLSM (on IOS 15+ the local /32 routes count as a mask too). With a single mask the line would read 'is subnetted, N subnets'.
ProfessionalENARSI 300-410Q6

R1 holds a VLSM plan (/25, /26, /27 and /30 inside 192.168.10.0/24) and must share it with R2 dynamically. Which protocol cannot carry the plan, and why?

  1. ARIPv1, because its updates carry no subnet mask
  2. BRIPv2, because it only supports /24 and longer prefixes
  3. COSPF, because a single area cannot hold different masks
  4. DEIGRP, because auto-summary cannot be disabled
Show answer
Answer: A. VLSM needs a classless protocol that sends the mask with each prefix: OSPF, EIGRP, IS-IS, BGP and RIPv2 all do. RIPv1 (RFC 1058) is classful: the receiver has to guess the mask, so the /25, /26 and /27 are lost. EIGRP's auto-summary can be turned off, and has been off by default since IOS 15.0(1)M.
CCIECCIE EI v1.1Q7

A site owns 10.20.0.0/22. It needs LANs of 300, 200 and 100 hosts plus six point-to-point links as /31, allocated largest first. Where does the first /31 start?

  1. A10.20.0.0/31
  2. B10.20.2.128/31
  3. C10.20.3.0/31
  4. D10.20.3.128/31
Show answer
Answer: D. 300 + 2 → 512, a /23 at 10.20.0.0; 200 + 2 → 256, a /24 at 10.20.2.0; 100 + 2 → 128, a /25 at 10.20.3.0; the links follow at 10.20.3.128 – .139, leaving .140 – .255 free. 10.20.3.0 comes from sizing 200 hosts as a /25 (126 usable), 10.20.2.128 from sizing 300 hosts as a /24 (254 usable), and 10.20.0.0 from allocating smallest first.

Route summarization and supernetting

CCNA 200-301 v1.1ENCOR 350-401 v1.2ENARSI 300-410CCIE EI v1.1

TL;DRSummarization advertises one prefix for several networks: write them in binary, keep the leading bits they all share and set the rest to zero. 172.16.0.0/24 to 172.16.3.0/24 share 22 bits, so BR1 advertises 172.16.0.0/22, installs a Null0 discard route for it, and HQ keeps one route that does not change when a single LAN flaps. A summary must cover only space you own: a /21 would also claim Branch 2's 172.16.4.0/24 and black-hole it whenever Branch 2's own route is missing.

The terms, in short
Summary route
One prefix that stands for several networks, also called an aggregate: 172.16.0.0/22 covers 172.16.0.0/24 to 172.16.3.0/24.
Common leading bits
The bits that are identical in every network to be summarized; their count is the prefix length of the summary (22 here).
Supernet
A summary shorter than the classful mask, e.g. 192.168.0.0/23 from two class C /24s. 172.16.0.0/22 sits inside the class B 172.16.0.0/16, so it is a summary, not a supernet.
CIDR
Classless Inter-Domain Routing (RFC 4632): any prefix length, so blocks can be split (subnetting) or merged (supernetting) on any bit.
Discard route
The route to Null0 that EIGRP, OSPF and BGP install for their own summary, so traffic for an unused part of it is dropped instead of looping.
Over-summarization
A summary that includes space the router does not own; it attracts and black-holes that traffic whenever the specific route is missing.

9.1The step-by-step animation

  1. Branch 1 owns four LANs, 172.16.0.0/24 to 172.16.3.0/24; Branch 2 owns 172.16.4.0/24. Without summarization BR1 advertises its four /24s one by one, so HQ, and every router behind it, carries four routes for one branch. A LAN that flaps sends an update across the whole network, and EIGRP queries chase it everywhere.Routing table: from BR1 4 × /24 · from BR2 172.16.4.0/24 · HQ table 5 routes
  2. Find the common bits: write the four networks in binary. The first two octets, 172.16, are identical (16 bits). In the third octet, 0 to 3 are 00000000 to 00000011: 6 more bits match and only the last 2 differ. 16 + 6 = 22 common bits, so the summary is 172.16.0.0/22, mask 255.255.252.0. A /22 holds 224 − 22 = 4 /24s: exactly these four, no more.The summary: common bits 16 + 6 = 22 · summary 172.16.0.0/22 · mask 255.255.252.0 · wildcard 0.0.3.255
  3. BR1 advertises the summary out of its WAN interface: ip summary-address eigrp 100 172.16.0.0 255.255.252.0. HQ now holds one route for the whole branch instead of four. BR1 also installs 172.16.0.0/22 → Null0, the discard route: a packet for a part of the /22 that has no LAN is dropped right there.Routing table: advertised 172.16.0.0/22 · suppressed the four /24s · BR1 itself 172.16.0.0/22 is a summary, Null0
  4. The summary hides instability. BR1's VLAN 102 subinterface (172.16.2.0/24) goes down, but the /22 still has three live LANs: BR1 sends nothing and HQ's table does not change. Host A's packet for 172.16.2.50 still follows the /22 to BR1, where the longest match is now the Null0 route, so it is dropped. Without that route BR1 would send it back along its default route to HQ, and the two would bounce it until the TTL ran out.Longest match: 172.16.2.50 /24 gone → /22 → Null0 · HQ no update · without Null0 default → HQ → loop
  5. Wrong: someone widens the summary to 172.16.0.0/21 "to leave room for growth". A /21 keeps only 21 common bits, so it claims 172.16.0.0 to 172.16.7.255: eight /24s, including 172.16.4.0/24, which belongs to Branch 2. Nothing breaks yet: HQ also has BR2's own /24, and the longest match (/24 beats /21) still sends 172.16.4.20 to BR2.Longest match: summary 172.16.0.0/21 = .0.0 – .7.255 · Branch 2 owns 172.16.4.0/24 · HQ picks /24 → BR2 (longest match)
  6. Then BR2's WAN link fails and its /24 leaves HQ's table. The /21 still matches 172.16.4.20, so HQ sends that traffic across the WAN to BR1, which has no such LAN and drops it in its Null0 route: a black hole at the wrong site. The /21 also beats any default or backup route HQ might have toward Branch 2, and a traceroute now ends at BR1, pointing at the wrong branch. 172.16.5.0 to 172.16.7.255 are attracted the same way.Longest match: HQ table 172.16.0.0/21 → BR1 only · 172.16.4.20 → BR1 → Null0 · result black hole at the wrong site
  7. Fix: a summary covers only what the router owns. BR1 goes back to 172.16.0.0/22, exactly its four LANs. With BR2 still down, HQ now has no route for 172.16.4.20: it answers Host A itself with an ICMP unreachable, nothing crosses the WAN to Branch 1, and the failure points at Branch 2, where it is. In a clean design each site owns one aligned block (Branch 2 gets 172.16.4.0/22) and summarizes exactly that block (§8).The fix: BR1 advertises 172.16.0.0/22 · 172.16.4.20 no route → ICMP unreachable · design one aligned block per site

9.2Simulator: the summarizer

The networks to summarize, and the space other sites own

Type the networks (a.b.c.d/p or a.b.c.d with a mask, separated by commas). The summarizer finds the common leading bits, the single smallest prefix that covers them, the extra space it would also advertise, and the exact minimal list of CIDR blocks. Add networks owned elsewhere to check for black holes.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

Summary 172.16.0.0/22 · mask 255.255.252.0 · 1,024 addresses · 4 networks listed, 1,024 addresses

172.16.0.0/22
172.16.0.0172.16.3.255
#NetworkFirst address in binary (common bits in bold)Note
1172.16.0.0/2410101100.00010000.00000000.00000000
2172.16.1.0/2410101100.00010000.00000001.00000000
3172.16.2.0/2410101100.00010000.00000010.00000000
4172.16.3.0/2410101100.00010000.00000011.00000000
172.16.0.0/2210101100.00010000.00000000.00000000summary, 22 common bits

What 172.16.0.0/22 contains, block by block (the listed ones are the exact list: 1 prefix)

BlockRangeAddressesStatus
172.16.0.0/22172.16.0.0 – 172.16.3.2551,024yours (listed)
Exact summary: 172.16.0.0/22 covers exactly the 4 networks
  • Lowest address 172.16.0.0, highest 172.16.3.255: they agree on the first 22 bits, so the summary is 172.16.0.0/22, mask 255.255.252.0 (wildcard 0.0.3.255).
  • The 1,024 addresses of the list fill the 1,024 of 172.16.0.0/22 exactly: no address outside your networks is advertised.
  • On IOS: ip summary-address eigrp 100 172.16.0.0 255.255.252.0, area 1 range 172.16.0.0 255.255.252.0 on an OSPF ABR, or aggregate-address 172.16.0.0 255.255.252.0 summary-only in BGP.

9.3The configuration, line by line

BR1 · EIGRP classic

1interface GigabitEthernet0/1.100One of the four branch LANs (VLANs 100 – 103 on the trunk to the branch switch).
2 encapsulation dot1Q 100
3 ip address 172.16.0.1 255.255.255.0172.16.0.0/24.
4! Gi0/1.101 – .103: 172.16.1.1, 172.16.2.1, 172.16.3.1, all /24The other three LANs, the same way.
5interface GigabitEthernet0/0The WAN link to HQ.
6 ip address 10.0.1.1 255.255.255.252
7 ip summary-address eigrp 100 172.16.0.0 255.255.252.0Advertise one /22 out of this interface instead of the four /24s, and install the Null0 discard route locally.
8!
9router eigrp 100
10 network 172.16.0.0 0.0.3.255The wildcard 0.0.3.255 is the inverse of the /22 mask: it matches the four LAN interfaces.
11 network 10.0.1.0 0.0.0.3
12 no auto-summaryThe default since IOS 15.0(1)M. On older releases EIGRP summarized to the classful 172.16.0.0/16 on its own.
13!
14ip route 0.0.0.0 0.0.0.0 10.0.1.2A default toward HQ. Without the Null0 route, traffic for an unused part of the /22 would follow it back to HQ and loop.

BR1 · EIGRP named

1router eigrp BRANCHNamed mode: the same summary, configured under the address family.
2 address-family ipv4 unicast autonomous-system 100
3 network 172.16.0.0 0.0.3.255
4 network 10.0.1.0 0.0.0.3
5 af-interface GigabitEthernet0/0Per-interface settings of named mode.
6 summary-address 172.16.0.0 255.255.252.0Same effect as ip summary-address eigrp on the interface: one /22 out of Gi0/0 and a Null0 discard route locally.
7 exit-af-interface
8 exit-address-family

OSPF · ABR and ASBR

1router ospf 1BR1 as an ABR: the LANs in area 1, the WAN link in area 0.
2 network 172.16.0.0 0.0.3.255 area 1
3 network 10.0.1.0 0.0.0.3 area 0
4 area 1 range 172.16.0.0 255.255.252.0Inter-area summary: area 0 receives one type 3 LSA for the /22 instead of four. Only an ABR can do it, for an area it is attached to; the ABR also installs a discard route to Null0.
5! on an ASBR, for redistributed routes:
6 summary-address 172.20.0.0 255.255.252.0Summarizes external (type 5) routes, e.g. four redistributed static /24s 172.20.0.0 – 172.20.3.0. area range does not touch externals.

BGP · static

1router bgp 65010
2 aggregate-address 172.16.0.0 255.255.252.0 summary-onlyBGP creates the /22 when at least one more-specific route is in its table; summary-only suppresses the /24s. A /22 to Null0 appears in the RIB.
3 ! network 172.16.0.0 mask 255.255.252.0The alternative: a network statement for the /22, anchored by the static route below.
4ip route 172.16.0.0 255.255.252.0 Null0Keeps an exact /22 in the RIB, so the network statement can advertise it, even if every LAN is down.
5!
6! HQ: a static summary toward Branch 1
7ip route 172.16.0.0 255.255.252.0 10.0.1.1One static route covers the four LANs: a manual summary.

Wrong

1interface GigabitEthernet0/0
2 ip summary-address eigrp 100 172.16.0.0 255.255.248.0A /21 "to leave room": it claims 172.16.0.0 – 172.16.7.255, including 172.16.4.0/24 of Branch 2.
3! HQ: D 172.16.0.0/21 via 10.0.1.1 + D 172.16.4.0/24 via 10.0.2.1While BR2 is up, its /24 wins (longest match): no symptom.
4! BR2 link down: 172.16.4.20 → /21 → BR1 → Null0: black holeThe failure appears only when the specific route is gone.

show ip route (BR1)

1BR1#show ip route
2Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
3 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
4! (rest of the legend omitted)
5Gateway of last resort is 10.0.1.2 to network 0.0.0.0
6 
7S* 0.0.0.0/0 [1/0] via 10.0.1.2The default toward HQ.
8 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
9C 10.0.1.0/30 is directly connected, GigabitEthernet0/0
10L 10.0.1.1/32 is directly connected, GigabitEthernet0/0
11 172.16.0.0/16 is variably subnetted, 9 subnets, 3 masks1 summary + 4 connected /24s + 4 local /32s; masks /22, /24 and /32.
12D 172.16.0.0/22 is a summary, 00:12:05, Null0The discard route EIGRP installs with the summary (administrative distance 5). It beats the default for any address in the /22 that has no LAN.
13C 172.16.0.0/24 is directly connected, GigabitEthernet0/1.100
14L 172.16.0.1/32 is directly connected, GigabitEthernet0/1.100
15C 172.16.1.0/24 is directly connected, GigabitEthernet0/1.101
16L 172.16.1.1/32 is directly connected, GigabitEthernet0/1.101
17C 172.16.2.0/24 is directly connected, GigabitEthernet0/1.102The LAN that flaps in step 4: when it goes, the /22 stays.
18L 172.16.2.1/32 is directly connected, GigabitEthernet0/1.102
19C 172.16.3.0/24 is directly connected, GigabitEthernet0/1.103
20L 172.16.3.1/32 is directly connected, GigabitEthernet0/1.103

show ip route eigrp (HQ)

1HQ#show ip route eigrp
2! (legend omitted)
3 
4 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masksTwo routes for the whole 172.16.0.0/16: Branch 1's summary and Branch 2's /24.
5D 172.16.0.0/22 [90/3072] via 10.0.1.1, 00:12:05, GigabitEthernet0/1One route for four LANs. 3072 = 256 × (10 + 2): the lowest metric among the components.
6D 172.16.4.0/24 [90/3072] via 10.0.2.1, 00:12:01, GigabitEthernet0/2Branch 2's LAN, outside the /22.

The outputs are typical for IOS-XE; details may vary between versions.

9.4Remember

Critical for the exam
The summary prefix is the number of leading bits that all the networks share. 172.16.0.0/24 – 172.16.3.0/24: the third octets 0 – 3 are 000000|00 to 000000|11, so 16 + 6 = 22 bits → 172.16.0.0/22, mask 255.255.252.0. A /22 of /24s holds exactly 224 − 22 = 4 of them, and the first one must be a multiple of 4 in the third octet.
Theory
A router always uses the longest matching prefix, so a summary never overrides a more specific route: HQ keeps sending to Branch 2's 172.16.4.0/24 even with a /21 from BR1 in the table. That is why over-summarization looks harmless on a normal day. The discard route uses the same rule the other way: on BR1 the /22 → Null0 is longer than 0.0.0.0/0, so traffic for an unused part of the summary is dropped instead of looping.
Pitfall
Over-summarization: 172.16.0.0/21 also covers 172.16.4.0 – 172.16.7.255. If any of that space lives at another site, the summary attracts its traffic whenever that site's own route is missing, even over a default or backup route toward that site, and BR1 drops it in Null0. A summary may only cover space the router owns, used or reserved.
Numbers
In /24s: a /23 holds 2, a /22 4, a /21 8, a /20 16. EIGRP gives its local summary route administrative distance 5, advertises it with the lowest metric of its components and keeps it while at least one component is up, so one LAN that flaps never leaves the branch. CIDR: RFC 1519 (1993), now RFC 4632.
Pitfall
Count the alignment, not just the networks: 172.16.1.0/24 – 172.16.4.0/24 are four /24s but not a /22. The smallest single prefix covering them is 172.16.0.0/21 (2,048 addresses for 1,024 used); the exact list is 172.16.1.0/24, 172.16.2.0/23 and 172.16.4.0/24. Likewise 192.168.1.0 + 192.168.2.0 are not a /23: a /23 starts at an even third octet.
Platforms and standards
Where IOS summarizes: EIGRP ip summary-address eigrp 100 … on the interface (classic) or summary-address under af-interface (named); OSPF area 1 range on an ABR (type 3) and summary-address on an ASBR (type 5); BGP aggregate-address … summary-only; or a static route. EIGRP auto-summary is off by default since IOS 15.0(1)M. NX-OS takes prefix lengths: ip summary-address eigrp 100 172.16.0.0/22, area 1 range 172.16.0.0/22.
Verify withshow ip route eigrpshow ip route 172.16.0.0 255.255.252.0 longer-prefixesshow ip eigrp topology 172.16.0.0/22show ip protocolsshow ip ospf database summary

9.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

What is the smallest single summary route for 172.16.0.0/24, 172.16.1.0/24, 172.16.2.0/24 and 172.16.3.0/24?

  1. A172.16.0.0/23 (255.255.254.0)
  2. B172.16.3.0/22 (255.255.252.0)
  3. C172.16.0.0/21 (255.255.248.0)
  4. D172.16.0.0/22 (255.255.252.0)
Show answer
Answer: D. The third octets 0 to 3 are 000000|00 to 000000|11: 16 + 6 = 22 bits are common, so 172.16.0.0/22, exactly four /24s. A /23 covers only two of them, a /21 also covers 172.16.4.0 – 172.16.7.255, and a summary always starts with all non-common bits at 0, so 172.16.3.0/22 is not a valid way to write it.
CCNACCNA 200-301Q2

Which address range does the summary route 10.1.8.0/21 cover?

  1. A10.1.8.0 to 10.1.16.255
  2. B10.1.8.0 to 10.1.15.255
  3. C10.1.8.0 to 10.1.11.255
  4. D10.1.0.0 to 10.1.15.255
Show answer
Answer: B. A /21 leaves 3 bits of the third octet to the host part: a block of 8 in that octet, 8 to 15, so 10.1.8.0 – 10.1.15.255 (eight /24s). 10.1.8.0 – 10.1.11.255 is a /22, 10.1.0.0 – 10.1.15.255 a /20, and a block can never end at .16.255 when it starts at .8.0.
CCNACCNA 200-301Q3

HQ has D 172.16.0.0/21 via 10.0.1.1 (Branch 1) and D 172.16.4.0/24 via 10.0.2.1 (Branch 2). A packet arrives for 172.16.4.20. Where does HQ send it?

  1. ATo Branch 1: the summary was learned first
  2. BTo both branches: the two routes are load-shared
  3. CTo Branch 2: the /24 is the longest match
  4. DTo Branch 1: the /21 covers more addresses
Show answer
Answer: C. Both routes match 172.16.4.20, and the router always uses the longest matching prefix, here the /24 to Branch 2. Administrative distance and metric only compare routes to the same prefix (same network, same length); the order in which routes were learned plays no role.
CCNACCNA 200-301Q4

Which pair of /24 networks can be summarized exactly into a single /23?

  1. A192.168.4.0/24 and 192.168.5.0/24
  2. B192.168.3.0/24 and 192.168.4.0/24
  3. C192.168.5.0/24 and 192.168.6.0/24
  4. D192.168.4.0/24 and 192.168.6.0/24
Show answer
Answer: A. A /23 holds two /24s and starts at an even third octet, so 4 + 5 make 192.168.4.0/23. 5 + 6 and 3 + 4 are adjacent but straddle a /23 boundary (their smallest summary is a /22 or a /21), and 4 + 6 are not even adjacent.
ProfessionalENARSI 300-410Q5

BR1 runs ip summary-address eigrp 100 172.16.0.0 255.255.252.0 on its WAN interface. Which new route appears in BR1's own routing table?

  1. AD 172.16.0.0/22 via 10.0.1.2: the summary learned back from HQ
  2. BD EX 172.16.0.0/22: EIGRP treats its summaries as external routes
  3. CNone: a summary is only advertised, never installed locally
  4. DD 172.16.0.0/22 is a summary, Null0: a discard route against loops
Show answer
Answer: D. EIGRP installs a local route for the summary pointing to Null0, with administrative distance 5. A packet for an address of the /22 that has no LAN on BR1 matches it and is dropped, instead of following BR1's default route back to HQ and looping. Even a /22 learned back from HQ would lose to it: the local summary has distance 5, an internal EIGRP route 90.
ProfessionalENCOR 350-401 · ENARSI 300-410Q6

In OSPF, where and how do you summarize the routes of area 1 so that area 0 receives one prefix?

  1. AOn the ABR, with ip summary-address ospf on the interface
  2. BOn any router of area 1, with summary-address under router ospf
  3. COn the ABR, with area 1 range under router ospf
  4. DOn the ASBR, with area 1 range under router ospf
Show answer
Answer: C. Inter-area (type 3) summaries can only be made where the LSAs are created, on the ABR, with area 1 range. summary-address is for external (type 5) routes on an ASBR. OSPF has no interface-level summary command; that is the EIGRP way.
ProfessionalENARSI 300-410Q7

BR1 owns only 172.16.0.0/22 but advertises 172.16.0.0/21; 172.16.4.0/24 is at Branch 2. Branch 2's WAN link fails. What happens to HQ's traffic for 172.16.4.20?

  1. ABR1 forwards it to Branch 2 over its default route
  2. BHQ load-shares it between both branches until the link returns
  3. CIt follows the /21 to BR1, which drops it in its Null0 discard route
  4. DHQ answers with ICMP unreachable, because 172.16.4.0/24 is gone
Show answer
Answer: C. With Branch 2's /24 gone, the /21 from BR1 is the longest match left at HQ. BR1 has no 172.16.4.0/24, so the packet matches its 172.16.0.0/21 → Null0 discard route and is dropped at the wrong site: a black hole. Without the over-summarized /21, HQ would have no route and would return the ICMP unreachable itself.
CCIECCIE EI v1.1Q8

Which minimal set of prefixes advertises exactly 172.16.1.0/24 through 172.16.4.0/24, and nothing else?

  1. A172.16.1.0/23, 172.16.3.0/23
  2. B172.16.1.0/24, 172.16.2.0/23, 172.16.4.0/24
  3. C172.16.0.0/21
  4. D172.16.1.0/24, 172.16.2.0/22
Show answer
Answer: B. The range starts at an odd third octet and ends at 4, so no single prefix fits: 172.16.1.0/24, then 2 – 3 as the aligned 172.16.2.0/23, then 172.16.4.0/24. 172.16.0.0/21 adds four /24s you do not own; 172.16.1.0/23 is really 172.16.0.0/23, 172.16.3.0/23 is really 172.16.2.0/23 and 172.16.2.0/22 is really 172.16.0.0/22: none starts on its boundary.

IPv4 on Cisco devices: configuring and verifying interfaces

CCNA 200-301 v1.1ENARSI 300-410CCIE EI v1.1

TL;DRAn IOS interface routes once it has an address, a mask and no shutdown, and its link is up/up. Then IOS installs a C route for the subnet and, since IOS 15, an L /32 route for its own address. Before accepting the address it checks it: a non-contiguous mask, a network or broadcast address and a subnet that overlaps another interface are all refused. The rest of the reference: secondary addresses, ip unnumbered, /31 links, DHCP clients, SVIs, NX-OS and IOS-XR syntax, and the show commands that prove it.

The terms, in short
Connected route (C)
The subnet of an up/up interface, address AND mask: 192.168.10.0/25 on Gi0/0. Administrative distance 0.
Local route (L)
A /32 for the interface's own address, 192.168.10.1/32, added since IOS 15: a packet that matches it is for the router itself.
Administratively down
The state of an interface with shutdown, the default on router interfaces. No route is installed until no shutdown and a working link.
Secondary address
A second subnet on the same interface (ip address … secondary). A second ip address without the keyword replaces the primary.
ip unnumbered
A point-to-point interface that borrows the address of another interface, usually Loopback0, instead of using a subnet of its own.
SVI
Switched virtual interface (interface Vlan20): the Layer 3 gateway of a VLAN on a multilayer switch, up/up only while the VLAN has an active port.

10.1The step-by-step animation

  1. R1 starts with no addresses, and every router interface starts administratively down. On Gi0/0, the Sales LAN, you enter the first usable host of 192.168.10.0/25 with its dotted mask: ip address 192.168.10.1 255.255.255.128. IOS checks the address and accepts it, but the interface is still shut, so show ip interface brief says administratively down and the routing table stays empty.R1 · Gi0/0: interface GigabitEthernet0/0 · ip address 192.168.10.1 255.255.255.128 · status administratively down / down
  2. no shutdown brings Gi0/0 up, and SW1 answers on the other end, so the line protocol comes up too: up/up. Only now does IOS install two routes. C 192.168.10.0/25 is the connected subnet, the address AND the mask: R1 ARPs for any destination inside it. L 192.168.10.1/32 is the local route for R1's own address (IOS 15 and later): a packet that matches it is for R1 itself.R1 · Gi0/0: status up / up · C 192.168.10.0/25 → Gi0/0 · L 192.168.10.1/32 → R1 itself
  3. Same two commands on Gi0/1 for Engineering: ip address 192.168.10.129 255.255.255.192 and no shutdown. IOS checks that .129 is neither the network (.128) nor the broadcast (.191) of its /26, then that 192.168.10.128/26 overlaps no other interface: it starts right after Sales ends at .127. Gi0/1 comes up and two more routes appear, C 192.168.10.128/26 and L 192.168.10.129/32.R1 · Gi0/1: ip address 192.168.10.129 255.255.255.192 · subnet 192.168.10.128/26 · .128 – .191 · new routes C .128/26 · L .129/32
  4. Wrong: on Gi0/2, the link to R2, the engineer pastes the Sales mask: ip address 192.168.10.225 255.255.255.128. With a /25, .225 belongs to 192.168.10.128/25 (.128 – .255), which contains Engineering's 192.168.10.128/26 on Gi0/1. A connected subnet must lead to exactly one interface, so IOS refuses the command: % 192.168.10.128 overlaps with GigabitEthernet0/1. Gi0/2 keeps no address, nothing is installed and R2 cannot be reached.R1 · Gi0/2: typed 192.168.10.225 255.255.255.128 · .225 AND /25 192.168.10.128/25 ⊃ Gi0/1's /26 · IOS % 192.168.10.128 overlaps with GigabitEthernet0/1
  5. Fix: the link needs only two addresses, so the mask is a /30: ip address 192.168.10.225 255.255.255.252. Now .225 AND /30 = 192.168.10.224, a block of four (.224 – .227) that overlaps nothing. With no shutdown the link comes up, C 192.168.10.224/30 and L 192.168.10.225/32 appear, and a ping to R2's .226 answers.R1 · Gi0/2: ip address 192.168.10.225 255.255.255.252 · subnet 192.168.10.224/30 · R1 .225 · R2 .226 · new routes C .224/30 · L .225/32
  6. Verify from two angles. show ip interface brief: three interfaces up/up, Method manual (typed in this session; NVRAM after a reload). show ip route connected: one C and one L route per interface, filed under 192.168.10.0/24 is variably subnetted, 6 subnets, 4 masks (/25, /26, /30 and the /32 L routes). When a C route is missing, the interface is not up/up: read the Status and Protocol columns first.Verification: interfaces 3 × up / up, Method manual · routing table 6 subnets, 4 masks · missing C route check Status / Protocol

10.2Simulator: what does IOS say?

The interfaces R1 already has, and the address you type on another one

IOS runs its checks in order and stops at the first failure. List the existing interfaces as name and address (Gi0/0 192.168.10.1/25, …), pick the interface and type the address with its dotted mask (or /prefix). Messages as typical IOS-XE releases print them.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

IOS check, in orderResult
Address and mask parse✓
Mask is contiguous (1s, then 0s)✓
Unicast host address (not 0/8, 127/8, class D or E)✓
Not the network or broadcast address of its subnet✓
No overlap with another interface (same VRF)✗
/31 on a point-to-point interfacenot reached
R1(config)#interface GigabitEthernet0/2
R1(config-if)#ip address 192.168.10.225 255.255.255.128
% 192.168.10.128 overlaps with GigabitEthernet0/1

show ip route connected (unchanged: the command was refused)

      192.168.10.0/24 is variably subnetted, 4 subnets, 3 masks
C        192.168.10.0/25 is directly connected, GigabitEthernet0/0
L        192.168.10.1/32 is directly connected, GigabitEthernet0/0
C        192.168.10.128/26 is directly connected, GigabitEthernet0/1
L        192.168.10.129/32 is directly connected, GigabitEthernet0/1
Rejected: 192.168.10.128/25 overlaps Gi0/1 (192.168.10.128/26)
  • 192.168.10.225 AND /25 = 192.168.10.128/25 (192.168.10.128 – 192.168.10.255). GigabitEthernet0/1 already has 192.168.10.129/26, subnet 192.168.10.128/26 (192.168.10.128 – 192.168.10.191): the new subnet contains it.
  • A connected subnet must lead to exactly one interface, so IOS refuses the command and the interface keeps its previous address. It checks only its own interfaces in the same VRF: the same overlap between two routers goes unnoticed (§16).
  • Fix: the mask you meant. With the same address, /26 (255.255.255.192) is the shortest mask that overlaps nothing: 192.168.10.192/26. A point-to-point link needs only a /30: 192.168.10.224/30.

10.3The configuration, line by line

R1 · IOS-XE

1interface GigabitEthernet0/0Sales LAN, VLAN 10. A router interface starts shut down and without an address.
2 description Sales LAN - VLAN 10Free text for humans and SNMP; it changes nothing in forwarding.
3 ip address 192.168.10.1 255.255.255.128Address and dotted mask. IOS checks them first: a contiguous mask, not the network (.0) or broadcast (.127) of the /25, no overlap with another interface in the same VRF.
4 no shutdownRouter interfaces are administratively down by default. Once Gi0/0 is up/up, IOS installs C 192.168.10.0/25 and L 192.168.10.1/32.
5interface GigabitEthernet0/1Engineering LAN, VLAN 20.
6 description Eng LAN - VLAN 20
7 ip address 192.168.10.129 255.255.255.192192.168.10.128/26: hosts .129 to .190, broadcast .191.
8 no shutdown
9interface GigabitEthernet0/2The point-to-point link to R2.
10 description P2P to R2
11 ip address 192.168.10.225 255.255.255.252/30: network .224, R1 .225, R2 .226, broadcast .227. The same address with the Sales /25 mask is refused (Wrong tab).
12 no shutdown
13!
14interface Loopback0A virtual interface, up as soon as it is created: no no shutdown needed.
15 ip address 10.255.0.1 255.255.255.255A /32 is its own subnet: IOS installs only a C route, no separate L route.
16!
17line vty 0 4
18 ip netmask-format bit-countDisplay only, for SSH sessions: masks in show output appear as /25. terminal ip netmask-format bit-count does the same for the current session. ip address still takes a dotted mask.

Wrong

1! 1. A mask that makes Gi0/2 overlap Gi0/1
2interface GigabitEthernet0/2
3 ip address 192.168.10.225 255.255.255.128The Sales mask pasted onto the /30 link: .225 AND /25 = 192.168.10.128/25 (.128 – .255).
4% 192.168.10.128 overlaps with GigabitEthernet0/1Refused. IOS prints the subnet it computed from the new address and mask, then the interface it collides with. Gi0/2 keeps its previous address (here none).
5! 2. The network or the broadcast address of the subnet
6 ip address 192.168.10.224 255.255.255.252Host bits 00: the network address of 192.168.10.224/30.
7Bad mask /30 for address 192.168.10.224Refused; the same message for .227 (host bits 11). Only .225 and .226 are usable.
8! 3. A mask that is not contiguous
9 ip address 192.168.10.225 255.255.0.252255.255.0.252 has 1s after a 0 (third octet 00000000, fourth 11111100).
10Bad mask 0xFFFF00FC for address 192.168.10.225A non-contiguous mask is printed in hexadecimal, because it has no prefix length.
11! 4. Typing ip address again replaces the address
12interface GigabitEthernet0/0
13 ip address 10.1.10.1 255.255.255.0Meant as a second subnet for Sales. Without secondary it replaces 192.168.10.1/25 silently: C 192.168.10.0/25 disappears and every Sales host loses its gateway.
14! 5. An address on a subinterface before its VLAN tag
15interface GigabitEthernet0/1.30
16 ip address 10.1.30.1 255.255.255.0
17% Configuring IP routing on a LAN subinterface is only allowed if that subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q, or ISL vLAN.Router-on-a-stick order: encapsulation dot1Q 30 first, then the address (§5).

Secondary · unnumbered · DHCP

1! Two subnets on one interface (a renumbering in progress)
2interface GigabitEthernet0/0
3 ip address 192.168.10.1 255.255.255.128The primary address.
4 ip address 10.1.10.1 255.255.255.0 secondaryA second subnet on the same wire: C 10.1.10.0/24 and L 10.1.10.1/32 appear too. Hosts of the two subnets still talk through R1, not directly.
5! A point-to-point link with no subnet of its own
6interface Serial0/1/0
7 ip unnumbered Loopback0Borrows Loopback0's 10.255.0.1: packets leave with that source, no subnet is spent on the link and no C route is created for it. Routes to the far end point out Serial0/1/0. Meant for point-to-point interfaces such as serial links and tunnels.
8! BR1, a branch router: the uplink is addressed by the provider's DHCP server
9interface GigabitEthernet0/0/0
10 ip address dhcpThe router is a DHCP client. Method DHCP in show ip interface brief; the gateway from the offer (option 3) becomes S* 0.0.0.0/0 [254/0].
11 no shutdown
12%DHCP-6-ADDRESS_ASSIGN: Interface GigabitEthernet0/0/0 assigned DHCP address 192.0.2.10, mask 255.255.255.0, hostname BR1The log when the lease arrives; show dhcp lease shows the server, the lease time and the renewal timers.

Multilayer switch · SVI

1! DSW1: the same gateways on a multilayer switch instead of R1
2ip routingRouting between the SVIs. Off by default on many Catalyst models; without it the switch only bridges.
3vlan 20The VLAN must exist, or the SVI stays down.
4 name ENG
5interface Vlan20The SVI: the gateway of VLAN 20, with no physical port of its own.
6 ip address 192.168.10.129 255.255.255.192Hosts in VLAN 20 use .129 as their gateway, exactly as with R1 Gi0/1.
7 no shutdownNew SVIs are usually created shut down.
8interface GigabitEthernet1/0/10
9 switchport mode access
10 switchport access vlan 20Autostate: Vlan20 is up/up only while at least one port in VLAN 20 (access, or a trunk that allows it) is up and forwarding in STP.
11interface GigabitEthernet1/0/48A routed port toward R2: no VLAN, the address sits on the port itself.
12 no switchport
13 ip address 192.168.10.225 255.255.255.252

NX-OS · IOS-XR

1! NX-OS (Nexus): prefix length, SVIs need a feature
2feature interface-vlanWithout it, interface Vlan20 does not exist.
3interface Vlan20
4 no shutdown
5 ip address 192.168.10.129/26NX-OS shows the mask as a prefix length in its configuration.
6 ip address 10.1.20.1/24 secondarySecondary addresses work the same way.
7interface Ethernet1/49
8 no switchportPorts on most Nexus models (9000, 5000) are Layer 2 by default: a routed port needs this first.
9 ip address 192.168.10.225/30
10! IOS-XR: ipv4 address, and nothing happens before commit
11interface GigabitEthernet0/0/0/2
12 ipv4 address 192.168.10.225 255.255.255.252The keyword is ipv4; 192.168.10.225/30 is accepted too.
13 no shutdownIOS-XR interfaces start shut down as well.
14commitThe candidate configuration takes effect only now; show ipv4 interface brief then lists the address.

show ip interface brief

1R1#show ip interface brief
2Interface IP-Address OK? Method Status Protocol
3GigabitEthernet0/0 192.168.10.1 YES manual up upMethod manual: typed in this session. After a reload it reads NVRAM; ip address dhcp shows DHCP.
4GigabitEthernet0/1 192.168.10.129 YES manual up up
5GigabitEthernet0/2 192.168.10.225 YES manual up upup/up: Layer 1 and the line protocol are both fine, so the C and L routes are installed.
6GigabitEthernet0/3 unassigned YES unset administratively down downThe factory state: no address (unset) and shut down. down/down instead means no cable or no light from the other end; up/down points to Layer 2 (encapsulation, keepalives).
7Loopback0 10.255.0.1 YES manual up up

show ip route

1R1#show ip route connected | include subnetted
2 192.168.10.0/24 is variably subnetted, 6 subnets, 4 masks3 C and 3 L routes inside the classful 192.168.10.0/24, with masks /25, /26, /30 and /32.
3R1#show ip route 192.168.10.225
4Routing entry for 192.168.10.225/32R1's own address on Gi0/2 matches the L route: a /32 beats the /30.
5 Known via "connected", distance 0, metric 0 (connected)L routes are connected routes: AD 0. They are not redistributed into routing protocols; the C route is.
6 Routing Descriptor Blocks:
7 * directly connected, via GigabitEthernet0/2
8R1#show ip route 192.168.10.226
9Routing entry for 192.168.10.224/30R2's address matches only the C route of the link: R1 ARPs for it out Gi0/2.
10 Known via "connected", distance 0, metric 0 (connected, via interface)
11 Routing Descriptor Blocks:
12 * directly connected, via GigabitEthernet0/2

show ip interface Gi0/0

1R1#show ip interface GigabitEthernet0/0
2GigabitEthernet0/0 is up, line protocol is upThe same up/up as in the brief output.
3 Internet address is 192.168.10.1/25Address and prefix length: the subnet is 192.168.10.0/25.
4 Broadcast address is 255.255.255.255
5 Address determined by setup commandTyped in the CLI. "non-volatile memory" after a reload, "DHCP" with ip address dhcp.
6 MTU is 1500 bytes
7 Secondary address 10.1.10.1/24Each secondary address is listed on its own line.
8 Proxy ARP is enabledOn by default on IOS: R1 answers ARP for addresses it reaches through another interface, which can hide a host with a wrong mask (§16).

show running-config interface

1R1#show running-config interface GigabitEthernet0/0
2Building configuration...
3 
4Current configuration : 168 bytes
5!
6interface GigabitEthernet0/0
7 description Sales LAN - VLAN 10
8 ip address 10.1.10.1 255.255.255.0 secondaryIOS lists the secondary addresses before the primary.
9 ip address 192.168.10.1 255.255.255.128The primary: the source of routing protocol hellos, of ICMP errors and the giaddr of a DHCP relay.
10 duplex auto
11 speed auto
12end

The outputs and messages are typical for IOS-XE; details may vary between versions and platforms.

10.4Remember

Critical for the exam
An interface routes after three things: ip address with a dotted mask, no shutdown (router interfaces start administratively down) and a working link (up/up). IOS then installs C 192.168.10.0/25 and, since IOS 15, L 192.168.10.1/32. It refuses a network or broadcast address (Bad mask /25 for address 192.168.10.0) and any subnet that overlaps another interface (% 192.168.10.128 overlaps with GigabitEthernet0/1).
Theory
The C route says "this subnet is on that wire: ARP for the destination"; the L route says "this exact address is me". A packet to 192.168.10.1 matches the /32 first (longest match) and is processed by R1, not ARPed for. Overlapping interfaces are refused because a connected subnet must lead to exactly one wire: with .128/25 on Gi0/2, Host B at .150 would sit in a connected subnet on two interfaces.
Pitfall
Typing ip address again replaces the primary address, without a warning; a second subnet needs secondary. And secondaries are second-class: routing protocols send their hellos from the primary, so OSPF and EIGRP form no adjacency with a neighbour addressed only in the secondary subnet (EIGRP logs "not on common subnet"), and a DHCP relay uses the primary as giaddr.
Numbers
show ip interface brief, column Method: manual (typed in this session), NVRAM (read from startup-config), DHCP, unset (no address). AD 0 for C and L routes, AD 254 for the default route learned by ip address dhcp. A /32 (Loopback0 10.255.0.1) gets only a C route. /31 on Ethernet is accepted with % Warning: use /31 mask on non point-to-point interface cautiously (RFC 3021).
Pitfall
An SVI is up/up only when VLAN 20 exists and at least one port carrying it (an access port, or a trunk that allows it) is up and forwarding in STP: autostate. Without ip routing a multilayer switch does not route between its SVIs. On a router, a subinterface needs encapsulation dot1Q 20 before IOS accepts an address on it.
Platforms and standards
NX-OS writes ip address 192.168.10.1/25, needs feature interface-vlan for SVIs and no switchport for routed ports. IOS-XR uses ipv4 address 192.168.10.1 255.255.255.128 (or /25), starts interfaces shut and applies nothing until commit; it checks with show ipv4 interface brief. On IOS, terminal ip netmask-format bit-count only changes how show output displays masks.
Verify withshow ip interface briefshow ip route connectedshow ip interface GigabitEthernet0/0show running-config interface GigabitEthernet0/0show ip interface brief vrf all (NX-OS)show ipv4 interface brief (IOS-XR)

10.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

R1 already has ip address 192.168.10.129 255.255.255.192 on Gi0/1. On Gi0/2 you type ip address 192.168.10.190 255.255.255.128. What does IOS do?

  1. AIt refuses it: Bad mask /25 for address 192.168.10.190
  2. BIt accepts it, because .190 is not the address configured on Gi0/1
  3. CIt refuses it: % 192.168.10.128 overlaps with GigabitEthernet0/1
  4. DIt accepts it: longest match keeps the /26 on Gi0/1 working as before
Show answer
Answer: C. 192.168.10.190 AND /25 = 192.168.10.128/25 (.128 – .255), which contains Gi0/1's 192.168.10.128/26 (.128 – .191). IOS refuses any subnet that overlaps another of its interfaces in the same VRF, whatever the host part. It is not a Bad mask error: .190 is neither the network (.128) nor the broadcast (.255) of the /25.
CCNACCNA 200-301Q2

On an IOS 15 router you configure Gi0/3 with ip address 192.168.10.193 255.255.255.224 and no shutdown, and the link comes up. Which routes does Gi0/3 add to the routing table?

  1. AC 192.168.10.192/27 only: L routes exist only for loopbacks
  2. BC 192.168.10.192/27 and L 192.168.10.223/32
  3. CC 192.168.10.193/27 and L 192.168.10.192/32
  4. DC 192.168.10.192/27 and L 192.168.10.193/32
Show answer
Answer: D. The C route is the subnet, the address AND the mask: .193 AND /27 = 192.168.10.192/27. The L route is the router's own address as a /32: 192.168.10.193/32. IOS 15 adds an L route for every interface address; only a /32 interface such as a loopback gets a C route alone, because its subnet already is the address. .223 is the broadcast of the /27, never an L route.
CCNACCNA 200-301Q3

With the mask 255.255.255.224, which of these addresses does IOS refuse on an interface with a Bad mask /27 message?

  1. A192.168.10.193
  2. B192.168.10.226
  3. C192.168.10.222
  4. D192.168.10.223
Show answer
Answer: D. The last octet 223 is 110 11111: all five host bits are 1, so it is the broadcast address of 192.168.10.192/27. .193 and .222 are the first and last usable hosts of that /27. .226 looks like it sits next to a broadcast, but it belongs to the next block, 192.168.10.224/27 (.224 – .255), where it is an ordinary host.
CCNACCNA 200-301Q4

On a multilayer switch, interface Vlan20 has an address and no shutdown, and VLAN 20 exists. show ip interface brief still shows Vlan20 as up / down. What is the most likely cause?

  1. AThe SVI needs no switchport before its line protocol comes up
  2. BNo port carrying VLAN 20 is up and forwarding in STP
  3. CThe SVI's address overlaps another interface of the switch
  4. Dip routing is disabled, and an SVI needs routing to come up
Show answer
Answer: B. Autostate keeps an SVI's line protocol down until at least one port in its VLAN (an access port, or a trunk that allows it) is up and in STP forwarding. Without ip routing the SVI still comes up; the switch simply does not route between VLANs. no switchport is for routed physical ports, and an overlapping address would have been refused when it was typed.
ProfessionalENARSI 300-410Q5

On R1's Ethernet interface Gi0/2 you enter ip address 192.168.10.224 255.255.255.254. What happens?

  1. AIt is accepted with a /31 warning; C 192.168.10.224/31 and L 192.168.10.224/32 appear
  2. BIt is accepted with no message, and only C 192.168.10.224/31 appears, with no L route
  3. CIt is refused: IOS allows a /31 mask only on serial and other point-to-point interfaces
  4. DIt is refused with Bad mask /31 for address 192.168.10.224: .224 is the network address
Show answer
Answer: A. RFC 3021 makes both addresses of a /31 usable hosts, with no network or broadcast address, so .224 is valid and R2 takes .225. IOS accepts it and prints % Warning: use /31 mask on non point-to-point interface cautiously because Ethernet is multi-access. The interface gets its C /31 and an L /32 like any address shorter than /32.
ProfessionalENARSI 300-410Q6

Gi0/0 is the Sales gateway with 192.168.10.1/25. To add a temporary subnet on the same LAN, an engineer enters ip address 10.1.10.1 255.255.255.0 under Gi0/0. What is the result?

  1. ABoth subnets are active: IOS keeps the first and adds the new one as a secondary
  2. BIOS refuses it, because the interface already has a primary address configured
  3. CIOS refuses it with % 10.1.10.0 overlaps with GigabitEthernet0/0
  4. DIt replaces 192.168.10.1/25, and the Sales hosts lose their gateway
Show answer
Answer: D. A second ip address without the secondary keyword replaces the primary, with no warning: C 192.168.10.0/25 and L 192.168.10.1/32 disappear and every Sales host loses .1. The command that was meant is ip address 10.1.10.1 255.255.255.0 secondary. The two subnets do not overlap, so no error is printed either.
ProfessionalENARSI 300-410Q7

BR1's uplink is configured with ip address dhcp. The DHCP offer carries 192.0.2.10/24 and the router option 192.0.2.1. Which additional route appears in BR1's routing table?

  1. ANone: a default route must always be configured by hand
  2. BS* 0.0.0.0/0 [1/0] via 192.0.2.1
  3. CS* 0.0.0.0/0 [254/0] via 192.0.2.1
  4. DC 0.0.0.0/0 [0/0], directly connected to the uplink
Show answer
Answer: C. An IOS DHCP client turns the router option (option 3) into a static default route with administrative distance 254, so any manually configured default route (AD 1) or a default learned from a routing protocol wins over it. The interface also gets its C 192.0.2.0/24 and L 192.0.2.10/32, and show ip interface brief shows the Method DHCP.
CCIECCIE EI v1.1Q8

R1 has 192.168.10.1/25 on Gi0/0 in the global routing table. On Gi0/5 you enter vrf forwarding LAB and then ip address 192.168.10.1 255.255.255.128. What happens?

  1. AIt is refused: % 192.168.10.0 overlaps with GigabitEthernet0/0
  2. BIt is accepted: the overlap check compares only interfaces in the same VRF
  3. CIt is refused: an IPv4 address can be configured only once per router
  4. DIt is accepted, and the global table gets a second C 192.168.10.0/25 via Gi0/5
Show answer
Answer: B. Each VRF has its own routing table, so IOS checks overlaps per VRF: the same subnet, even the same address, can exist in the global table and in VRF LAB. The C and L routes for Gi0/5 go into the LAB table only. The order matters: vrf forwarding removes any IPv4 address already on the interface, so the address is entered after it.

IPv6 address format: 128 bits, hextets and compression rules

CCNA 200-301 v1.1ENCOR 350-401 v1.2CCIE EI v1.1

TL;DRAn IPv6 address is 128 bits, written as 8 hextets of 4 hex digits separated by colons, so every hex digit is one 4-bit nibble. Two rules shorten it: drop the leading zeros of each hextet, and replace one run of consecutive zero hextets with ::, once per address. RFC 5952 turns that into a single canonical form (lowercase, :: on the longest run of two or more, the first one on a tie, never for a single zero), and expanding works backwards: 8 minus the hextets written is what :: hides.

The terms, in short
Hextet
One of the 8 groups of 16 bits, written as up to 4 hex digits: 2001, 0db8, 0000… 8 × 16 = 128 bits.
Nibble
4 bits, exactly one hex digit. A full address is 32 nibbles, and a /64 is the first 16 of them.
Leading zeros (rule 1)
Zeros at the start of a hextet may be dropped: 0db8 → db8, 0000 → 0, 0800 → 800. Zeros at the end never.
Double colon :: (rule 2)
Replaces one run of consecutive all-zero hextets, once per address: 2001:db8:0:0:8:800:200c:417a → 2001:db8::8:800:200c:417a.
Canonical form
The one text form RFC 5952 recommends for output: lowercase, no leading zeros, :: on the longest run (the first on a tie), never for a single zero hextet.
Prefix length
/n after the address: the first n bits are the prefix, as in IPv4 CIDR but with no dotted mask. 2001:db8:acad:10::1/64.
Zone ID
%name after a link-local address, naming the interface to use: fe80::1%eth0 on Linux, fe80::1%12 on Windows. It never goes into the packet.

11.1The step-by-step animation

  1. An IPv6 address is 128 bits: 2128 ≈ 3.4 × 1038 addresses, against 232 ≈ 4.3 billion in IPv4. Written in full it is 8 groups of 16 bits, the hextets, each in 4 hex digits and separated by colons. One hex digit is one nibble (4 bits), so the whole address is 32 hex digits. The example from RFC 4291: 2001:0db8:0000:0000:0008:0800:200c:417a.The address: bits 128 = 8 hextets × 16 · written 32 hex digits, 7 colons · address space 2^128 ≈ 3.4 × 10^38
  2. Rule 1: in every hextet, drop the leading zeros. 0db8 becomes db8, 0000 becomes 0, 0008 becomes 8 and 0800 becomes 800. Only leading zeros go: the two zeros at the end of 0800 are part of its value (0x800 = 2048), so writing 8 would name another address. Every hextet keeps at least one digit.The address: in full 2001:0db8:0000:0000:0008:0800:200c:417a · rule 1 2001:db8:0:0:8:800:200c:417a · kept trailing zeros: 0800 → 800, never 8
  3. Rule 2: replace one run of consecutive all-zero hextets with ::. Hextets 3 and 4 are both 0, so 2001:db8:0:0:8:800:200c:417a becomes 2001:db8::8:800:200c:417a. To expand it again, count what is written: 6 hextets, so the :: stands for 8 − 6 = 2 zero hextets.The address: rule 1 2001:db8:0:0:8:800:200c:417a · rule 2 2001:db8::8:800:200c:417a · :: 8 − 6 written = 2 zero hextets
  4. Wrong: 2001:db8::1::2. Each :: hides some zero hextets, and with 4 hextets written, 8 − 4 = 4 must be shared between two of them: 1 + 3, 2 + 2 or 3 + 1. Those are three different addresses, so the text is ambiguous and invalid: :: may appear only once. R1 refuses the line (% Invalid input detected), and every host refuses it too.The address: typed 2001:db8::1::2 · written 4 hextets → 4 hidden · readings 1 + 3 · 2 + 2 · 3 + 1 → invalid
  5. Many spellings, one address: 2001:DB8:0:0:8:800:200C:417A, 2001:0db8::0008:0800:200c:417a and 2001:db8::8:800:200c:417a are all valid. RFC 5952 picks one canonical form so that logs, configs and searches match: lowercase, no leading zeros, :: on the longest run of zero hextets, the first run on a tie, and never :: for a single zero hextet.RFC 5952: tie 2001:db8:0:0:1:0:0:1 → 2001:db8::1:0:0:1 · longest wins 2001:db8:0:0:1:0:0:0 → 2001:db8:0:0:1:: · single 0 2001:db8:0:1:1:1:1:1 stays as it is
  6. Expanding works backwards. R1's Gi0/0 has 2001:db8:acad:10::1/64: 5 hextets are written, so :: hides 8 − 5 = 3, and every hextet is padded back to 4 digits: 2001:0db8:acad:0010:0000:0000:0000:0001. A /64 is 16 nibbles, exactly the first 4 hextets: the prefix is 2001:db8:acad:10::/64 and the last 4 hextets are the interface ID. Host A pings it.The address: typed 2001:db8:acad:10::1/64 · expanded 2001:0db8:acad:0010:0000:0000:0000:0001 · prefix | interface ID 2001:db8:acad:10 | ::1
  7. Two more notations. A zone ID after % names the interface for a link-local address: every interface owns fe80::/64, so Host A types ping fe80::1%eth0 (Linux; Windows uses the interface number, %12). Mixed notation writes the last 32 bits as dotted IPv4: ::ffff:192.0.2.1 is the IPv4-mapped form of 192.0.2.1 (§12). Neither changes the 128 bits: the zone never goes on the wire.The address: zone ID fe80::1%eth0 → interface eth0, not sent · mixed ::ffff:192.0.2.1 = ::ffff:c000:201 · in a URL http://[2001:db8:acad:10::1]:8080/

11.2Simulator: compress, expand and validate an IPv6 address

Any IPv6 text form, with an optional /prefix or %zone

Type the address the way you saw it: in full, compressed, uppercase, with :: in the wrong place. The simulator checks it, expands it to all 32 hex digits, applies the two rules and gives the RFC 5952 canonical form, with the reason when your text is not canonical or not valid.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

StepResult
Typed2001:0db8:0000:0000:0008:0800:200c:417a
Hextets written8, no ::
Full form (expanded)2001:0db8:0000:0000:0008:0800:200c:417a
Rule 1: drop leading zeros2001:db8:0:0:8:800:200c:417a
Rule 2: :: on the longest zero run2001:db8::8:800:200c:417a
Canonical (RFC 5952)2001:db8::8:800:200c:417a
Runs of zero hextetshextets 3–4 (2)
If it is a /64 (a LAN)prefix 2001:db8::/64, interface ID 8:800:200c:417a
Hextet12345678
nibbles2 0 0 10 d b 80 0 0 00 0 0 00 0 0 80 8 0 02 0 0 c4 1 7 a
bits0–1516–3132–4748–6364–7980–9596–111112–127
Hextet 1 = 20012001
4 bits per digit0010000000000001
value0x2001 = 8,193 in decimal, bits 0–15 of the address
Valid, but not the canonical form: write 2001:db8::8:800:200c:417a
  • Leading zeros kept in 0db8, 0000, 0000, 0008, 0800: rule 1 writes db8, 0, 0, 8, 800.
  • The run of 2 zero hextets (hextets 3–4) is not shortened with ::.
  • Rule 1 (leading zeros): 2001:db8:0:0:8:800:200c:417a. Rule 2 (::): 2001:db8::8:800:200c:417a — :: replaces hextets 3–4, 2 zero hextets.

11.3The configuration, line by line

R1 · IOS-XE

1interface GigabitEthernet0/0The Sales LAN, VLAN 10.
2 ipv6 address 2001:0DB8:ACAD:0010:0000:0000:0000:0001/64Typed in full and in capitals: IOS accepts any valid text form of the same 128 bits. The prefix length follows a slash; IPv6 has no dotted mask.
3 ipv6 address FE80::1 link-localA short link-local address, easy to read in neighbor tables and as the hosts' default gateway (§12).
4 no shutdown
5interface GigabitEthernet0/1The Engineering LAN, VLAN 20.
6 ipv6 address 2001:DB8:ACAD:20::1/64Typed compressed: stored the same way.
7 ipv6 address FE80::1 link-localThe same link-local on a second interface is legal: it only has to be unique on its own link. That is why a link-local destination needs a zone.

show ipv6 interface brief

1R1#show ipv6 interface brief
2GigabitEthernet0/0 [up/up]
3 FE80::1The link-local address is listed first.
4 2001:DB8:ACAD:10::1Typed as 2001:0DB8:ACAD:0010:0000:0000:0000:0001: IOS shows the compressed form, in uppercase.
5GigabitEthernet0/1 [up/up]
6 FE80::1
7 2001:DB8:ACAD:20::1

NX-OS · IOS-XR

1! NX-OS: the same slash notation; output in lowercase
2interface Ethernet1/1
3 no switchportA routed port.
4 ipv6 address 2001:db8:acad:10::1/64Shown back exactly like this, in the RFC 5952 form.
5 ipv6 link-local fe80::1NX-OS sets a static link-local with its own keyword.
6! IOS-XR
7interface GigabitEthernet0/0/0/0
8 ipv6 address 2001:db8:acad:10::1/64
9 ipv6 address fe80::1 link-localThe same keyword as IOS.

Wrong

1interface GigabitEthernet0/0
2 ipv6 address 2001:DB8::1::2/64Two :: in one address: there is no way to tell how many zero hextets each one hides.
3% Invalid input detected at '^' marker.The parser rejects the line; nothing is configured.
4 ipv6 address 2001:DB8:ACAD:00010::1/64Five digits in one group: a hextet holds at most 4 hex digits (16 bits). Rejected the same way.
5 ipv6 address 2001:DB8:ACAD:10:0:0:0:0:1/64Nine groups is 144 bits. Rejected.
6 ipv6 address 2001:DB8:ACAD:1::1/64Accepted, and wrong: 0010 shortens to 10, never to 1. Only leading zeros go, so this is subnet 1, not the Sales subnet 10.

Host A · zone ID

1$ ping -c 2 fe80::1%eth0Linux: the zone is the interface name.
2PING fe80::1%eth0(fe80::1%eth0) 56 data bytes
364 bytes from fe80::1%eth0: icmp_seq=1 ttl=64 time=0.412 msThe reply carries the zone too: the address alone does not say which link it came from.
464 bytes from fe80::1%eth0: icmp_seq=2 ttl=64 time=0.388 ms
5$ ping -c 1 fe80::1Without the zone…
6ping: connect: Invalid argument… the host cannot pick an interface for a link-local destination. Windows: ping fe80::1%12, the interface index.
7$ curl http://[2001:db8:acad:10::1]:8080/In a URL the address goes in square brackets, so its colons are not read as the port separator (RFC 3986).

R1 · ping a link-local

1R1#ping FE80::250:56FF:FEA1:1B01
2Output Interface: GigabitEthernet0/0IOS asks for the zone: every interface has an fe80:: address, so the address alone does not say which link.
3Type escape sequence to abort.
4Sending 5, 100-byte ICMP Echos to FE80::250:56FF:FEA1:1B01, timeout is 2 seconds:
5Packet sent with a source address of FE80::1%GigabitEthernet0/0IOS writes the zone after % as well.
6!!!!!
7Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms

The outputs are typical for IOS-XE and Linux; details may vary between versions.

11.4Remember

Critical for the exam
The two rules: drop the leading zeros of each hextet (0800 → 800, never 8), and replace one run of consecutive zero hextets with ::, once per address (RFC 5952 output: only a run of two or more). To expand, 8 minus the hextets written is what :: hides: 2001:db8::8:800:200c:417a has 6, so :: = 2 zero hextets.
Theory
:: may appear only once because the reader rebuilds the address by counting: 8 hextets minus those written. With two :: the missing zeros can be split several ways (2001:db8::1::2 has three readings), so the text no longer names one address. Hex is used because one digit is one nibble: 128 bits = 32 digits, and any prefix that is a multiple of 4 ends exactly between two digits (§13).
Pitfall
Dropping the wrong zeros changes the address. 2001:db8:acad:10::1 is not 2001:db8:acad:1::1 (0010 → 10, not 1), and 0800 is not 8. When you pad a hextet back, the zeros go on the left: 10 → 0010, never 1000.
Numbers
128 bits = 8 hextets × 16 bits = 32 nibbles; 2128 ≈ 3.4 × 1038 addresses. A /64 is 4 hextets, and holds 264 ≈ 1.8 × 1019 interface IDs. RFC 4291 defines the format and the two rules, RFC 5952 the canonical text, RFC 4007 the zone ID (%), RFC 3986 the brackets in URLs.
Pitfall
Valid is not the same as canonical. RFC 4291 lets :: replace a single zero hextet, so 2001:db8::1:1:1:1:1 is valid (and one character shorter), but RFC 5952 output writes 2001:db8:0:1:1:1:1:1. :: on the shorter run and uppercase digits are also accepted on input, while the canonical form puts :: on the longest run (the first on a tie: 2001:db8::1:0:0:1) in lowercase. Read the question: "most compressed" and "RFC 5952 form" can differ on a single zero.
Platforms and standards
IOS and IOS-XE print IPv6 in uppercase (2001:DB8:ACAD:10::1); NX-OS, IOS-XR, Linux and Windows in lowercase. All of them accept any valid form as input. Zone IDs: Linux uses the interface name (fe80::1%eth0), Windows the interface index (%12), and IOS asks for Output Interface: when you ping a link-local address.
Verify withshow ipv6 interface briefshow running-config interface GigabitEthernet0/0 | include ipv6show ipv6 interface GigabitEthernet0/0

11.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

What is the shortest valid way to write 2001:0db8:0000:0000:0008:0800:200c:417a?

  1. A2001:db8::0008:0800:200c:417a
  2. B2001:db8::8:800:200c:417a
  3. C2001:db8::8:8:200c:417a
  4. D2001:db8:0:8:800:200c:417a
Show answer
Answer: B. Drop the leading zeros of each hextet (0db8 → db8, 0008 → 8, 0800 → 800) and replace the run of two zero hextets with ::. Writing 8 for 0800 removes trailing zeros, which changes the value to 0x0008; 2001:db8:0:8:800:200c:417a has only 7 hextets and no ::, so it is invalid; 2001:db8::0008:0800:200c:417a is valid but keeps leading zeros.
CCNACCNA 200-301Q2

R1's Gi0/0 shows 2001:DB8:ACAD:10::1/64. What is the address written in full?

  1. A2001:0db8:acad:1000:0000:0000:0000:0001
  2. B2001:0db8:acad:0010:0000:0000:0000:0001
  3. C2001:0db8:acad:0010:0000:0000:0001
  4. D2001:0db8:acad:0010:0001:0000:0000:0000
Show answer
Answer: B. Five hextets are written, so :: hides 8 − 5 = 3 zero hextets, placed where the :: is; then each hextet is padded on the left to 4 digits (10 → 0010). Padding on the right (1000) changes the value, the 7-hextet answer forgets one hidden zero, and the answer that puts 0001 right after 0010 moves the 1 to the wrong side of the ::.
CCNACCNA 200-301Q3

Following RFC 5952, how is 2001:0db8:0000:0000:0001:0000:0000:0001 written?

  1. A2001:db8::1:0:0:1
  2. B2001:db8::1::1
  3. C2001:db8::1:0:0:0:1
  4. D2001:db8:0:0:1::1
Show answer
Answer: A. There are two runs of two zero hextets, a tie, and RFC 5952 puts :: on the first run. 2001:db8:0:0:1::1 is the same address but not the canonical form; 2001:db8::1::1 uses :: twice and is invalid; 2001:db8::1:0:0:0:1 writes 7 hextets, so its :: hides only one and it names 2001:db8:0:1:0:0:0:1, another address.
CCNACCNA 200-301Q4

What is the RFC 5952 text form of 2001:0db8:0000:0001:0001:0001:0001:0001?

  1. A2001:db8:0:1:1:1:1:1
  2. B2001:db8:0:1::1
  3. C2001:db8::1:1:1:1:1
  4. D2001:db8:0000:1:1:1:1:1
Show answer
Answer: A. Only one hextet is zero, and RFC 5952 never uses :: for a single zero hextet, so it stays 0. 2001:db8::1:1:1:1:1 is accepted as input but is not the canonical form; 2001:db8:0:1::1 is a different address (its :: hides three hextets: 2001:db8:0:1:0:0:0:1); 0000 still has leading zeros.
ProfessionalENARSI 300-410Q5

To filter the Sales LAN, 2001:db8:acad:0010::/64, an engineer adds permit ipv6 2001:DB8:ACAD:1::/64 any to an IPv6 ACL on R1. What happens to traffic from the Sales hosts?

  1. AIt is matched: IOS stores 0010 as 1, so both forms name exactly the same /64 prefix
  2. BIt is not matched: 1 expands to 0001, so the entry names subnet 1, not subnet 10
  3. CThe line is rejected: a /64 prefix must be written with its four hextets in full
  4. DIt is matched: a /64 entry compares only the first three hextets of the source
Show answer
Answer: B. Only leading zeros may be dropped, so 0010 shortens to 10, and the 1 in the ACL means 0001: the entry permits 2001:db8:acad:1::/64, another subnet. The line is valid, which is why the mistake is silent: Sales traffic falls through to the implicit deny ipv6 any any. A /64 compares four whole hextets, not three, and :: is allowed in a prefix.
ProfessionalENARSI 300-410Q6

On R1 you type ping FE80::250:56FF:FEA1:1B01 and IOS answers Output Interface:. Why does it ask?

  1. AAn extended ping is always required when the destination is an EUI-64 address learned from a neighbor
  2. BIOS treats any address that starts with FE as multicast, so it needs to know the outgoing interface first
  3. CEvery interface owns an fe80::/64 address, so a link-local destination does not say which link to use
  4. DLink-local addresses are not in the routing table, so IOS first needs a source address for the echo request
Show answer
Answer: C. Link-local addresses are unique only per link, and every interface owns fe80::/64, so the routing table cannot pick an exit for the destination until you name the interface: the zone, written fe80::…%eth0 on Linux or %12 on Windows. IOS picks the source itself (here FE80::1%GigabitEthernet0/0); FE80 is unicast, multicast starts with FF, and EUI-64 has nothing to do with it.
CCIECCIE EI v1.1Q7

A syslog server stores 2001:DB8:0:0:1::1 from one router and 2001:db8::1:0:0:1 from another. A correlation rule matches source addresses as plain strings. What happens, and what is the fix?

  1. AThe first one is invalid, because uppercase hex digits and :: cannot be combined in one address
  2. BThey are the same address but never match as strings; normalize to the RFC 5952 form first
  3. CThey are different addresses, because the :: hides different zero hextets in each of the two
  4. DThey match, because RFC 5952 requires every device to log addresses in exactly the same form
Show answer
Answer: B. Both expand to 2001:0db8:0000:0000:0001:0000:0000:0001, but as strings they differ (case, and which zero run got the ::). Tools must parse to 128 bits or normalize to the canonical form (lowercase, :: on the first of the two equal runs: 2001:db8::1:0:0:1). RFC 5952 is a recommendation for output, and IOS itself prints uppercase, so devices do not all log the same text.

IPv6 address types: global, unique local, link-local, multicast and the special ones

CCNA 200-301 v1.1ENCOR 350-401 v1.2ENARSI 300-410SPCOR 350-501 v1.1CCIE EI v1.1

TL;DRThe first hex digits tell you the type: 2000::/3 global unicast (routed on the Internet), fc00::/7 unique local (fd00::/8 in practice, private), fe80::/10 link-local (on every interface, never routed), ff00::/8 multicast, plus ::1, :: and a few special blocks. There is no broadcast: multicast groups such as ff02::1 and the solicited-node groups replace it. One interface always holds several addresses at once, and each reaches only as far as its scope.

The terms, in short
GUA
Global unicast address, 2000::/3 (first 3 bits 001, so 2xxx or 3xxx): routed on the Internet. Usually a /48 site prefix + 16-bit subnet ID + 64-bit interface ID.
ULA
Unique local address, fc00::/7, in practice fd00::/8 with a random 40-bit Global ID (fd12:3456:789a::/48): private, never on the Internet.
Link-local
fe80::/10 (fe80::/64 in practice): created on every IPv6 interface, valid only on its link, never forwarded. NDP and routing protocols run on it.
Multicast scope
The 4th hex digit of an ff00::/8 address: 1 interface, 2 link, 5 site, 8 organization, e global. ff02::1 never leaves the link.
Solicited-node group
ff02::1:ff + the last 24 bits of a unicast address: ff02::1:ffa1:1b01 for Host A. Neighbor Solicitations go there instead of a broadcast.
Anycast
One unicast address on several devices; the routing picks the nearest. It looks like any unicast address; the Subnet-Router anycast (prefix + all-zero interface ID) is predefined.
Unspecified and loopback
:: (all zeros) means "no address yet" and is only a source; ::1 is the host itself and never leaves it.

12.1The step-by-step animation

  1. Host A boots on the Sales LAN. Before any router speaks, it gives itself a link-local address: the prefix fe80::/64 plus a 64-bit interface ID, here built from its MAC (EUI-64, §14): fe80::250:56ff:fea1:1b01. Every IPv6 interface has one, it is valid only on this link, and routers never forward it. Everything Host A sends next uses it as the source.Host A: type link-local unicast, fe80::/10 · address fe80::250:56ff:fea1:1b01 · scope this link only
  2. IPv6 has no broadcast: one-to-many traffic is multicast, ff00::/8. Host A joins ff02::1, all nodes on the link, and its solicited-node group ff02::1:ffa1:1b01: ff02::1:ff plus the last 24 bits of its address. Neighbor Solicitations for its address go to that group, so they disturb only the hosts whose addresses end the same way. An MLD report announces the solicited-node group to snooping switches; ff02::1 is never reported, because every node is in it.Host A: ff02::1 all nodes, link scope · ff02::1:ffa1:1b01 solicited-node = ff02::1:ff + a1:1b01 · on Ethernet 33:33 + last 32 bits = 3333.ffa1.1b01
  3. Host A needs a prefix and a gateway, so it sends a Router Solicitation (ICMPv6 type 133) from its link-local address to ff02::2, all routers on the link. R1 is a member of ff02::2 because it routes IPv6; the printer is not, so its network card drops the frame. The whole exchange runs on link-local and multicast addresses, because Host A has no global address yet.On the wire: src fe80::250:56ff:fea1:1b01 · dst ff02::2 (all routers) · ICMPv6 type 133 Router Solicitation · hop limit 255
  4. R1 answers with a Router Advertisement (ICMPv6 type 134) from fe80::1 to ff02::1, so every node on the link hears it. It carries the prefix 2001:db8:acad:10::/64 with the A flag (build your own address) and a router lifetime of 1800 s. The source is link-local on purpose: hosts take fe80::1 as their default gateway, which stays the same if the global prefix is ever renumbered.On the wire: src fe80::1 (R1 Gi0/0) · dst ff02::1 (all nodes) · prefix 2001:db8:acad:10::/64, A = 1 · router lifetime 1800 s
  5. Host A builds its global unicast address from the advertised /64 and the same interface ID: 2001:db8:acad:10:250:56ff:fea1:1b01 (how, and the duplicate check, in §14). It lies in 2000::/3, the block of every global address, and here in 2001:db8::/32, the documentation prefix this guide uses as a stand-in. The interface now holds several addresses at once, and both unicast addresses share one solicited-node group, because they end in the same 24 bits.Host A: global 2001:db8:acad:10:250:56ff:fea1:1b01/64 · link-local fe80::250:56ff:fea1:1b01/64 · gateway fe80::1
  6. Who is on my link? ping ff02::1 reaches every IPv6 node on the Sales LAN at once (Host A itself included), and each answers from its link-local address: R1 from fe80::1, the printer from its own. It is the closest thing IPv6 has to a broadcast, but its scope is 2, link-local: R1 never forwards it, so Host B on the Engineering LAN does not see it.On the wire: dst ff02::1 (scope 2 = link) · replies fe80::1 (R1) · fe80::1c2b:… (printer) · forwarded by R1 never
  7. Wrong: a packet for Host B leaves Host A with its link-local address as the source. R1 must drop it, because a link-local address is meaningless beyond its link, and it may answer with ICMPv6 Destination Unreachable, code 2, "beyond scope of source address". From the global address the same packet is routed to Host B. Each type reaches as far as its scope.On the wire: src fe80::250:56ff:fea1:1b01 dropped at R1 · ICMPv6 type 1, code 2: beyond scope of source · src 2001:db8:acad:10:250:56ff:fea1:1b01 routed to Host B

12.2Simulator: what type of IPv6 address is this?

Any IPv6 address, optionally with /prefix or %zone

The finder does what you should do at a glance on the exam: read the first hex digits, find the most specific block, and say where the address is valid and how far it travels. The four flags come from the IANA special-purpose registry (RFC 6890).

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

fe80::1Answer
TypeLink-local unicast
Most specific blockfe80::/10 · Link-local unicast
Also inside—
StandardRFC 4291
ScopeLink
Valid as sourceYes, on its own link
Valid as destinationYes, on its own link
Forwarded by routersNo: never forwarded (RFC 4291)
Reachable fromThis link only
Used forEvery IPv6 interface has one (fe80::/64 in practice); never routed
Structurefe80::/10 · 54 bits that must be 0 · interface ID 0:0:0:1
Solicited-node groupff02::1:ff00:1 (on Ethernet 3333.ff00.0001)

In full: fe80:0000:0000:0000:0000:0000:0000:0001

fe80::1 is link-local (fe80::/10): this link only, never routed
  • Every IPv6 interface creates one, even with no global prefix. NDP, router advertisements and the routing protocols (OSPFv3, EIGRP, next hops) use it; routers never forward a packet with a link-local source or destination to another link.
  • Because every interface has one, pinging it needs the interface too: ping fe80::1%eth0 on Linux, Output Interface: on IOS (§11).

12.3The configuration, line by line

R1 · IOS-XE

1ipv6 unicast-routingR1 forwards IPv6, joins ff02::2 and sends Router Advertisements (§15).
2interface GigabitEthernet0/0Sales LAN, VLAN 10.
3 ipv6 address FE80::1 link-localReplaces the automatic EUI-64 link-local. It is the source of R1's RAs, so the hosts use FE80::1 as their gateway.
4 ipv6 address 2001:DB8:ACAD:10::1/64The global address (a documentation prefix standing in for a real GUA). The all-zero interface ID, 2001:DB8:ACAD:10::, stays free: RFC 4291 reserves it as the Subnet-Router anycast address of this subnet.
5! ipv6 address FD12:3456:789A:10::1/64Optional ULA on the same interface: the RA would carry both prefixes, and every host would build both addresses.
6interface Loopback0
7 ipv6 address 2001:DB8:ACAD:FFFF::1/128A /128: one address, for the router ID and management.

show ipv6 interface Gi0/0

1R1#show ipv6 interface GigabitEthernet0/0
2GigabitEthernet0/0 is up, line protocol is up
3 IPv6 is enabled, link-local address is FE80::1The link-local address, always there.
4 No Virtual link-local address(es):
5 Global unicast address(es):
6 2001:DB8:ACAD:10::1, subnet is 2001:DB8:ACAD:10::/64The global address and its /64.
7 Joined group address(es):
8 FF02::1All nodes: every IPv6 interface joins it.
9 FF02::2All routers: joined because of ipv6 unicast-routing.
10 FF02::1:FF00:1The solicited-node group of both FE80::1 and 2001:DB8:ACAD:10::1: they share the last 24 bits (00:0001), so one group serves both.
11 MTU is 1500 bytes
12 ND DAD is enabled, number of DAD attempts: 1
13 ND router advertisements are sent every 200 seconds
14 ND router advertisements live for 1800 secondsThe router lifetime carried in each RA.
15 Hosts use stateless autoconfig for addresses.

Host A · Linux

1$ ip -6 addr show dev eth0
22: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
3 inet6 2001:db8:acad:10:250:56ff:fea1:1b01/64 scope global dynamicThe GUA built from the RA; "dynamic" because it has lifetimes from the RA.
4 valid_lft 2591998sec preferred_lft 604798secIOS advertises 30 days valid, 7 days preferred by default.
5 inet6 fe80::250:56ff:fea1:1b01/64 scope linkThe link-local address: scope link.
6 valid_lft forever preferred_lft forever
7$ ip -6 maddr show dev eth0
82: eth0
9 link 33:33:ff:a1:1b:01The Ethernet MAC of the solicited-node group: 33:33 + its last 32 bits.
10 inet6 ff02::1:ffa1:1b01The solicited-node group.
11 inet6 ff02::1All nodes.
12$ ip -6 route show default
13default via fe80::1 dev eth0 proto ra metric 1024 expires 1797secThe gateway is R1's link-local address, learned from the RA.
14$ ping -c 1 ff02::1%eth0A link-scope group needs the zone, like a link-local address.
1564 bytes from fe80::250:56ff:fea1:1b01%eth0: icmp_seq=1 ttl=64 time=0.041 msHost A itself: it is a member of ff02::1 too, so it answers its own echo.
1664 bytes from fe80::1%eth0: icmp_seq=1 ttl=64 time=0.402 ms (DUP!)R1. Every further reply to the same echo is marked DUP!.
1764 bytes from fe80::1c2b:9e4f:a7d0:3b61%eth0: icmp_seq=1 ttl=64 time=0.913 ms (DUP!)The printer.

NX-OS · IOS-XR

1! NX-OS
2interface Ethernet1/1
3 no switchport
4 ipv6 address 2001:db8:acad:10::1/64
5 ipv6 link-local fe80::1NX-OS has its own keyword for a static link-local address.
6! IOS-XR
7interface GigabitEthernet0/0/0/0
8 ipv6 address fe80::1 link-localSame keyword as IOS.
9 ipv6 address 2001:db8:acad:10::1/64

Wrong

1interface GigabitEthernet0/0
2 ipv6 address FEC0:0:0:10::1/64Site-local fec0::/10, deprecated by RFC 3879 in 2004: current stacks treat it as an ordinary global address. For private addressing use a ULA from fd00::/8.
3 ipv6 address FD00::1/64A ULA with a Global ID of 0: legal syntax, but every network that does this uses the same prefix, and they collide at the first merger or VPN. RFC 4193 wants a random 40-bit Global ID, as in fd12:3456:789a::/48.
4! ping FF02::1 from Host B to find the Sales hostsLink scope: R1 never forwards ff02::/16 off its link. There is no "all nodes of the site" group; reach hosts by their global addresses.

The outputs are typical for IOS-XE and Linux; details may vary between versions.

12.4Remember

Critical for the exam
Recognize the type from the first digits: 2xxx or 3xxx global unicast (2000::/3), fdxx unique local (fc00::/7), fe80 link-local (fe80::/10), ffxx multicast (ff00::/8), ::1 loopback, :: unspecified. IPv6 has no broadcast: ff02::1 and the solicited-node groups do that job. The CCNA types are global unicast, unique local, link-local, multicast, anycast and modified EUI-64 (§14).
Theory
Link-local addresses exist before any prefix does, so NDP (RS, RA, NS, NA) and the routing protocols always have an address to talk from: OSPFv3 and EIGRP hellos and next hops are link-local. Routers advertise themselves from fe80::, which is why a host's gateway is fe80::1 and survives a change of the global prefix.
Pitfall
fc00::/7 is the ULA block, but only fd00::/8 (L bit = 1, locally assigned) is defined, and its 40-bit Global ID must be random: fd00::/48 everywhere collides on the first merger. A ULA is not "RFC 1918 with NAT": it is routed normally inside the organization and simply filtered at the edge.
Numbers
Solicited-node: ff02::1:ff + the last 24 bits (ff02::1:ff00:0/104); multicast MAC 33:33 + the last 32 bits (3333.ffa1.1b01). Scopes: 1 interface, 2 link, 4 admin, 5 site, 8 organization, e global. Groups: ff02::1 all nodes, ::2 all routers, ::5/::6 OSPFv3, ::9 RIPng, ::a EIGRP, ::d PIM, ::16 MLDv2 reports, ::1:2 DHCPv6. 2001:db8::/32 and 3fff::/20 are documentation (RFC 3849, RFC 9637), 64:ff9b::/96 NAT64 (RFC 6052).
Pitfall
The tempting wrong answers: fec0::/10 (site-local) was deprecated in 2004 (RFC 3879), so it is never the answer for "private IPv6"; 2001:db8:: looks global but is documentation only; an anycast address cannot be told from unicast by looking at it; and a link-local destination (or ff02::1) needs an interface, the zone, to be pinged.
Platforms and standards
RFC 4291 defines the architecture and types, RFC 4193 ULA, RFC 3879 the end of site-local, RFC 7346 the scope values. IOS lists an interface's groups in show ipv6 interface; Linux in ip -6 maddr, Windows in netsh interface ipv6 show joins. Cisco IOS builds its link-local addresses with EUI-64; Windows uses random interface IDs by default (§14).
Verify withshow ipv6 interface briefshow ipv6 interface GigabitEthernet0/0show ipv6 routeshow ipv6 neighbors

12.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

Host A has the global address 2001:db8:acad:10:250:56ff:fea1:1b01. Which solicited-node multicast group does it join?

  1. Aff02::1:ffa1:1b01
  2. Bff02::1:fea1:1b01
  3. Cff05::1:ffa1:1b01
  4. Dff02::1:ff00:1b01
Show answer
Answer: A. The solicited-node group is ff02::1:ff followed by the last 24 bits of the unicast address, here a1:1b01. Copying only 16 bits gives ff02::1:ff00:1b01; copying the last 32 bits (fea1:1b01) without the ff gives ff02::1:fea1:1b01, a different group; and the group has link scope (ff02), not site scope (ff05), because Neighbor Solicitations never leave the link.
CCNACCNA 200-301Q2

What does IPv6 use instead of the IPv4 broadcast?

  1. AAnycast to the all-routers address ff02::2 on the link
  2. BMulticast, for example ff02::1 for all nodes on the link
  3. CUnicast copies sent to every address in the /64 prefix
  4. DA broadcast to ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
Show answer
Answer: B. IPv6 has no broadcast at all: one-to-many delivery is multicast, with ff02::1 reaching every node on the link and the solicited-node groups replacing ARP's broadcast. ff02::2 is a multicast group (all routers), not anycast, and the all-ones address starts with ff, so it is a multicast address (with the reserved scope f), not a broadcast.
CCNACCNA 200-301Q3

Which prefix follows RFC 4193 for a company's unique local addresses?

  1. Afe80:3456:789a::/48
  2. Bfd12:3456:789a::/48
  3. Cfec0:3456:789a::/48
  4. Dfc12:3456:789a::/48
Show answer
Answer: B. A ULA prefix is fd (fc00::/7 with the L bit set to 1), then a random 40-bit Global ID (12:3456:789a), giving a /48. fc12… has L = 0, a half of the block that is not defined; fec0… is the site-local block deprecated in 2004; fe80… is link-local and cannot be routed.
CCNACCNA 200-301Q4

Which of these addresses can be routed on the Internet?

  1. A2001:db8:acad::1
  2. B2606:4700::1111
  3. Cfd00:1::1
  4. Dfe80::2606:4700
Show answer
Answer: B. 2606:4700::1111 is in 2000::/3, the global unicast block (inside 2600::/12, which IANA gave to ARIN). 2001:db8::/32 looks global but is reserved for documentation, fd00::/8 is unique local and filtered at the edge, and fe80::/10 never leaves its link, whatever the interface ID looks like.
ProfessionalENARSI 300-410Q5

An application on Host A sends a packet to Host B (2001:db8:acad:20::/64, behind R1) with the link-local source fe80::250:56ff:fea1:1b01. What does R1 do?

  1. ADrops it, because a link-local source cannot leave its link; it may return ICMPv6 type 1, code 2
  2. BForwards it after replacing the source with its own global address on Gi0/1, the way NAT would
  3. CDrops it silently, because any source in fe80::/10 is treated as a multicast group address
  4. DForwards it, because only the destination address decides whether a packet is routed off the link
Show answer
Answer: A. RFC 4291 forbids routers to forward a packet with a link-local source or destination to another link, because the address means nothing there: Host B could not even answer it. RFC 4443 gives the error, Destination Unreachable code 2, "beyond scope of source address". Routers do not rewrite IPv6 sources, and fe80::/10 is unicast; multicast is ff00::/8.
ProfessionalENCOR 350-401 · ENARSI 300-410Q6

OSPFv3 runs on R1's Gi0/0, where R1 is a DROther. From which source and to which destination does it send its Hellos?

  1. AFrom its global address to ff05::5
  2. BFrom its global address to ff02::5
  3. CFrom its link-local address to ff02::5
  4. DFrom its link-local address to ff02::6
Show answer
Answer: C. OSPFv3 Hellos go to ff02::5 (AllSPFRouters) with the interface's link-local address as source; neighbors and next hops are link-local addresses. A global source is not used for Hellos, ff05 would be site scope, and ff02::6 (AllDRouters) is the group only the DR and BDR listen on.
ProfessionalSPCOR 350-501Q7

An IPv6-only host receives 64:ff9b::c000:221 from DNS64. Which IPv4 address will the NAT64 gateway contact?

  1. A192.0.0.221
  2. B12.0.2.33
  3. C192.0.2.33
  4. D192.0.2.21
Show answer
Answer: C. 64:ff9b::/96 is the NAT64 well-known prefix (RFC 6052), so the last 32 bits are the IPv4 address: c0 00 02 21 in hex = 192.0.2.33, also written 64:ff9b::192.0.2.33. Reading 21 as decimal gives .21, and splitting the hex digits in the wrong places gives 192.0.0.221 or 12.0.2.33.
CCIECCIE EI v1.1Q8

R1's Gi0/0 has FE80::1, 2001:DB8:ACAD:10::1/64 and FD12:3456:789A:10::1/64, with ipv6 unicast-routing and OSPFv3 (R1 is a DROther). Which joined-group list does show ipv6 interface show?

  1. AFF02::1, FF02::2, FF02::5 and FF02::1:FF00:1
  2. BFF02::1, FF02::5 and FF02::1:FF00:1, without FF02::2 until R1 is DR
  3. CFF02::1, FF02::2, FF02::5, FF02::6 and FF02::1:FF00:1
  4. DFF02::1, FF02::2, FF02::5 and three solicited-node groups, one per address
Show answer
Answer: A. All three unicast addresses end in the same 24 bits (00:0001), so they share one solicited-node group, FF02::1:FF00:1. FF02::1 is joined by every interface, FF02::2 by any router with ipv6 unicast-routing, FF02::5 by every OSPFv3 router; FF02::6 only by the DR and BDR. One solicited-node group per address would be needed only if the last 24 bits differed.

IPv6 subnetting: /48, /56, /64, /127 and nibble boundaries

CCNA 200-301 v1.1ENARSI 300-410SPCOR 350-501 v1.1CCIE EI v1.1

TL;DRAn IPv6 global address is a global routing prefix (the /48 a site receives), a 16-bit subnet ID the site chooses, and a 64-bit interface ID. Every LAN is a /64, point-to-point links are /127 and loopbacks /128, so a /48 gives 65,536 LANs and a /56 gives 256. You count subnets with 2^(new − old) exactly as in IPv4, but the goal is the opposite of VLSM: plan on nibble boundaries (/52, /56, /60) and let the hex digits carry meaning (building, VLAN), because readability matters and addresses do not run out.

The terms, in short
Global routing prefix
The part assigned from outside: the ISP holds 2001:db8::/32, the site receives 2001:db8:acad::/48 and is one of the 65,536 /48s in it.
Subnet ID
The bits between the site prefix and the /64: 16 bits in a /48 (65,536 subnets), 8 bits in a /56 (256). Sales uses 0010, i.e. 2001:db8:acad:10::/64.
Interface ID
The last 64 bits, chosen by the host (EUI-64, random or static, §14). Fixed at 64 on every LAN, so SLAAC works.
Nibble boundary
A prefix length that is a multiple of 4 (/48, /52, /56, /60, /64): it ends between two hex digits, so the subnet can be read straight from the text.
/127 and /128
A /127 holds exactly two addresses, the two ends of a router link (RFC 6164); a /128 is a single address, for a loopback.
2^(new − old)
How many subnets a prefix gives: /48 → /64 = 2^16 = 65,536, /48 → /52 = 16, /56 → /64 = 256.

13.1The step-by-step animation

  1. An IPv6 global address has three parts. The RIR gave the ISP 2001:db8::/32; the ISP gives the site 2001:db8:acad::/48, its global routing prefix. The site owns the next 16 bits, the subnet ID, and the last 64 bits are each host's interface ID. Every hex digit is one nibble (4 bits), so /32, /48 and /64 end exactly between digits: after the 8th, the 12th and the 16th.The plan: ISP 2001:db8::/32 · site 2001:db8:acad::/48 · global routing prefix · subnet ID 16 bits → 65,536 /64s · interface ID 64 bits
  2. The site cuts its /48 by choosing the subnet ID, and nothing stops it from making the ID mean something. Sales is VLAN 10, so its subnet ID is written 10: 2001:db8:acad:10::/64. Careful: that is hexadecimal 0x0010, subnet number 16. Engineering, :20:, is subnet 32 and Management, :99:, subnet 153. The digits read like the VLAN; the arithmetic stays in hex.The plan: Sales 2001:db8:acad:10::/64 · subnet 0x10 = 16 · Eng 2001:db8:acad:20::/64 · subnet 32 · Mgmt 2001:db8:acad:99::/64 · subnet 153
  3. Two more buildings join, so the plan needs one more level. Spend the first hex digit of the subnet ID on the building: each building gets a /52, 16 of them in the /48, and each /52 holds 2^(64 − 52) = 4,096 /64s. HQ is building 0, so its LANs keep their addresses (:10: is really :0010:); building 1 starts at 2001:db8:acad:1000::/52 and its VLAN 10 is 2001:db8:acad:1010::/64. Digit f is kept for infrastructure: links and loopbacks.The plan: building first digit of the subnet ID → /52 · per building 4,096 /64s · bldg 1 · VLAN 10 2001:db8:acad:1010::/64
  4. Wrong: "we have only 4 buildings, so a /50 each" (2 bits, 4 blocks). The routers do not care, but people do: a /50 boundary cuts a hex digit in two. The blocks are 2001:db8:acad::/50, :4000::/50, :8000::/50 and :c000::/50, and is 2001:db8:acad:5a10:: in building 1? Only the binary of 5 (0101) tells you. Prefix-lists, ACLs and log reading all turn into binary. Fix: stay on nibble boundaries, /48, /52, /56, /60, /64.The plan: /50 the boundary falls inside a hex digit · :5a10: → building? 5 = 0101 → 01 → building 1 · readable /48 · /52 · /56 · /60 · /64
  5. Infrastructure lives in digit f. The R1–R2 link is a /127 (RFC 6164): exactly two addresses, 2001:db8:acad:ff00:: for R1 and 2001:db8:acad:ff00::1 for R2, and no room for a scan to fill the neighbor cache, which a /64 on a two-router link invites. RFC 6164 also has the routers disable the Subnet-Router anycast on a /127. The loopback is a /128, a single address: 2001:db8:acad:ffff::1. Most operators still reserve a whole /64 per link, so a later change needs no renumbering.The plan: R1–R2 2001:db8:acad:ff00::/127 · 2 addresses · R1 · R2 ff00:: · ff00::1 · Lo0 2001:db8:acad:ffff::1/128
  6. The counting rule is the same as in IPv4, 2^(new − old): /32 → /48 gives 65,536 sites, /48 → /52 gives 16 buildings, /52 → /64 gives 4,096 LANs, /56 → /64 gives 256. What changes is the goal. IPv4 VLSM (§8) sizes every subnet to its hosts to save addresses; in IPv6 every LAN is a /64 whether it has 5 hosts or 5,000, and the plan is about readability and summarization: one /48 per site, one /52 per building, one route each. R1 sends the ISP a single route, 2001:db8:acad::/48.The plan: rule 2^(new − old) subnets · /48 → /64 65,536 · /56 → /64 256 · every LAN /64

13.2Simulator: the IPv6 subnetter

A prefix, the new prefix length and the subnet number

Subnets are counted from 0. Type the number in decimal (16) or in hex with 0x (0x10): the subnet ID is hexadecimal, so 2001:db8:acad:10::/64 is subnet 0x10 = 16 of the /48.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

2001:db8:acad::/48 → /64: 65,536 subnets · prefix (cyan), subnet ID (violet), the rest (green)

20010db8acad00100000000000000000
#SubnetFirst addressLast address
02001:db8:acad::/642001:db8:acad::2001:db8:acad:0:ffff:ffff:ffff:ffff
…
152001:db8:acad:f::/642001:db8:acad:f::2001:db8:acad:f:ffff:ffff:ffff:ffff
16 ◀2001:db8:acad:10::/642001:db8:acad:10::2001:db8:acad:10:ffff:ffff:ffff:ffff
172001:db8:acad:11::/642001:db8:acad:11::2001:db8:acad:11:ffff:ffff:ffff:ffff
…
65,5352001:db8:acad:ffff::/642001:db8:acad:ffff::2001:db8:acad:ffff:ffff:ffff:ffff:ffff
Subnet 16 of 65,536: 2001:db8:acad:10::/64
  • /48 → /64: 16 bits of subnet ID, so 2^16 = 65,536 subnets of 2^64 addresses each, each one a single /64.
  • Subnet 16 (0x10) starts 16 × 2^64 addresses after the prefix: 2001:db8:acad:10::/64, from 2001:db8:acad:10:: to 2001:db8:acad:10:ffff:ffff:ffff:ffff.
  • /48 and /64 are both nibble boundaries: the subnet ID is exactly hex digits 13–16 of the address, readable straight from the text.
  • A /64: the size of every LAN, so SLAAC can build 64-bit interface IDs (§14).

13.3The configuration, line by line

R1 · IOS-XE

1ipv6 unicast-routingR1 forwards IPv6 and sends Router Advertisements (§15).
2interface GigabitEthernet0/0Sales, VLAN 10.
3 ipv6 address 2001:DB8:ACAD:10::1/64Subnet ID 0010 (hex) = subnet 16 of the /48. Always a /64 on a LAN: SLAAC needs a 64-bit interface ID.
4interface GigabitEthernet0/1Engineering, VLAN 20.
5 ipv6 address 2001:DB8:ACAD:20::1/64Subnet 0x20 = 32.
6interface GigabitEthernet0/3Management, VLAN 99.
7 ipv6 address 2001:DB8:ACAD:99::1/64Subnet 0x99 = 153.
8interface GigabitEthernet0/2The link to R2, in the infrastructure digit f.
9 ipv6 address 2001:DB8:ACAD:FF00::/127RFC 6164: R1 takes ff00::, R2 ff00::1. The /64 2001:DB8:ACAD:FF00::/64 stays reserved for this link. RFC 6164 says not to use the all-zero interface ID (ff00::) when several /127s are cut from one shared /64, because it is that /64's Subnet-Router anycast address; with a /64 kept per link, it is safe.
10interface Loopback0
11 ipv6 address 2001:DB8:ACAD:FFFF::1/128A /128: one address, the router's stable identity (router ID, management, iBGP).
12!
13ipv6 route 2001:DB8:ACAD::/48 Null0The site aggregate: advertised to the ISP as one route, and traffic for unused subnet IDs is discarded instead of following the default route back out.
14ipv6 prefix-list BLDG-1 seq 5 permit 2001:DB8:ACAD:1000::/52 le 64Building 1 and every /64 inside it, in one readable line: the building is the first digit of the subnet ID.

Wrong

1ipv6 prefix-list BLDG-1 seq 5 permit 2001:DB8:ACAD:4000::/50 le 64A /50 per building: building 1 is :4000: to :7FFF:. Valid, but whether :5A10: belongs to it takes binary.
2interface GigabitEthernet0/0
3 ipv6 address 2001:DB8:ACAD:A::1/64VLAN 10 converted to hex (0xA): valid, but the next engineer reads "A" and looks for VLAN 10 elsewhere. Pick one convention: digits that read like the VLAN.
4 ipv6 address 2001:DB8:ACAD:10::1/80A /80 "to save addresses": the RA carries it, but hosts build SLAAC addresses only from a /64, so they keep only their link-local addresses (§15).
5interface GigabitEthernet0/2
6 ipv6 address 2001:DB8:ACAD:FF00::1/64A /64 on a two-router link: it works, but 2^64 unused addresses invite a scan that fills the neighbor cache. RFC 6164: /127.

show ipv6 route

1R1#show ipv6 route
2IPv6 Routing Table - default - 11 entries4 C + 4 L + 1 LC + the static aggregate + L FF00::/8.
3Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
4! (rest of the legend omitted)
5S 2001:DB8:ACAD::/48 [1/0]The aggregate toward Null0: the only route the ISP needs.
6 via Null0, directly connected
7C 2001:DB8:ACAD:10::/64 [0/0]Each LAN is a /64, whatever its number of hosts.
8 via GigabitEthernet0/0, directly connected
9L 2001:DB8:ACAD:10::1/128 [0/0]R1's own address, as a /128 (§15).
10 via GigabitEthernet0/0, receive
11C 2001:DB8:ACAD:20::/64 [0/0]
12 via GigabitEthernet0/1, directly connected
13C 2001:DB8:ACAD:99::/64 [0/0]
14 via GigabitEthernet0/3, directly connected
15C 2001:DB8:ACAD:FF00::/127 [0/0]The link: a /127, two addresses.
16 via GigabitEthernet0/2, directly connected
17LC 2001:DB8:ACAD:FFFF::1/128 [0/0]A loopback /128 is local and connected at once.
18 via Loopback0, receive
19! (the other L /128 routes and L FF00::/8 omitted)

The outputs are typical for IOS-XE; details may vary between versions.

13.4Remember

Critical for the exam
The standard plan: a /48 per site (16-bit subnet ID = 65,536 /64s), a /56 for a small site or a home (256 /64s), a /64 on every LAN, a /127 on point-to-point links (RFC 6164), a /128 on loopbacks. Count subnets with 2^(new − old): /48 → /64 = 2^16, /56 → /64 = 2^8, /48 → /52 = 2^4 = 16.
Theory
A hex digit is exactly 4 bits, so a prefix whose length is a multiple of 4 (a nibble boundary: /48, /52, /56, /60, /64) ends between two digits and the subnet is read straight from the text. On a non-nibble boundary (/50, /62) one digit is half prefix, half subnet, and only the binary tells you which block an address is in. With 2^64 addresses per LAN, readability and summarization drive the plan, not efficiency.
Pitfall
The subnet ID is hexadecimal even when it is chosen to look like a VLAN: 2001:db8:acad:10::/64 is subnet 0x10 = 16 of the /48, not subnet 10, and :99: is 153. When a question asks for "subnet number 26" (counting from 0), convert to hex: 26 = 0x1a, so 2001:db8:acad:1a::/64.
Numbers
A /32 holds 65,536 /48s; a /48 holds 16 /52s, 256 /56s, 4,096 /60s and 65,536 /64s; a /56 holds 256 /64s; a /60 holds 16. RFC 6177 (2011) dropped the fixed "/48 for everyone" of RFC 3177 and asks only that a site get more than a single /64; RIPE-690 recommends a /48 for businesses and a /56 for homes. RFC 7421 explains why /64 stays the LAN boundary.
Pitfall
IPv4 habits break IPv6 plans: no VLSM on LANs (a /120 "because the LAN has 100 hosts" breaks SLAAC), no /64 on router-to-router links (a scan can fill the neighbor cache; RFC 6164 standardized /127), and no non-nibble cuts that turn every ACL and prefix-list check into binary.
Platforms and standards
IOS-XE, NX-OS and IOS-XR all write the length after a slash (ipv6 address 2001:DB8:ACAD:10::1/64); IOS displays uppercase, while the RFC 5952 canonical text form is lowercase (§11). Current IOS-XE, NX-OS and IOS-XR accept /127 on links. Sites often receive their prefix by DHCPv6 prefix delegation (RFC 8415); an ISP that hands a home only a /60 leaves it 16 LANs, a /64 only one.
Verify withshow ipv6 interface briefshow ipv6 route connectedshow ipv6 route 2001:DB8:ACAD::/48 longer-prefixes

13.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

Your company receives 2001:db8:acad::/48 and gives every LAN a /64. How many LANs can the site number?

  1. A4,096
  2. B65,534
  3. C256
  4. D65,536
Show answer
Answer: D. From /48 to /64 the site has 16 bits of subnet ID: 2^(64 − 48) = 2^16 = 65,536 /64s. Nothing is subtracted, because IPv6 subnets have no network or broadcast addresses to reserve, so 65,534 is the IPv4 "minus 2" habit. 256 is what a /56 gives, and 4,096 is the number of /64s in a /52.
CCNACCNA 200-301Q2

Subnets of 2001:db8:acad::/48 are numbered from 0 using the 16-bit subnet ID. Which /64 is subnet number 26?

  1. A2001:db8:acad:26::/64
  2. B2001:db8:acad:1a::/64
  3. C2001:db8:acad:1a00::/64
  4. D2001:db8:acad:0:26::/64
Show answer
Answer: B. The subnet ID is hexadecimal and sits in the 4th hextet: 26 = 0x1a, so subnet 26 is 2001:db8:acad:001a::/64, written 2001:db8:acad:1a::/64. 2001:db8:acad:26::/64 is subnet 0x26 = 38 (the decimal-as-hex trap), 2001:db8:acad:0:26:: puts the number in the interface ID, and :1a00: is subnet 6,656.
CCNACCNA 200-301Q3

R1 and R2 are connected by a dedicated router-to-router link. Which prefix gives the link exactly two addresses, as RFC 6164 recommends?

  1. A2001:db8:acad:ff00::/64
  2. B2001:db8:acad:ff00::/127
  3. C2001:db8:acad:ff00::/126
  4. D2001:db8:acad:ff00::/128
Show answer
Answer: B. A /127 leaves one bit: two addresses, ff00:: and ff00::1, one per router, which is what RFC 6164 standardizes for inter-router links. A /126 has four addresses (the IPv4 /30 habit), a /64 has 2^64 and invites neighbor-cache exhaustion, and a /128 is a single address, for a loopback.
CCNACCNA 200-301Q4

An ISP delegates 2001:db8:acad:ab00::/56 to a home router, which numbers one /64 per LAN. How many LANs can the home have?

  1. A65,536
  2. B254
  3. C8
  4. D256
Show answer
Answer: D. 2^(64 − 56) = 2^8 = 256 /64s, from 2001:db8:acad:ab00::/64 to 2001:db8:acad:abff::/64. 254 subtracts two subnets as if this were IPv4 hosts, 65,536 is what a /48 gives, and 8 is the number of subnet bits, not the number of subnets.
ProfessionalENARSI 300-410Q5

The site 2001:db8:acad::/48 gives each building a /52, and the first hex digit of the subnet ID is the building number. Which prefix-list entry matches building 3 and every /64 inside it?

  1. Aipv6 prefix-list B3 permit 2001:DB8:ACAD:3000::/52 ge 65
  2. Bipv6 prefix-list B3 permit 2001:DB8:ACAD:300::/52 le 64
  3. Cipv6 prefix-list B3 permit 2001:DB8:ACAD:3000::/52 le 64
  4. Dipv6 prefix-list B3 permit 2001:DB8:ACAD:3::/52 le 64
Show answer
Answer: C. Building 3 is the first digit of the 4th hextet: 2001:db8:acad:3000::/52 (3000 to 3fff), and le 64 matches the /52 itself and every longer prefix up to /64. :3:: is 0x0003, which masked to /52 is 2001:db8:acad::/52, building 0; :300:: is 0x0300, also building 0. ge 65 would skip the /52 and every /64, matching only prefixes longer than a LAN.
ProfessionalENARSI 300-410 · SPCOR 350-501Q6

A customer cuts its delegated 2001:db8:acad:ab00::/56 into /62s. Which /62 is subnet number 3, and which /64s does it contain?

  1. A2001:db8:acad:ab0c::/62: ab0c, ab0d, ab0e and ab0f
  2. B2001:db8:acad:ab03::/62: ab03, ab04, ab05 and ab06
  3. C2001:db8:acad:ab08::/62: ab08, ab09, ab0a and ab0b
  4. D2001:db8:acad:ab30::/62: ab30 to ab3f
Show answer
Answer: A. /62 is not a nibble boundary: each /62 holds 2^(64 − 62) = 4 /64s, so subnets step by 4 in the last digit (ab00, ab04, ab08, ab0c) and subnet 3 is ab0c::/62, covering ab0c to ab0f. ab03 is not even a /62 boundary, ab08 is subnet 2 (off by one), and ab30 moves the digit to the wrong place. This is exactly why plans prefer /60 or /64 cuts.
CCIECCIE EI v1.1Q7

An inter-router link is numbered 2001:db8:acad:ff00::/64. An attacker sends a fast stream of packets to random addresses in that /64. What is the effect, and what does RFC 6164 recommend?

  1. AThe router drops them, because a /64 configured on a point-to-point link only accepts its two configured addresses; RFC 6164 makes /64 mandatory
  2. BNothing, because Ethernet point-to-point links do not use NDP; RFC 6164 only applies to serial links
  3. CThe router tries to resolve each destination with NDP and fills its neighbor cache with INCOMPLETE entries; RFC 6164 recommends a /127
  4. DEvery packet is answered as the Subnet-Router anycast address; RFC 6164 recommends a /126 to disable it
Show answer
Answer: C. Every destination in the /64 is on-link, so the router sends a Neighbor Solicitation for each one and keeps an INCOMPLETE entry: millions of them can exhaust the neighbor cache and push out real neighbors. A /127 leaves only the two real addresses, and RFC 6164 also has routers disable the Subnet-Router anycast on it. A /126 is the IPv4 /30 habit, and NDP runs on every IPv6 link, Ethernet included.

IPv6 interface IDs: EUI-64, SLAAC, privacy addresses and DHCPv6

CCNA 200-301 v1.1ENARSI 300-410CCIE EI v1.1

TL;DROn a /64, a host builds the last 64 bits of its address itself. Modified EUI-64 derives them from the MAC (split it, insert ff:fe, flip the U/L bit); current Windows and macOS use random or stable opaque IDs plus temporary addresses instead, so the MAC does not follow the device around. SLAAC takes the prefix from the router's RA, Duplicate Address Detection checks that nobody else has the address, and the RA's M and O flags decide what DHCPv6 adds: addresses (stateful) or only options such as DNS (stateless). The default gateway always comes from the RA.

The terms, in short
SLAAC
Stateless address autoconfiguration (RFC 4862): prefix from the RA (2001:db8:acad:10::/64, A = 1) + an interface ID the host makes itself. No server keeps any state.
Modified EUI-64
MAC 0050.56a1.1b01 → split, insert ff:fe, flip bit 0x02 of the first byte → 0250:56ff:fea1:1b01 (RFC 4291 appendix A).
U/L bit
Bit 0x02 of the first MAC byte: 0 = universally administered (burned-in), 1 = locally administered. Modified EUI-64 inverts it.
DAD
Duplicate Address Detection: an NS from :: to the solicited-node group (ff02::1:ffa1:1b01) before the address is used; an NA in reply means "duplicate".
M and O flags
RA flags: M = 1 "get addresses from DHCPv6" (stateful), O = 1 "get other settings, such as DNS, from DHCPv6" (stateless).
Temporary address
RFC 8981: a random interface ID used as the source of outgoing connections and replaced regularly, so the host cannot be tracked.
Stable opaque IID
RFC 7217: a hash of the prefix, the interface and a secret: the same on this LAN every day, different on every other LAN, with no MAC inside.

14.1The step-by-step animation

  1. Host A is a VMware virtual machine with the MAC 0050.56a1.1b01: 48 bits, the first 24 the vendor's OUI (00:50:56 is VMware), the last 24 chosen for this NIC. SLAAC needs a 64-bit interface ID, so modified EUI-64 stretches the MAC: split it in the middle and insert ff:fe, 16 bits, giving 0050:56ff:fea1:1b01. One more move is needed before it becomes the interface ID.Host A: MAC 0050.56a1.1b01 · 48 bits · split 00:50:56 | a1:1b:01 · insert ff:fe in the middle → 64 bits
  2. Step 3: flip the 7th bit of the first byte, the U/L bit (value 0x02). In a MAC, 0 means universally administered, a burned-in vendor address; modified EUI-64 inverts the meaning, so 1 says "globally unique" and hand-written IDs such as ::1 can keep it 0. 0x00 becomes 0x02 and the interface ID is 0250:56ff:fea1:1b01, written 250:56ff:fea1:1b01. With fe80::/64 in front, it is Host A's link-local address, fe80::250:56ff:fea1:1b01.Host A: first byte 0x00 = 0000 0000 → 0000 0010 = 0x02 · interface ID 250:56ff:fea1:1b01 · link-local fe80::250:56ff:fea1:1b01
  3. With a link-local address Host A can talk. It sends a Router Solicitation to ff02::2, and R1 answers with a Router Advertisement to ff02::1 from fe80::1. The RA carries the prefix 2001:db8:acad:10::/64 with A = 1 (autonomous: build your own address) and L = 1 (on-link), the flags M = 0 (no addresses from DHCPv6) and O = 1 (other settings, such as DNS, from DHCPv6), and a router lifetime of 1800 s: fe80::1 becomes Host A's default gateway.On the wire: RS fe80::250:56ff:fea1:1b01 → ff02::2 · RA fe80::1 → ff02::1 · prefix 2001:db8:acad:10::/64 · A = 1 · L = 1 · flags M = 0 · O = 1 · router lifetime 1800 s
  4. Host A combines the advertised prefix with its interface ID: 2001:db8:acad:10:250:56ff:fea1:1b01. The address stays tentative until Duplicate Address Detection passes: a Neighbor Solicitation from :: (it may not use the address yet) to the solicited-node group ff02::1:ffa1:1b01, asking "does anyone have this address?". The switch floods the frame (no MLD snooping here), nobody answers within a second, and the address becomes preferred. Its link-local address went through the same check.On the wire: NS src :: (unspecified) · NS dst ff02::1:ffa1:1b01 · target 2001:db8:acad:10:250:56ff:fea1:1b01 · reply none in 1 s → preferred
  5. O = 1, so Host A asks for the rest with stateless DHCPv6: an Information-Request from its link-local address to ff02::1:2, all DHCPv6 servers and relays (UDP 547). R1's pool replies with the DNS server and the domain name and keeps no record of Host A: the address came from SLAAC. With M = 1 the host would instead run Solicit, Advertise, Request, Reply and lease an address from the pool. Either way, the gateway comes only from the RA.On the wire: Information-Request fe80::250:56ff:fea1:1b01 → ff02::1:2 · Reply DNS 2001:db8:acad:99::53 · sales.example.com · state on R1 none (stateless)
  6. Wrong: someone clones Host A's VM, MAC included, and boots the copy as Host A2. It builds the same EUI-64 interface ID, so the same link-local address, and runs DAD: this time Host A owns fe80::250:56ff:fea1:1b01 and answers with a Neighbor Advertisement to ff02::1. Host A2 marks the address duplicate (Linux: dadfailed) and never uses it. RFC 4862 even recommends disabling IPv6 on that interface, because every address built from this MAC would collide too.On the wire: NS (DAD) src :: · target fe80::250:56ff:fea1:1b01 · NA from Host A "this address is mine" → ff02::1 · Host A2 duplicate: not used
  7. The fix is to stop deriving the ID from the MAC. Give the clone a new MAC, or use IDs that do not come from the MAC at all, as Windows and macOS do by default: stable opaque IDs (RFC 7217: a hash of the prefix, the interface and a secret, stable on this LAN, different on every other) or random ones, plus temporary addresses (RFC 8981: random, renewed regularly, used for outgoing connections). The Windows laptop has a random interface ID and a temporary address: neither contains its MAC, so it cannot be followed from network to network.Laptop: address 2001:db8:acad:10:9c41:5e2b:d0f3:7a19 (random ID) · temporary 2001:db8:acad:10:61d8:2fa0:b34c:e605 · MAC in the address no

14.2Simulator: the EUI-64 generator

A MAC address and the /64 prefix from the RA

Any common format works: Cisco 0050.56a1.1b01, colons 00:50:56:a1:1b:01 or Windows 00-50-56-A1-1B-01. The generator splits the MAC, inserts ff:fe and flips the U/L bit, then builds the link-local, the global address and the solicited-node group.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

StepValue
MAC00:50:56:a1:1b:01 (0050.56a1.1b01)
1. split + 2. insert ff:fe0050:56ff:fea1:1b01
3. flip U/L (0x02) of the first byte0x00 = 00000000 → 00000010 = 0x02 · U/L 0 → 1
Interface ID0250:56ff:fea1:1b01 → 250:56ff:fea1:1b01
Link-localfe80::250:56ff:fea1:1b01
Global (prefix + ID)2001:db8:acad:10:250:56ff:fea1:1b01
On IOS (eui-64)2001:DB8:ACAD:10:250:56FF:FEA1:1B01 [EUI]
Solicited-node groupff02::1:ffa1:1b01
Its Ethernet MAC3333.ffa1.1b01
Interface ID 250:56ff:fea1:1b01 → 2001:db8:acad:10:250:56ff:fea1:1b01
  • Split 00:50:56:a1:1b:01 after the third byte (the OUI) and insert ff:fe: 0050:56ff:fea1:1b01.
  • Flip the U/L bit, 0x02 of the first byte: 0x00 = 00000000 → 00000010 = 0x02. The MAC is burned-in (U/L = 0), so the flip sets the bit: in modified EUI-64, 1 means "globally unique".
  • Interface ID 0250:56ff:fea1:1b01, written 250:56ff:fea1:1b01; link-local fe80::250:56ff:fea1:1b01.
  • With 2001:db8:acad:10::/64 (Documentation): 2001:db8:acad:10:250:56ff:fea1:1b01. On a Cisco router (ipv6 address … eui-64), show ipv6 interface would list it as 2001:DB8:ACAD:10:250:56FF:FEA1:1B01 [EUI].
  • Solicited-node group ff02::1:ff + the last 24 bits = ff02::1:ffa1:1b01 (Ethernet 3333.ffa1.1b01): DAD and neighbor resolution for all of this interface's EUI-64 addresses use it.
  • Every network this host joins sees the same 250:56ff:fea1:1b01, with the MAC inside it: that is why Windows and macOS use random or stable opaque IDs (RFC 7217) and temporary addresses (RFC 8981) instead.

14.3The configuration, line by line

R1 · IOS-XE

1ipv6 unicast-routingWithout it R1 sends no RA, and the hosts never hear of the prefix (§15).
2interface GigabitEthernet0/1Engineering LAN: R1 builds its own address with EUI-64.
3 ipv6 address 2001:DB8:ACAD:20::/64 eui-64Prefix from the command, interface ID from Gi0/1's MAC 00a1.b2c3.d401: 2001:DB8:ACAD:20:2A1:B2FF:FEC3:D401.
4interface GigabitEthernet0/0Sales LAN: SLAAC for addresses, stateless DHCPv6 for DNS.
5 ipv6 address FE80::1 link-localA static, readable gateway; without it IOS would use FE80::2A1:B2FF:FEC3:D400 (EUI-64 of Gi0/0).
6 ipv6 address 2001:DB8:ACAD:10::1/64The prefix the RA advertises, by default with A = 1 and L = 1.
7 ipv6 nd other-config-flagO = 1: "ask DHCPv6 for DNS and other options".
8 ipv6 dhcp server SALES-STATELESSR1 answers Information-Requests arriving on this interface.
9! ipv6 nd managed-config-flagM = 1 instead: addresses from stateful DHCPv6 (next tab).
10!
11ipv6 dhcp pool SALES-STATELESSNo address prefix in the pool: nothing per host to remember.
12 dns-server 2001:DB8:ACAD:99::53
13 domain-name sales.example.com

Stateful DHCPv6

1ipv6 dhcp pool SALES-STATEFUL
2 address prefix 2001:DB8:ACAD:10::/64 lifetime 172800 86400Addresses are leased from the /64: valid 2 days, preferred 1 day.
3 dns-server 2001:DB8:ACAD:99::53
4interface GigabitEthernet0/0
5 ipv6 nd managed-config-flagM = 1: hosts run Solicit, Advertise, Request, Reply. IOS then shows "Hosts use DHCP to obtain routable addresses."
6 ipv6 nd prefix 2001:DB8:ACAD:10::/64 2592000 604800 no-autoconfigA = 0: hosts stop building SLAAC addresses, so DHCPv6 is the only source. Without it, every host ends up with both.
7 ipv6 dhcp server SALES-STATEFUL
8! or, with a central server:
9! ipv6 dhcp relay destination 2001:DB8:ACAD:99::547The relay forwards the client's messages to the server; the RA (and so the gateway) still comes from R1.

show ipv6 interface Gi0/1

1R1#show ipv6 interface GigabitEthernet0/1
2GigabitEthernet0/1 is up, line protocol is up
3 IPv6 is enabled, link-local address is FE80::2A1:B2FF:FEC3:D401EUI-64 of 00a1.b2c3.d401: 00 → 02, FFFE in the middle. IOS builds every link-local it is not given this way.
4 No Virtual link-local address(es):
5 Global unicast address(es):
6 2001:DB8:ACAD:20:2A1:B2FF:FEC3:D401, subnet is 2001:DB8:ACAD:20::/64 [EUI][EUI] marks an address built with eui-64.
7 Joined group address(es):
8 FF02::1
9 FF02::2
10 FF02::1:FFC3:D401One solicited-node group for both addresses: they share the last 24 bits.
11 MTU is 1500 bytes
12 ND DAD is enabled, number of DAD attempts: 1One NS per address, then a 1-second wait.
13 ND reachable time is 30000 milliseconds (using 30000)
14 ND router advertisements are sent every 200 seconds
15 ND router advertisements live for 1800 secondsThe router lifetime in each RA.
16 Hosts use stateless autoconfig for addresses.M = 0.

Hosts

1$ sysctl net.ipv6.conf.eth0.addr_gen_modeHost A, Linux.
2net.ipv6.conf.eth0.addr_gen_mode = 00 = EUI-64, the kernel default: Host A's 250:56ff:fea1:1b01. 2 or 3 = stable privacy (RFC 7217).
3$ sysctl net.ipv6.conf.eth0.use_tempaddr
4net.ipv6.conf.eth0.use_tempaddr = 00 = no temporary addresses; 2 = create them and prefer them as the source (RFC 8981).
5$ ip -6 addr show dev eth0 (Host A2, the clone)
6 inet6 fe80::250:56ff:fea1:1b01/64 scope link tentative dadfailedDAD failed: Host A already owns this address, so the clone never uses it.
7$ dmesg | grep duplicate
8IPv6: eth0: IPv6 duplicate address fe80::250:56ff:fea1:1b01 used by 00:50:56:a1:1b:01 detected!The kernel names the MAC that answered: Host A's.
9C:\> ipconfigA Windows laptop on the same LAN, default settings.
10 IPv6 Address. . . . . . . . . . . : 2001:db8:acad:10:9c41:5e2b:d0f3:7a19A random interface ID, not derived from the MAC.
11 Temporary IPv6 Address. . . . . . : 2001:db8:acad:10:61d8:2fa0:b34c:e605RFC 8981: the source of outgoing connections, replaced regularly.
12 Default Gateway . . . . . . . . . : fe80::1%12From the RA; %12 is the interface index (the zone).
13C:\> netsh interface ipv6 set global randomizeidentifiers=disabledWould switch the main address to EUI-64; netsh interface ipv6 set privacy state=disabled stops temporary addresses.

The outputs are typical for IOS-XE, Linux and Windows; details may vary between versions.

14.4Remember

Critical for the exam
Modified EUI-64 in three moves: split the 48-bit MAC after the 3rd byte, insert ff:fe, flip bit 0x02 of the first byte (the U/L bit). 0050.56a1.1b01 → 0250:56ff:fea1:1b01. SLAAC needs an RA with a /64 prefix and A = 1; the default gateway always comes from the RA (its link-local source), never from DHCPv6.
Theory
The U/L bit is inverted in modified EUI-64 (RFC 4291 appendix A) so that 1 means "globally unique": a burned-in MAC yields 1, while hand-written IDs such as ::1 keep it 0 without extra digits. DAD uses :: as its source because the address is not usable yet, and the solicited-node group as its destination, so only hosts whose addresses end in the same 24 bits look at it.
Pitfall
Flip, do not set: a MAC whose first byte is 02 (locally administered, as in many VMs and containers) gives 00, not 02, and 0x02 is the 7th bit from the left, not the 2nd. Insert ff:fe (not fe:ff) right after the OUI.
Numbers
RS = ICMPv6 133 to ff02::2, RA = 134 to ff02::1, NS = 135, NA = 136; DHCPv6 clients use UDP 546, servers and relays 547 and the group ff02::1:2. IOS RA defaults: every 200 s, router lifetime 1800 s, prefix valid 2,592,000 s (30 days), preferred 604,800 s (7 days). DAD: 1 NS, then a 1-second wait (RFC 4861, RFC 4862).
Pitfall
M and O do not switch SLAAC off: with M = 1 and the prefix still A = 1 (the IOS default), hosts build a SLAAC address and lease one from DHCPv6. For DHCPv6-only addressing also send the prefix with A = 0 (ipv6 nd prefix … no-autoconfig). And DHCPv6 never gives a gateway or a prefix length: without an RA, a DHCPv6 address alone does not get a host off its LAN.
Platforms and standards
By default on current versions: Windows uses a random interface ID plus temporary addresses; macOS uses stable cryptographically generated ("secured") IDs plus temporary ones; the Linux kernel defaults to EUI-64 (addr_gen_mode 0), while NetworkManager-based distributions usually generate stable-privacy (RFC 7217) IDs; Cisco IOS uses EUI-64 for its link-local addresses and for eui-64 and autoconfig. RFC 8064 recommends RFC 7217 over EUI-64; RFC 8981 (2021) replaced RFC 4941.
Verify withshow ipv6 interface GigabitEthernet0/1show ipv6 dhcp poolshow ipv6 dhcp bindingshow ipv6 routersdebug ipv6 nd

14.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

Host B has the MAC 0050.56a1.2c02 and builds its address with modified EUI-64 from the RA prefix 2001:db8:acad:20::/64. Which address does it get?

  1. A2001:db8:acad:20:250:56fe:ffa1:2c02
  2. B2001:db8:acad:20:250:56ff:fea1:2c02
  3. C2001:db8:acad:20:250:56a1:fffe:2c02
  4. D2001:db8:acad:20:50:56ff:fea1:2c02
Show answer
Answer: B. Split the MAC after 00:50:56, insert ff:fe and flip bit 0x02 of the first byte (00 → 02): 0250:56ff:fea1:2c02, written 250:56ff:fea1:2c02 after the /64. The answer that keeps 50 instead of 250 forgets the flip, the one with 56fe:ffa1 inserts fe:ff instead of ff:fe, and the one with 56a1:fffe inserts them after the fourth byte instead of right after the OUI.
CCNACCNA 200-301Q2

A container has the locally administered MAC 02:42:ac:11:00:02. What interface ID does modified EUI-64 produce?

  1. A0642:acff:fe11:0002
  2. B0042:acff:fe11:0002
  3. C0242:acff:fe11:0002
  4. D0042:acfe:ff11:0002
Show answer
Answer: B. The U/L bit (0x02) is flipped, not set: 0x02 XOR 0x02 = 0x00, so the ID is 0042:acff:fe11:0002 (written 42:acff:fe11:2). Keeping 02 is the "always set the bit" mistake, acfe:ff11 swaps the inserted bytes, and 06 flips 0x04, the wrong bit.
CCNACCNA 200-301Q3

You want the Sales hosts to take their IPv6 addresses only from a stateful DHCPv6 server, never from SLAAC. What must R1's Router Advertisements on that LAN carry?

  1. ANothing: disable RAs, DHCPv6 gives the address and the gateway
  2. BM = 1 only; the prefix flags do not matter
  3. CM = 1, and the /64 prefix with A = 0 (no-autoconfig)
  4. DO = 1, and the /64 prefix with A = 1
Show answer
Answer: C. M = 1 tells hosts to lease addresses from DHCPv6, but as long as the prefix keeps A = 1 they also build a SLAAC address, so it must be sent with A = 0 (ipv6 nd prefix ... no-autoconfig). O = 1 is stateless DHCPv6 (options only). Disabling RAs fails because DHCPv6 carries no default gateway: hosts learn it only from the RA.
CCNACCNA 200-301Q4

Before using 2001:db8:acad:10:250:56ff:fea1:1b01, Host A runs Duplicate Address Detection. Which source and destination does its Neighbor Solicitation use?

  1. ASource ::, destination ff02::1:ffa1:1b01
  2. BSource fe80::250:56ff:fea1:1b01, destination ff02::1
  3. CSource 2001:db8:acad:10:250:56ff:fea1:1b01, destination ff02::1:ffa1:1b01
  4. DSource ::, destination ff02::2
Show answer
Answer: A. The address is still tentative, so the NS is sent from the unspecified address ::, to the solicited-node group of the tested address: ff02::1:ff plus its last 24 bits, a1:1b01. ff02::1 (all nodes) is where the NA of a defending host goes, ff02::2 is for Router Solicitations, and the tentative address itself may not be used as a source.
ProfessionalENARSI 300-410Q5

R1's Gi0/0 has ipv6 address 2001:DB8:ACAD:10::1/64, ipv6 nd other-config-flag and ipv6 dhcp server with a pool that holds only dns-server and domain-name. What does a host on that LAN end up with?

  1. AOnly the DNS server: O = 1 turns SLAAC off
  2. BA DHCPv6 address and the DNS server, both from the pool
  3. CA SLAAC address only: the O flag is ignored unless M is also set
  4. DA SLAAC address from the RA, plus the DNS server from DHCPv6
Show answer
Answer: D. This is stateless DHCPv6: the RA keeps A = 1 on the /64, so the host builds its address with SLAAC, and O = 1 makes it send an Information-Request to ff02::1:2 for the options in the pool. The pool has no address prefix, so it cannot lease addresses, and the O flag works on its own, without M.
ProfessionalENARSI 300-410Q6

Out of the box, a current Windows laptop and a Cisco IOS router join the same /64. How do they build their interface IDs?

  1. AWindows: a random ID plus a temporary address; IOS: EUI-64
  2. BBoth: only RFC 8981 temporary addresses, renewed every day
  3. CBoth: modified EUI-64 from the MAC, as in RFC 4291
  4. DWindows: EUI-64 from the MAC; IOS: RFC 7217 stable IDs
Show answer
Answer: A. Windows randomizes its interface IDs by default and adds RFC 8981 temporary addresses for outgoing connections; Cisco IOS still builds its link-local (and any eui-64 or autoconfig address) with EUI-64. EUI-64 everywhere is the old textbook default, and a router never relies only on changing temporary addresses.
ProfessionalENARSI 300-410Q7

A VMware VM using EUI-64 is cloned with its MAC unchanged, and the copy boots on the same LAN while the original is running. What happens to the copy's link-local address?

  1. AR1 sees the conflict and gives the copy a new interface ID in its next RA
  2. BNothing: DAD checks only global addresses, so the copy uses its link-local
  3. CThe original answers its DAD probe with an NA, so the copy marks the address duplicate
  4. DBoth VMs use the address, and the switch sends each frame to whichever port sent last
Show answer
Answer: C. DAD runs for every unicast address, the link-local first: the original owns fe80::250:56ff:fea1:1b01 and answers the NS with an NA, so the copy marks it duplicate (Linux: dadfailed). RFC 4862 even recommends disabling IPv6 on that interface, since every EUI-64 address of the copy would collide. Routers never assign interface IDs in RAs.
CCIECCIE EI v1.1Q8

Which property explains why RFC 8064 recommends RFC 7217 stable opaque interface IDs as the default instead of modified EUI-64?

  1. AThe ID is assigned by DHCPv6, so the network keeps a record of every host
  2. BIt is stable on one network, different on every other one, and has no MAC inside
  3. CThe ID keeps the vendor's OUI, so devices remain identifiable for troubleshooting
  4. DThe ID is renewed every day, so connections cannot be correlated even on one network
Show answer
Answer: B. RFC 7217 hashes the prefix, the interface and a secret: stable on a given /64 (good for logs, ACLs and servers) yet different on every other network and free of the MAC, so a device cannot be tracked as it moves. Daily renewal describes RFC 8981 temporary addresses, DHCPv6 is a different mechanism, and keeping the OUI is exactly the EUI-64 privacy problem.

IPv6 on Cisco devices: dual stack, link-local and verification

CCNA 200-301 v1.1ENARSI 300-410CCIE EI v1.1

TL;DRDual stack runs IPv4 and IPv6 side by side on the same interfaces. On IOS one global command, ipv6 unicast-routing, makes the router forward IPv6 and send the Router Advertisements hosts need; each interface then gets a global address (ipv6 address …/64) and usually a static link-local such as fe80::1, which becomes every host's gateway. Verify in order: show ipv6 interface brief, show ipv6 interface (FF02::2 joined, RAs sent), show ipv6 route (C and L /128), show ipv6 neighbors, ping.

The terms, in short
Dual stack
IPv4 and IPv6 on the same interface, each with its own addresses, routing table and neighbor table (RFC 4213). Gi0/0 has 192.168.10.1/25 and 2001:db8:acad:10::1/64.
ipv6 unicast-routing
The global IOS command that turns on IPv6 forwarding, membership of FF02::2 and Router Advertisements. Without it the router is just an IPv6 host.
Static link-local
ipv6 address fe80::1 link-local: replaces the EUI-64 link-local; the hosts see it as their gateway. The same fe80::1 on every LAN interface is legal.
C and L routes
For each address IOS installs a C route for the /64 and an L /128 route for the address itself (LC for a loopback).
Neighbor table
The IPv6 equivalent of the ARP table, filled by NS/NA: show ipv6 neighbors, with states such as REACH and STALE.
ipv6 enable
Turns IPv6 on with a link-local address only: enough for OSPFv3 or EIGRP neighbors, no global address.

15.1The step-by-step animation

  1. R1 already routes IPv4 for Sales and Engineering. Dual stack means adding IPv6 next to it, on the same interfaces. Right now Gi0/0 has no IPv6, so Host A only has the link-local address it always makes for itself, fe80::250:56ff:fea1:1b01; its Router Solicitation to ff02::2 finds no router.Host A: IPv4 192.168.10.37/25 · gateway .1 · IPv6 fe80::250:56ff:fea1:1b01 only · RS → ff02::2 no answer
  2. ipv6 unicast-routing turns R1 into an IPv6 router: it forwards IPv6, joins ff02::2 (all routers) and sends Router Advertisements. Then each interface gets its addresses: ipv6 address fe80::1 link-local replaces the EUI-64 link-local with one that is easy to read, and ipv6 address 2001:db8:acad:10::1/64 adds the global one. IPv4 stays as it was. Before using its new addresses, R1 runs DAD on them like any host.R1: global ipv6 unicast-routing · Gi0/0 fe80::1 · 2001:db8:acad:10::1/64 · Gi0/1 fe80::1 · 2001:db8:acad:20::1/64 · IPv4 unchanged
  3. From now on R1 sends a Router Advertisement out each interface every 200 seconds, and at once in answer to an RS: from fe80::1, with 2001:db8:acad:10::/64 on Gi0/0 and 2001:db8:acad:20::/64 on Gi0/1, A = 1. Host A builds 2001:db8:acad:10:250:56ff:fea1:1b01 and Host B 2001:db8:acad:20:250:56ff:fea1:2c02 (EUI-64, §14), and both take fe80::1 as their gateway. The same link-local on two interfaces is legal: each is valid only on its own link.On the wire: RA Gi0/0 2001:db8:acad:10::/64 · A = 1 · RA Gi0/1 2001:db8:acad:20::/64 · A = 1 · gateway fe80::1 on both LANs
  4. Verify on R1. show ipv6 interface brief lists every interface with its status, its link-local and its global addresses. show ipv6 route holds, for each LAN, a C route for the /64 and an L /128 route for R1's own address, the same pair IPv4 has shown since IOS 15 (§10), plus L FF00::/8. show ipv6 interface Gi0/0 adds the joined groups: FF02::1, FF02::2 (because of unicast-routing) and FF02::1:FF00:1.R1: interface brief [up/up] · FE80::1 · 2001:DB8:ACAD:10::1 · route C …:10::/64 · L …:10::1/128 · groups FF02::1 · FF02::2 · FF02::1:FF00:1
  5. Host A pings 2001:db8:acad:20:250:56ff:fea1:2c02. The destination is off-link, so the packet goes to fe80::1. R1 routes it out Gi0/1, but first needs Host B's MAC: instead of ARP it sends a Neighbor Solicitation to B's solicited-node group ff02::1:ffa1:2c02, and Host B answers with a Neighbor Advertisement. The echo is delivered and the reply comes back the same way: IPv6 end to end, IPv4 untouched.On the wire: src 2001:db8:acad:10:250:56ff:fea1:1b01 · dst 2001:db8:acad:20:250:56ff:fea1:2c02 · NS R1 → ff02::1:ffa1:2c02 · hop limit 64 → 63 at R1
  6. Wrong: during a cleanup someone removes ipv6 unicast-routing. Nothing looks broken: the interfaces keep their addresses and stay up/up in show ipv6 interface brief. But R1 is now an IPv6 host: it stops forwarding, so Host A's next ping dies at R1; it leaves FF02::2 and stops sending RAs, so a host that boots now gets only its link-local address, and the hosts already up lose their gateway, at the latest when its 1800 s router lifetime runs out.R1: ipv6 unicast-routing removed · forwarding off: the ping dies at R1 · RAs none: new hosts get link-local only
  7. Fix: put ipv6 unicast-routing back, and check it first whenever hosts have only fe80:: addresses (§16). R1 rejoins FF02::2, sends RAs again and forwards: the ping works. The verification order for any IPv6 interface: show ipv6 interface brief (addresses, up/up), show ipv6 interface (FF02::2 joined, RAs sent), show ipv6 route (C and L), show ipv6 neighbors, then ping.R1: ipv6 unicast-routing restored · FF02::2 joined again · ping works

15.2Simulator: will the hosts get IPv6?

R1's IPv6 configuration on the Sales interface

Change one thing at a time and watch what Host A (MAC 0050.56a1.1b01, SLAAC with EUI-64) ends up with: a global address, a gateway, a DNS server, or only its link-local address.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

R1 · GigabitEthernet0/0
IPv6 on Gi0/0FE80::1 + 2001:DB8:ACAD:10::1/64
Routes IPv6 · member of FF02::2yes
Router Advertisementsevery 200 s and in answer to an RS
RA contentrouter lifetime 1800 s · M = 0 · O = 0 · 2001:db8:acad:10::/64, A = 1
DHCPv6 on R1none
Host A gets
Link-localfe80::250:56ff:fea1:1b01 (always, self-made)
SLAAC global2001:db8:acad:10:250:56ff:fea1:1b01/64
DHCPv6 global—
Default gatewayfe80::1 (from the RA)
IPv6 DNS server— (IPv4 DNS still works: dual stack)
Reaches other subnets over IPv6yes
SLAAC global address: 2001:db8:acad:10:250:56ff:fea1:1b01
  • SLAAC: Host A combines the advertised /64 with its interface ID into 2001:db8:acad:10:250:56ff:fea1:1b01 (EUI-64, §14), runs DAD and uses fe80::1 as its gateway.
  • No DNS server over IPv6 (no O flag, no RDNSS option in the RA): with dual stack the hosts keep asking the IPv4 DNS server, which also returns AAAA records.

15.3The configuration, line by line

R1 · IOS-XE

1ipv6 unicast-routingGlobal: R1 forwards IPv6, joins FF02::2 and sends RAs. Without it the interfaces still get addresses, but R1 behaves as a host.
2!
3interface GigabitEthernet0/0Sales, VLAN 10: both protocols on one interface (dual stack).
4 ip address 192.168.10.1 255.255.255.128IPv4 stays as it was (§10).
5 ipv6 address FE80::1 link-localA static link-local: the gateway the hosts see, easy to read and the same on every LAN.
6 ipv6 address 2001:DB8:ACAD:10::1/64The global address. The /64 goes into the RA with A = 1 and becomes a C route; the address becomes an L /128.
7 no shutdown
8interface GigabitEthernet0/1Engineering, VLAN 20.
9 ip address 192.168.10.129 255.255.255.192
10 ipv6 address FE80::1 link-localFE80::1 again: legal, because a link-local address only has to be unique on its own link.
11 ipv6 address 2001:DB8:ACAD:20::1/64
12interface Loopback0
13 ipv6 address 2001:DB8:ACAD:FFFF::1/128A /128 (§13).

Address forms

1! the ways to give an IOS interface IPv6
2 ipv6 address 2001:DB8:ACAD:10::1/641. A static address and prefix length: the usual form on routers.
3 ipv6 address 2001:DB8:ACAD:20::/64 eui-642. A static prefix, the interface ID from the MAC (§14).
4 ipv6 address FE80::1 link-local3. A static link-local; replaces the automatic EUI-64 one.
5 ipv6 address autoconfig default4. SLAAC, like a host: the prefix from a received RA (e.g. on an ISP-facing interface); default adds a default route through the RA's sender.
6 ipv6 address dhcp5. A stateful DHCPv6 client.
7 ipv6 enable6. Link-local only (EUI-64): enough for OSPFv3 or EIGRP adjacencies.
8! forms 1, 2, 4 and 5 also create the EUI-64 link-local, unless one is configured

show ipv6 interface brief · route

1R1#show ipv6 interface brief
2GigabitEthernet0/0 [up/up]Status, then every address of the interface, link-local first.
3 FE80::1
4 2001:DB8:ACAD:10::1
5GigabitEthernet0/1 [up/up]
6 FE80::1The same link-local on another link: no conflict.
7 2001:DB8:ACAD:20::1
8Loopback0 [up/up]
9 FE80::2A1:B2FF:FEC3:D400A loopback has no MAC: IOS borrows one from an Ethernet interface for its EUI-64 link-local.
10 2001:DB8:ACAD:FFFF::1
11R1#show ipv6 route
12IPv6 Routing Table - default - 6 entries
13Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
14! (rest of the legend omitted)
15C 2001:DB8:ACAD:10::/64 [0/0]C: the /64 of Gi0/0, directly connected.
16 via GigabitEthernet0/0, directly connected
17L 2001:DB8:ACAD:10::1/128 [0/0]L: R1's own address as a /128; "receive" = the packet is for R1 itself.
18 via GigabitEthernet0/0, receive
19C 2001:DB8:ACAD:20::/64 [0/0]
20 via GigabitEthernet0/1, directly connected
21L 2001:DB8:ACAD:20::1/128 [0/0]
22 via GigabitEthernet0/1, receive
23LC 2001:DB8:ACAD:FFFF::1/128 [0/0]LC: a loopback /128 is local and connected at once.
24 via Loopback0, receive
25L FF00::/8 [0/0]Multicast is received, never routed by default: always in the table.
26 via Null0, receive

show ipv6 interface · neighbors

1R1#show ipv6 interface GigabitEthernet0/0
2GigabitEthernet0/0 is up, line protocol is up
3 IPv6 is enabled, link-local address is FE80::1The static link-local.
4 No Virtual link-local address(es):
5 Global unicast address(es):
6 2001:DB8:ACAD:10::1, subnet is 2001:DB8:ACAD:10::/64
7 Joined group address(es):
8 FF02::1All nodes.
9 FF02::2All routers: present only with ipv6 unicast-routing. Missing = R1 is not routing IPv6.
10 FF02::1:FF00:1The solicited-node group of both FE80::1 and 2001:DB8:ACAD:10::1 (same last 24 bits).
11 MTU is 1500 bytes
12 ND DAD is enabled, number of DAD attempts: 1
13 ND router advertisements are sent every 200 secondsThis part changes when RAs are suppressed or routing is off.
14 ND router advertisements live for 1800 secondsThe router lifetime the hosts receive.
15 Hosts use stateless autoconfig for addresses.
16R1#show ipv6 neighbors
17IPv6 Address Age Link-layer Addr State Interface
182001:DB8:ACAD:20:250:56FF:FEA1:2C02 0 0050.56a1.2c02 REACH Gi0/1Host B, resolved with NS / NA just now: the IPv6 ARP table.
19FE80::250:56FF:FEA1:1B01 1 0050.56a1.1b01 STALE Gi0/0Host A by its link-local, learned from its RS. STALE is normal: re-checked on the next use.
202001:DB8:ACAD:10:250:56FF:FEA1:1B01 0 0050.56a1.1b01 REACH Gi0/0

NX-OS · IOS-XR

1! NX-OS: no ipv6 unicast-routing command
2interface Ethernet1/1
3 no switchportA routed port.
4 ipv6 address 2001:db8:acad:10::1/64
5 ipv6 link-local fe80::1NX-OS has its own keyword for a static link-local.
6! IOS-XR: no ipv6 unicast-routing command either
7interface GigabitEthernet0/0/0/0
8 ipv6 address fe80::1 link-localThe same keyword as IOS.
9 ipv6 address 2001:db8:acad:10::1/64
10! on both: show ipv6 interface brief, show ipv6 route, show ipv6 neighborsThe same verification commands; NX-OS shows them per VRF.

Wrong

1no ipv6 unicast-routingThe interfaces keep their addresses and stay up/up, but R1 stops forwarding IPv6, leaves FF02::2 and stops sending RAs.
2interface GigabitEthernet0/0
3 ipv6 address FE80::1/64Not how IOS sets a link-local: use the link-local keyword, without a prefix length.
4 ipv6 address 2001:DB8:ACAD:10::1/80Not a /64: the RA carries the prefix, but the hosts ignore it for SLAAC and keep only link-local addresses.
5 ipv6 nd ra suppress allNo RA at all, not even in answer to an RS: SLAAC hosts get no prefix and no gateway.
6 ipv6 address 2001:DB8:ACAD:10::1 255.255.255.0IPv4 habit: IPv6 never uses a dotted mask; IOS rejects the syntax.

The outputs are typical for IOS-XE; details may vary between versions.

15.4Remember

Critical for the exam
ipv6 unicast-routing is the one global command that makes IOS an IPv6 router: forwarding, membership of FF02::2 and Router Advertisements. Without it the interfaces still have addresses and show up/up, but hosts receive no RA and keep only their link-local addresses. Dual stack = IPv4 and IPv6 on the same interfaces, each with its own routing table.
Theory
Hosts use the router's link-local address, the source of its RA, as their default gateway, never its global address. That is why ipv6 address fe80::1 link-local on every LAN interface is a common design: every host shows default via fe80::1, and renumbering the global prefix does not touch it.
Pitfall
An IPv6 interface always has a link-local address, so "IPv6 is enabled" proves nothing about global reachability. Check the global address, its /64 length and FF02::2 in show ipv6 interface. The classic exam trap: the addresses look fine and ipv6 unicast-routing is missing.
Numbers
For each IPv6 address IOS installs a C route for the prefix and an L /128 for the address (LC for a loopback), plus L FF00::/8 via Null0. RAs every 200 s with an 1800 s router lifetime; neighbor states INCOMPLETE, REACH, STALE, DELAY, PROBE; reachable time 30,000 ms.
Pitfall
IPv4 habits that fail: a dotted mask, a LAN prefix that is not /64 (hosts end up link-local only), a hand-typed gateway on every host (they learn it from the RA), or looking for IPv6 in show ip interface brief. The IPv6 commands are separate: show ipv6 interface brief, show ipv6 route, show ipv6 neighbors.
Platforms and standards
NX-OS and IOS-XR route IPv6 without an ipv6 unicast-routing command. A static link-local is ipv6 address fe80::1 link-local on IOS and IOS-XR, ipv6 link-local fe80::1 on NX-OS. IOS uses EUI-64 for every link-local it is not given, and interfaces without a MAC (loopbacks, serial) borrow one. Standards: RFC 4213 (dual stack), RFC 4861 (NDP), RFC 4862 (SLAAC).
Verify withshow ipv6 interface briefshow ipv6 interface GigabitEthernet0/0show ipv6 routeshow ipv6 neighborsping 2001:db8:acad:20:250:56ff:fea1:2c02

15.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

R1's Gi0/0 has ipv6 address 2001:DB8:ACAD:10::1/64 and is up/up, but the global configuration has no ipv6 unicast-routing. What do the SLAAC hosts on that LAN end up with?

  1. AGlobal SLAAC addresses, but no default gateway
  2. BNothing at all, not even link-local addresses
  3. COnly their link-local addresses: R1 sends no Router Advertisements
  4. DGlobal addresses and a gateway: unicast-routing only matters for routing protocols
Show answer
Answer: C. Without ipv6 unicast-routing, IOS behaves as an IPv6 host: it keeps its interface addresses but does not join FF02::2, sends no RA and forwards no IPv6. With no RA the hosts learn no prefix and no gateway, so they keep only the link-local addresses they always create for themselves, which is also why "nothing at all" is wrong.
CCNACCNA 200-301Q2

Which IOS interface command gives GigabitEthernet0/0 the link-local address fe80::1?

  1. Aipv6 address fe80::1/64
  2. Bipv6 address fe80::1 link-local
  3. Cipv6 link-local fe80::1
  4. Dipv6 address fe80::1/10 link-local
Show answer
Answer: B. On IOS (and IOS-XR) a static link-local address uses the link-local keyword and no prefix length. ipv6 address fe80::1/64 is not the IOS way to set a link-local, ipv6 link-local fe80::1 is the NX-OS syntax, and the link-local keyword takes an address without a prefix length, so the /10 form is rejected.
CCNACCNA 200-301Q3

show ipv6 route on R1 lists C 2001:DB8:ACAD:10::/64 and L 2001:DB8:ACAD:10::1/128, both via GigabitEthernet0/0. What is the L route?

  1. AThe summary route R1 advertises for the whole site
  2. BA route to the link-local address FE80::1 of Gi0/0
  3. CA host route learned from a neighbor's Neighbor Advertisement
  4. DR1's own address on Gi0/0, as a /128 for traffic to R1 itself
Show answer
Answer: D. For every IPv6 address configured on an interface, IOS installs a C route for its prefix and an L (local) /128 route for the address itself, marked receive: traffic to it is for the router. Link-local addresses never appear as L routes, neighbors go into the neighbor table rather than the routing table, and a summary would be a static or protocol route.
CCNACCNA 200-301Q4

Host A (2001:db8:acad:10:250:56ff:fea1:1b01) pings Host B (2001:db8:acad:20:250:56ff:fea1:2c02). R1 has no neighbor entry for Host B yet. What does R1 send out Gi0/1 first?

  1. AAn ARP request to the broadcast ffff.ffff.ffff
  2. BA Neighbor Solicitation to all nodes, ff02::1
  3. CA Neighbor Solicitation to ff02::1:ffa1:2c02
  4. DA Router Solicitation to all routers, ff02::2
Show answer
Answer: C. IPv6 resolves MAC addresses with NDP: R1 sends a Neighbor Solicitation to Host B's solicited-node group, ff02::1:ff plus the last 24 bits of the address (a1:2c02), and Host B answers with a Neighbor Advertisement. ARP does not exist in IPv6, all-nodes would disturb every host on the link, and an RS is what a host sends to find routers.
ProfessionalENARSI 300-410Q5

Gi0/0 has ipv6 unicast-routing, fe80::1 and ipv6 address 2001:DB8:ACAD:10::1/80. show ipv6 interface brief shows it up/up. What do the SLAAC hosts on the LAN get?

  1. AGlobal addresses from the /80, with 48-bit interface IDs
  2. BNo RA at all, because IOS refuses to advertise a prefix that is not /64
  3. CA gateway (fe80::1) but no global address: SLAAC needs a /64
  4. DGlobal addresses through DHCPv6, which the hosts start automatically
Show answer
Answer: C. The RA carries the /80 and R1 as a default router, but a host builds a SLAAC address only when prefix length + 64-bit interface ID = 128 (RFC 4862, RFC 7421), so it ignores the /80 and keeps only its link-local address. Hosts never shorten their interface ID, and they start DHCPv6 only when the RA says M = 1 or O = 1.
ProfessionalENARSI 300-410Q6

On R1's Gi0/0 you configure ipv6 nd ra suppress, without the all keyword. A laptop is plugged into the LAN a minute later. What happens?

  1. AIt receives no RA at all and keeps only its link-local address
  2. BIts RS still gets an RA in reply, so SLAAC works; only periodic RAs stop
  3. CIt receives periodic RAs without the prefix information
  4. DIt gets its address from DHCPv6 instead, because suppress sets the M flag
Show answer
Answer: B. ipv6 nd ra suppress stops the unsolicited, periodic RAs; R1 still answers Router Solicitations, so a host that boots or connects is configured. The catch: nothing refreshes the default router later, and it expires after the router lifetime (1800 s by default). ipv6 nd ra suppress all would stop the solicited RAs too, and suppression never sets the M flag.
CCIECCIE EI v1.1Q7

R1 runs ipv6 unicast-routing. Gi0/0, MAC 00a1.b2c3.d400, has ipv6 address FE80::1 link-local and ipv6 address 2001:DB8:ACAD:10::/64 eui-64. Which groups does show ipv6 interface Gi0/0 list as joined?

  1. AFF02::1, FF02::2, FF02::1:FF00:1 and FF02::1:FFC3:D400
  2. BFF02::1, FF02::2 and FF02::1:FFC3:D400 only: one solicited-node group per interface
  3. CFF02::1, FF02::2, FF02::1:FF00:1 and FF02::1:FF00:D400
  4. DFF02::1, FF02::1:FF00:1 and FF02::1:FFC3:D400: a router does not join FF02::2
Show answer
Answer: A. Every IPv6 interface joins FF02::1, ipv6 unicast-routing adds FF02::2, and there is one solicited-node group per distinct last 24 bits: FE80::1 gives FF02::1:FF00:1, and the EUI-64 address 2001:DB8:ACAD:10:2A1:B2FF:FEC3:D400 gives FF02::1:FFC3:D400. Two addresses that ended in the same 24 bits would share one group. FF02::1:FF00:D400 takes only the last 16 bits instead of 24.

Troubleshooting: wrong masks, overlapping subnets and missing IPv6

CCNA 200-301 v1.1ENARSI 300-410CCIE EI v1.1

TL;DRTroubleshoot addressing from the host outwards: what the host believes (address, mask, gateway, ARP cache), then what the router believes (interfaces, routes, ARP, proxy ARP). The incident replayed here: Host B has 192.168.10.150/24 instead of /26, so it ARPs for 192.168.10.37 instead of sending to its gateway; R1's default proxy ARP hid the mistake for weeks, and no ip proxy-arp exposed it. Two shorter cases follow: a lab /28 on R2 that overlaps a LAN on R1 and wins by longest match, and an IPv6 LAN with only fe80:: addresses because ipv6 unicast-routing is missing.

The terms, in short
On-link / off-link
The host's own decision: destination AND its mask = its network → on-link, ARP for the destination; otherwise off-link, ARP for the gateway.
Proxy ARP
RFC 1027: a router answers an ARP request for an address it reaches through another interface, with its own MAC. On by default on IOS interfaces.
ARP cache
The host's IP → MAC table (arp -a, ip neigh). Several IPs on the router's MAC are the signature of proxy ARP.
Destination host unreachable
On Windows, a reply that comes from the host's own address means its own ARP failed: the packet never left. "Request timed out" means it left and nothing came back.
ICMP redirect
A router that sends a packet back out the interface it came in on tells the host a better next hop on its own LAN.
Router Advertisement (RA)
The ICMPv6 message that gives IPv6 hosts their prefix and default gateway. IOS sends it only with ipv6 unicast-routing.

16.1The step-by-step animation

  1. Monday, 09:10. The ticket: "Host B (Engineering) cannot open the file share on 192.168.10.37 (Host A, Sales). The Internet works." On Friday evening R1 was hardened with no ip proxy-arp on every interface. Replay it: a web request from Host B reaches 203.0.113.10, but every ping to 192.168.10.37 gets Destination host unreachable, and that reply comes from Host B's own address.Symptom: ping 203.0.113.10 Reply from 203.0.113.10 · ping 192.168.10.37 Reply from 192.168.10.150: Destination host unreachable. · Friday's change no ip proxy-arp on R1
  2. Start at the host that complains. ipconfig on Host B: 192.168.10.150, mask 255.255.255.0, gateway 192.168.10.129. Engineering is a /26: the NIC was replaced last month and configured by hand. AND-ing 192.168.10.37 with the /24 gives 192.168.10.0, Host B's own network, so Host B treats Host A as on-link and ARPs for 192.168.10.37 itself. Nobody on VLAN 20 owns that address. With the right /26 the AND gives .0 against .128: off-link, send it to the gateway.Host B: address 192.168.10.150 · mask 255.255.255.0 (Eng is a /26) · .37 AND /24 192.168.10.0 = mine → ARP for .37
  3. Now R1, to rule it out. show ip interface brief: Gi0/0 and Gi0/1 up/up. show ip route 192.168.10.37: connected, out Gi0/0. show ip arp: Host A (.37) and Host B (.150) are both there, so R1 reaches both LANs and a ping from R1 to .37 works. show ip interface Gi0/1 | include Proxy: Proxy ARP is disabled, Friday's change. R1 is healthy: it simply no longer answers ARP requests for addresses that are not its own.R1: Gi0/1 up / up, 192.168.10.129/26 · route to .37 C 192.168.10.0/25 via Gi0/0 · Proxy ARP disabled
  4. Why did it work for a month? Replay it as it was before Friday, with proxy ARP on (ip proxy-arp, the IOS default). Host B's ARP request for 192.168.10.37 reaches R1 Gi0/1; R1 reaches .37 through another interface, Gi0/0, so it answers with its own MAC. Host B sends the frames to R1, which routes them. The evidence is in last week's arp -a: .37, .129 and the switch at .200 all map to one MAC, R1's 00-a1-b2-c3-d4-01, and the broadcast entry is .255 instead of .191. Several IPs on one MAC: a wrong mask hidden by proxy ARP.Proxy ARP: ARP request who has 192.168.10.37? tell .150 · proxy reply .37 is at 00a1.b2c3.d401 (R1 Gi0/1) · arp -a .37 · .129 · .200 → one MAC
  5. Fix the cause, not the symptom: give Host B the mask of its LAN, 255.255.255.192, and fix the template or DHCP scope it came from. Keep no ip proxy-arp: it exposed the error instead of hiding it. Now .37 AND /26 = 192.168.10.0, not Host B's 192.168.10.128, so Host B sends the packet to its gateway, and the only off-link address it ever ARPs for is 192.168.10.129. Verify: the ping works and arp -a holds .129 and Engineering hosts only.Fix: mask 255.255.255.192 (/26) · .37 AND /26 192.168.10.0 ≠ 192.168.10.128 → gateway · ARP only for 192.168.10.129
  6. Second case, same week: Engineering hosts .176 to .190 cannot be reached from Sales, while Host B (.150) can. On R1, show ip route 192.168.10.180 answers 192.168.10.176/28 via 192.168.10.226, learned by OSPF from R2: a new lab LAN on R2 was numbered 192.168.10.176/28, inside Engineering's 192.168.10.128/26. IOS checks overlaps only between its own interfaces, so nothing complained, and longest match prefers the /28 (AD 110) to the connected /26 (AD 0). Fix: renumber the lab into free space, 192.168.10.240/28.Overlap: R1 → .180 O 192.168.10.176/28 via .226 · connected C 192.168.10.128/26 (AD 0) · rule longest match first; AD only breaks ties
  7. Third case: the Sales LAN got IPv6 last week (§15), but its hosts still have only fe80:: addresses. ip -6 addr on Host A shows fe80::250:56ff:fea1:1b01 and nothing in 2001:db8:acad:10::/64. show ipv6 interface Gi0/0 on R1 lists 2001:db8:acad:10::1, but R1 has not joined FF02::2 (all routers) and sends no Router Advertisements: the global ipv6 unicast-routing is missing, so R1 is an IPv6 host, not a router. One command fixes it: R1 answers the RS, and Host A builds its SLAAC address and uses fe80::1 as its gateway.IPv6: Host A fe80::250:56ff:fea1:1b01 only · R1 Gi0/0 no FF02::2, no RA · fix ipv6 unicast-routing

16.2Simulator: what does the host do with the packet?

The host's address, mask and gateway, a destination, and R1's proxy ARP

The network is the HQ plan: R1 Gi0/0 192.168.10.1/25 (Sales), Gi0/1 192.168.10.129/26 (Engineering), Gi0/3 .193/27 (Management), Gi0/2 .225/30 (R2), and a default route to the ISP; 203.0.113.0/24 and the other documentation ranges stand in for the Internet. Type the host's address with its mask, as the host is (mis)configured.

This simulator is interactive and needs JavaScript. Below is its result with the starting values.

StepWhat happens
1. Host: on-link?192.168.10.37 AND /24 = 192.168.10.0 = 192.168.10.0 (mine) → on-link: ARP for the destination itself
2. Host ARPs for192.168.10.37 (a broadcast on the Engineering LAN)
3. ARP reply fromR1 Gi0/1 by proxy ARP · 00a1.b2c3.d401
Host ARP cache gains192.168.10.37 → 00a1.b2c3.d401
4. Packet pathHost B (192.168.10.150) → R1 Gi0/1 → Gi0/0 → Host A (192.168.10.37)
Resultping: Reply from 192.168.10.37
Works, but only because R1 answers by proxy ARP
  • Nobody on the Engineering LAN owns 192.168.10.37. R1 receives the ARP request on Gi0/1, reaches 192.168.10.37 through Gi0/0, and answers with its own MAC (proxy ARP, the IOS default). The host now has 192.168.10.37 → 00a1.b2c3.d401 in its ARP cache, and R1 routes the frames.
  • It works by accident: with no ip proxy-arp on Gi0/1 (or behind a Nexus or IOS-XR gateway, where it is off by default) the same ping fails.
  • Fix the host: mask 255.255.255.192 (/26), the mask of the Engineering LAN (192.168.10.128/26).

16.3The configuration, line by line

Host B · Windows

1C:\> ipconfig
2Ethernet adapter Ethernet0:
3 IPv4 Address. . . . . . . . . . . : 192.168.10.150
4 Subnet Mask . . . . . . . . . . . : 255.255.255.0The cause: Engineering is 192.168.10.128/26, mask 255.255.255.192.
5 Default Gateway . . . . . . . . . : 192.168.10.129Correct, and inside both the /24 and the /26: that is why the Internet still works.
6C:\> ping 192.168.10.37
7Reply from 192.168.10.150: Destination host unreachable.The answer comes from Host B itself: its ARP for .37 failed, so the packet never left. "Request timed out" would mean it left and no answer came back.
8! Last week, with proxy ARP still on R1:
9C:\> arp -a
10Interface: 192.168.10.150 --- 0x7
11 Internet Address Physical Address Type
12 192.168.10.37 00-a1-b2-c3-d4-01 dynamicHost A's address with R1's MAC: R1 answered for it by proxy ARP.
13 192.168.10.129 00-a1-b2-c3-d4-01 dynamicThe real gateway, the same MAC.
14 192.168.10.200 00-a1-b2-c3-d4-01 dynamicA switch in the Management /27: R1's MAC again. Three IPs on one MAC = proxy ARP.
15 192.168.10.255 ff-ff-ff-ff-ff-ff staticWindows lists its own subnet broadcast: .255 means a /24. With the /26 it would be .191.

Host B · Linux

1$ ip -4 addr show dev eth0
2 inet 192.168.10.150/24 brd 192.168.10.255 scope global eth0The /24 and its broadcast .255, on one line.
3$ ip route
4default via 192.168.10.129 dev eth0
5192.168.10.0/24 dev eth0 proto kernel scope link src 192.168.10.150The kernel's connected route: all of 192.168.10.0/24 is "on-link", .37 included.
6$ ping -c 2 192.168.10.37
7From 192.168.10.150 icmp_seq=1 Destination Host UnreachableThe same local ARP failure as on Windows.
8$ ip neigh show 192.168.10.37
9192.168.10.37 dev eth0 FAILEDNo ARP reply (INCOMPLETE while it is still asking). With proxy ARP on, this line read: lladdr 00:a1:b2:c3:d4:01 REACHABLE.

R1 · show

1R1#show ip interface brief
2Interface IP-Address OK? Method Status Protocol
3GigabitEthernet0/0 192.168.10.1 YES NVRAM up up
4GigabitEthernet0/1 192.168.10.129 YES NVRAM up upBoth LANs are up/up: Layers 1 and 2 are fine.
5R1#show ip route 192.168.10.37
6Routing entry for 192.168.10.0/25
7 Known via "connected", distance 0, metric 0 (connected, via interface)R1 knows exactly where .37 is.
8 Routing Descriptor Blocks:
9 * directly connected, via GigabitEthernet0/0
10R1#show ip arp
11Protocol Address Age (min) Hardware Addr Type Interface
12Internet 192.168.10.1 - 00a1.b2c3.d400 ARPA GigabitEthernet0/0"-" = R1's own address.
13Internet 192.168.10.37 3 0050.56a1.1b01 ARPA GigabitEthernet0/0
14Internet 192.168.10.129 - 00a1.b2c3.d401 ARPA GigabitEthernet0/1
15Internet 192.168.10.150 1 0050.56a1.2c02 ARPA GigabitEthernet0/1Host B is known: R1 can reach it. Only the direction Host B → .37 is broken.
16R1#show ip interface GigabitEthernet0/1 | include Proxy
17 Proxy ARP is disabledFriday's hardening.
18 Local Proxy ARP is disabledA different feature (answering between hosts of the same subnet); off by default.

Fix

1! Host B (Windows): the mask of the Engineering LAN
2netsh interface ipv4 set address name="Ethernet0" static 192.168.10.150 255.255.255.192 192.168.10.129Address, mask and gateway in one command; or the same values in the adapter's IPv4 settings.
3! R1: if the Engineering hosts use DHCP, the mask comes from the pool
4ip dhcp pool ENG
5 network 192.168.10.128 255.255.255.192The pool's mask is the mask every client receives (option 1).
6 default-router 192.168.10.129Option 3, the gateway.
7! R1: keep the hardening
8interface GigabitEthernet0/1
9 no ip proxy-arpIt stays: without proxy ARP a wrong mask fails at once, instead of working by accident.

Overlap · R1 and R2

1R2#show running-config interface GigabitEthernet0/1
2interface GigabitEthernet0/1
3 description Lab LAN
4 ip address 192.168.10.177 255.255.255.240The lab /28: 192.168.10.176 – .191, inside Engineering's /26 on R1. R2 has no other interface in that range, so it accepted it.
5R1#show ip route 192.168.10.180
6Routing entry for 192.168.10.176/28Not the connected /26: the /28 is a longer match for .180.
7 Known via "ospf 1", distance 110, metric 2, type intra area
8 Routing Descriptor Blocks:
9 * 192.168.10.226, from 10.255.0.2, 00:41:12 ago, via GigabitEthernet0/2Toward R2: Engineering hosts .176 – .190 are unreachable from every other subnet.
10C:\> tracert -d 192.168.10.180
11 1 <1 ms <1 ms <1 ms 192.168.10.1
12 2 1 ms 1 ms 1 ms 192.168.10.226Hop 2 is R2: the packet went the wrong way.
13 3 * * * Request timed out.
14! Fix on R2: renumber the lab into free space
15interface GigabitEthernet0/1
16 ip address 192.168.10.241 255.255.255.240192.168.10.240/28 is free in the HQ plan (.228 – .255).

IPv6 · R1 and Host A

1[Host A]$ ip -6 addr show dev eth0
2 inet6 fe80::250:56ff:fea1:1b01/64 scope linkOnly the link-local address: no RA has ever arrived.
3[Host A]$ ip -6 route
4fe80::/64 dev eth0 proto kernel metric 256No default route either.
5R1#show ipv6 interface GigabitEthernet0/0
6GigabitEthernet0/0 is up, line protocol is up
7 IPv6 is enabled, link-local address is FE80::1
8 Global unicast address(es):
9 2001:DB8:ACAD:10::1, subnet is 2001:DB8:ACAD:10::/64The address is there: the interface is configured.
10 Joined group address(es):
11 FF02::1
12 FF02::1:FF00:1All nodes and the solicited-node group of ::1. FF02::2, all routers, is missing: R1 is not acting as a router, and no "ND router advertisements are sent" line follows.
13R1(config)#ipv6 unicast-routingThe fix: R1 joins FF02::2, answers Router Solicitations and sends RAs every 200 s (the default) with 2001:db8:acad:10::/64.
14R1#show ipv6 route
15C 2001:DB8:ACAD:10::/64 [0/0]Excerpt: the two entries of Gi0/0. In IPv6 the L routes are their own source (show ipv6 route local), not part of connected.
16 via GigabitEthernet0/0, directly connected
17L 2001:DB8:ACAD:10::1/128 [0/0]
18 via GigabitEthernet0/0, receiveThe IPv6 L route is a /128.
19[Host A]$ ip -6 addr show dev eth0
20 inet6 2001:db8:acad:10:250:56ff:fea1:1b01/64 scope global dynamicSLAAC: the /64 from the RA plus the EUI-64 interface ID (§14).
21[Host A]$ ip -6 route | grep default
22default via fe80::1 dev eth0 proto ra metric 1024 expires 1797secThe gateway is R1's link-local address, learned from the RA (router lifetime 1800 s).

The outputs are typical for IOS-XE, Windows 10/11 and a current Linux distribution; details may vary between versions.

16.4Remember

Critical for the exam
The host decides alone, with its own mask: destination AND mask = its network → on-link, ARP for the destination; otherwise ARP for the gateway. A mask that is too short makes it ARP for remote hosts. That fails, unless the router answers by proxy ARP (ip proxy-arp, on by default on IOS interfaces), and then fails the day proxy ARP is disabled.
Theory
Why "the Internet works": every destination outside 192.168.10.0/24 is off-link with the /24 too, so it goes to the gateway as it should. Only the addresses inside the /24 but outside the /26 (.0 – .127 and .192 – .255) are misjudged, and only those depended on R1's proxy ARP (RFC 1027), which answers with its own MAC when its route to the target leaves through another interface.
Pitfall
no ip proxy-arp is good hardening, and it exposes every latent wrong mask at once. Before the change, look for the signature in host ARP caches: several IP addresses on the router's MAC. After it, the same hosts report "Destination host unreachable" from their own address. Fix the masks (or the DHCP pool), not the router.
Numbers
IOS ARP entries live 4 hours (arp timeout 14400), and traffic does not refresh them: an IOS device with a wrong mask, such as the switch at .200, keeps its proxy-learned entries and fails up to 4 hours after no ip proxy-arp. Windows keeps a neighbour entry reachable for a random 15 – 45 s, so a Windows host fails within a minute. Windows: "Reply from <own IP>: Destination host unreachable" = local ARP failure; "Request timed out" = sent, no answer. IOS sends an IPv6 RA every 200 s by default, with a router lifetime of 1800 s.
Pitfall
Overlapping subnets on two routers are invisible to IOS: it checks only its own interfaces, per VRF. Longest match then splits the LAN: the lab /28 on R2 (AD 110) beats R1's connected /26 (AD 0) for .176 – .191, because the prefix length is compared before the administrative distance. show ip route <address> and a traceroute that turns off at the wrong router show it.
Platforms and standards
Host side: Windows ipconfig /all, arp -a, route print; Linux ip addr, ip route, ip neigh (FAILED / INCOMPLETE), ip -6 addr. Router side: show ip arp, show ip interface | include Proxy, show ipv6 interface. NX-OS and IOS-XR leave proxy ARP disabled by default (ip proxy-arp / proxy-arp per interface), so the same wrong mask fails at once behind them.
Verify withipconfig /all · arp -aip addr · ip route · ip neighshow ip interface briefshow ip route 192.168.10.37show ip arpshow ip interface GigabitEthernet0/1 | include Proxyshow ipv6 interface GigabitEthernet0/0show ipv6 route

16.5Check yourself: exam-style questions

CCNACCNA 200-301Q1

Host B is on the Engineering LAN (192.168.10.128/26) but is configured with 192.168.10.150, mask 255.255.255.0, gateway 192.168.10.129. R1 has no ip proxy-arp. Host B pings 192.168.10.37 on the Sales LAN. What happens?

  1. AR1 answers the ARP with its own MAC, and the ping works
  2. BHost B refuses to send anything, because its gateway is outside its subnet
  3. CHost B ARPs for 192.168.10.37 itself, nobody answers, and the ping fails
  4. DHost B sends the packet to its gateway 192.168.10.129, and the ping works
Show answer
Answer: C. With the /24, 192.168.10.37 AND 255.255.255.0 = 192.168.10.0, Host B's own network, so the host decides the destination is on-link and ARPs for it directly. Host A is on another VLAN and R1 no longer answers for other addresses, so the ARP fails. The gateway .129 is inside both the /24 and the /26, and R1 would answer only with proxy ARP enabled.
CCNACCNA 200-301Q2

Host B has the address 192.168.10.150 with the mask 255.255.255.192. Which of these can be its default gateway?

  1. A192.168.10.129
  2. B192.168.10.128
  3. C192.168.10.191
  4. D192.168.10.1
Show answer
Answer: A. 192.168.10.150/26 is in 192.168.10.128/26: network .128, hosts .129 – .190, broadcast .191. A gateway must be a usable host of the host's own subnet, so .129 is the one. .128 and .191 are the network and broadcast addresses of that /26, and .1 belongs to 192.168.10.0/26: off the host's subnet, even though it is R1's Sales address.
CCNACCNA 200-301Q3

On a Windows host whose LAN is a /26, arp -a lists 192.168.10.37, 192.168.10.129 and 192.168.10.200, all with the same physical address, the MAC of the router's LAN interface. What is the most likely explanation?

  1. AThe switch is flooding frames because its MAC address table is full
  2. BThe router answers for every address because its own mask is too short
  3. CThe host's mask is too short, and the router answers its ARPs by proxy ARP
  4. DThree hosts were cloned from one image and share the same MAC address
Show answer
Answer: C. A host ARPs only for addresses it believes are on-link. Remote addresses in its cache (.37 in Sales, .200 in Management) mean it thinks they are local, so its mask is too short; they all resolve to the router's MAC because the router answered by proxy ARP. Cloned MACs cannot explain it: .129 is the router itself and .37 sits on another VLAN, and a full MAC table changes how a switch floods, never what a host caches.
CCNACCNA 200-301Q4

A Windows host pings a server and gets Reply from 192.168.10.150: Destination host unreachable., where 192.168.10.150 is the host's own address. What does this tell you?

  1. AA router on the path had no route and returned an ICMP unreachable
  2. BThe server received the request, but a firewall filtered its reply
  3. CThe packet's TTL expired on the way before it reached the server
  4. DThe host's ARP for the next hop failed, so the packet never left it
Show answer
Answer: D. When the reply comes from the host's own address, the error was generated locally: the ARP for the next hop (the destination itself if it is on-link, otherwise the gateway) got no answer. A router without a route would answer from its own address, a filtered reply gives Request timed out, and an expired TTL gives TTL expired in transit from the router that dropped it.
ProfessionalENARSI 300-410Q5

R1 has C 192.168.10.128/26 on Gi0/1 (Engineering). R2 advertises 192.168.10.176/28, a lab LAN, into OSPF. A Sales host pings 192.168.10.180. Where does R1 send the packet?

  1. AOut Gi0/1: a connected route (AD 0) always beats OSPF (AD 110)
  2. BBoth ways: R1 load-balances between the two routes
  3. CNowhere: R1 rejects an OSPF route that overlaps a connected subnet
  4. DTo R2: the /28 is a longer match than the connected /26
Show answer
Answer: D. Routing picks the longest matching prefix first; the administrative distance only decides between routes to the same prefix and length. 192.168.10.180 matches both the /26 and the /28, so the OSPF /28 wins and the packet goes to R2. IOS checks overlaps only between its own interfaces, so nothing stops R2's lab from hiding Engineering hosts .176 – .190.
ProfessionalENARSI 300-410Q6

On R1's Gi0/0 (2001:DB8:ACAD:10::1/64), show ipv6 interface lists FF02::2 and ND router advertisements are sent every 200 seconds. The Sales hosts install a default route via fe80::1, yet they still have only fe80:: addresses. Which interface setting explains it?

  1. AThe RA carries M = 1 (ipv6 nd managed-config-flag)
  2. BThe prefix is advertised with A = 0 (ipv6 nd prefix … no-autoconfig)
  3. CThe RA carries O = 1 (ipv6 nd other-config-flag)
  4. DPeriodic RAs are suppressed (ipv6 nd ra suppress)
Show answer
Answer: B. The hosts do receive RAs: their default route via fe80::1 comes from one, and FF02::2 shows that ipv6 unicast-routing is on. They skip SLAAC because the prefix information carries A = 0, which is what ipv6 nd prefix 2001:DB8:ACAD:10::/64 2592000 604800 no-autoconfig sends. O = 1 only adds options through stateless DHCPv6, M = 1 adds DHCPv6 addresses without switching SLAAC off, and ipv6 nd ra suppress stops only the periodic RAs (and the output would say so): with any of those the hosts would still build 2001:db8:acad:10::/64 addresses.
ProfessionalENARSI 300-410Q7

The management switch at 192.168.10.200 (IOS, gateway 192.168.10.193) has the mask 255.255.255.0 instead of /27. It has been reaching Host A (192.168.10.37) thanks to R1's proxy ARP. At 18:00 you enter no ip proxy-arp on R1. When does the switch lose Host A?

  1. AWithin a minute: R1 sends a gratuitous ARP to withdraw it
  2. BWhen its ARP entry for .37 ages out, up to 4 hours later
  3. CNever: each packet to .37 refreshes the cached ARP entry
  4. DAt once: R1 stops routing frames for addresses it proxied
Show answer
Answer: B. Proxy ARP only changes how R1 answers ARP requests: frames already addressed to R1's MAC are still routed normally. The switch keeps 192.168.10.37 → R1's MAC until the IOS ARP timeout (4 hours by default, and traffic does not reset it); its next ARP for .37 gets no answer, and only then does it fail. That delay is why a no ip proxy-arp change can seem to break things hours later.
CCIECCIE EI v1.1Q8

Host B is 192.168.10.150 with the mask 255.255.255.224 (the LAN is really 192.168.10.128/26) and gateway 192.168.10.129. It pings 192.168.10.170, another host on the same LAN with a correct /26. What happens?

  1. AIt fails: R1 never forwards a packet out the interface it arrived on
  2. BIt works via R1, which routes it back out Gi0/1 and sends an ICMP redirect
  3. CIt fails: Host B ARPs for .170 on the LAN, and nobody answers the request
  4. DIt works directly: Host B ARPs for .170, because both hosts are in 192.168.10.128/26
Show answer
Answer: B. With /27 Host B's network is 192.168.10.128/27 (.128 – .159), so .170 is off-link and goes to the gateway .129, which is inside the /27. R1 forwards it back out Gi0/1 and, because the next hop is on the same subnet as the sender, sends an ICMP redirect. The reply from .170 goes straight to .150, which is on-link for its correct /26: the traffic works, asymmetrically and with a needless detour.

Recap: IP addressing and subnetting on a single page

TL;DREverything to re-read before the exam: the numbers, the ranges you must recognize on sight, the subnetting method, VLSM and summarization, the IPv6 address types and prefixes, the Cisco commands and the exam mapping.

The numbers you need

NumberWhat it means
32 / 128 bitsan IPv4 address (4 octets, dotted decimal) / an IPv6 address (8 hextets, 32 hex digits)
232 ≈ 4.3 billion · 2128 ≈ 3.4 × 1038the size of the IPv4 / IPv6 address space; IANA gave out its last five IPv4 /8s on 3 February 2011
128 64 32 16 8 4 2 1the place values of an octet: every conversion starts here (37 = 32 + 4 + 1 = 00100101)
0 128 192 224 240 248 252 254 255the only nine values a mask octet can take; anything else (255.255.255.250) is refused
2h − 2usable hosts with h host bits (h = 32 − prefix): /20 → 4,094, /25 → 126
2ssubnets from s borrowed bits, subnet zero and the all-ones subnet included (RFC 1878; ip subnet-zero by default since IOS 12.0)
256 − mask octetthe block size in the interesting octet: 256 − 240 = 16, 256 − 224 = 32
255.255.255.255 − maskthe wildcard: /20 → 0.0.15.255, /30 → 0.0.0.3 (0 = must match, 1 = ignore)
/24 254 · /25 126 · /26 62 · /27 30 · /28 14 · /29 6 · /30 2usable hosts per prefix; /16 = 65,534
/312 usable addresses, no network and no broadcast: point-to-point links only (RFC 3021)
/32a single address: loopbacks, host routes and the IOS 15+ L routes
/8 · /16 · /24the default masks of classes A (1–126), B (128–191) and C (192–223); D 224–239 multicast, E 240–255 reserved
/12172.16.0.0–172.31.255.255, the RFC 1918 block everybody gets wrong (172.32.0.1 is public)
/10100.64.0.0/10, shared address space for carrier-grade NAT (RFC 6598), not RFC 1918
/48 · /56an IPv6 site (65,536 /64s) · a small site or a home (256 /64s); RFC 6177, RIPE-690
/64every IPv6 LAN, whatever its size: SLAAC needs a 64-bit interface ID (RFC 4862, RFC 7421)
/127 · /128an IPv6 router-to-router link (RFC 6164) · an IPv6 loopback
ff:fe · 0x02modified EUI-64: insert ff:fe in the middle of the MAC, flip bit 0x02 of the first byte (0050.56a1.1b01 → 250:56ff:fea1:1b01)
AD 0 · AD 5connected and local routes · the EIGRP summary route to Null0
ICMPv6 133 / 134 / 135 / 136Router Solicitation / Router Advertisement / Neighbor Solicitation / Neighbor Advertisement
UDP 67/68 · UDP 546/547DHCPv4 server/client · DHCPv6 client/server and relay (group ff02::1:2)
200 s · 1800 sIOS Router Advertisement interval · router lifetime carried in each RA
4 hoursthe IOS ARP timeout: a stale proxy-ARP entry can hide a wrong mask that long
RFC 791 · 950 · 1878 · 4632IPv4 · the subnet mask (1985) · subnet zero allowed · CIDR (first RFC 1519 in 1993)
RFC 1918 · 6598 · 3927 · 5737 · 6890private space · CGN shared space · APIPA · documentation ranges · the special-purpose registry
RFC 4291 · 5952 · 4193 · 4862 · 8981 · 7217IPv6 addressing · canonical text form · ULA · SLAAC · temporary addresses · stable opaque interface IDs

The ranges to recognize on sight

IPv4 blockWhat it isRFCThe rule
0.0.0.0/8"This network"; 0.0.0.0 = "this host"RFC 791, RFC 1122source only (the DHCP Discover); written 0.0.0.0/0 it is the default route
10.0.0.0/8Private-UseRFC 1918reused everywhere; needs NAT to reach the Internet
100.64.0.0/10Shared Address SpaceRFC 6598between a carrier-grade NAT and its customers; never across provider boundaries
127.0.0.0/8LoopbackRFC 1122the whole /8 is the host itself; never leaves the IP stack
169.254.0.0/16Link-local (APIPA)RFC 3927self-assigned when DHCP fails; mask /16, no gateway, never routed
172.16.0.0/12Private-UseRFC 1918172.16.0.0 to 172.31.255.255 only
192.168.0.0/16Private-UseRFC 1918reused everywhere; needs NAT to reach the Internet
192.0.2.0/24 · 198.51.100.0/24 · 203.0.113.0/24Documentation (TEST-NET-1, 2, 3)RFC 5737books and examples only, as on this page
198.18.0.0/15BenchmarkingRFC 2544device testing in labs
224.0.0.0/4Multicast (class D)RFC 5771groups, destination only; 224.0.0.0/24 (224.0.0.5 OSPF, 224.0.0.10 EIGRP) never forwarded
240.0.0.0/4Reserved (class E)RFC 1112not usable on hosts
255.255.255.255/32Limited broadcastRFC 919, RFC 8190every host on this link; routers never forward it

In IPv6, the first hex digits give the type away:

IPv6 blockWhat it isRFCThe rule
::/128 · ::1/128Unspecified · loopbackRFC 4291:: is a source only (DAD, DHCPv6 Solicit); ::1 never leaves the host
::ffff:0:0/96IPv4-mapped IPv6 addressRFC 4291an IPv4 address inside an IPv6 socket; never on the wire
64:ff9b::/96NAT64 well-known prefixRFC 6052IPv4 hosts reached through NAT64/DNS64
2000::/3Global unicast (GUA)RFC 4291starts with 2 or 3; routed on the Internet; /48 site + 16-bit subnet ID + 64-bit interface ID
2001:db8::/32 · 3fff::/20DocumentationRFC 3849, RFC 9637inside 2000::/3, but examples only: never "global" in an exam answer
fc00::/7Unique local (ULA)RFC 4193fd00::/8 in practice, with a random 40-bit Global ID (fd12:3456:789a::/48); routed inside, filtered at the edge
fe80::/10Link-local unicastRFC 4291fe80::/64 in practice, on every IPv6 interface; never routed; next hops and default gateways use it
fec0::/10Site-localRFC 3879deprecated in 2004: never the answer for "private IPv6"
ff00::/8MulticastRFC 4291replaces broadcast; the 4th hex digit is the scope (2 link, 5 site, e global)
ff02::1 · ff02::2All nodes · all routers (link scope)RFC 4291RAs go to ff02::1, RSs to ff02::2; ff02::5/::6 OSPFv3, ff02::a EIGRP
ff02::1:ff00:0/104Solicited-node multicastRFC 4291ff02::1:ff + the last 24 bits: Host A → ff02::1:ffa1:1b01; NS for DAD and address resolution
ff02::1:2All DHCPv6 servers and relay agentsRFC 8415the DHCPv6 Solicit and Information-Request go here

The subnetting method

  1. Turn the prefix into a mask and find the interesting octet, the one that is neither 255 nor 0: 172.16.45.200/20 → 255.255.240.0, the third octet, 240.
  2. Block size = 256 − the interesting octet: 256 − 240 = 16. Networks start every 16 in that octet: .0, .16, .32, .48…
  3. Network: round the address's interesting octet down to a multiple of the block and set the octets to its right to 0: 45 → 32, so 172.16.32.0.
  4. Broadcast: the next network minus one, the octets to the right at 255: 172.16.48.0 − 1 = 172.16.47.255 (not 172.16.45.255).
  5. Hosts: network + 1 to broadcast − 1, and 2h − 2 of them: 172.16.32.1 – 172.16.47.254, 212 − 2 = 4,094.
  6. To cut a block, borrow s bits with 2s ≥ the subnets needed and check that the h bits left give 2h − 2 ≥ the hosts needed: 6 subnets of 30 hosts from 192.168.1.0/24 → /27, eight subnets at .0, .32 … .224.
  7. Check both sides of the requirement: 6 subnets of 31 hosts need 3 + 6 = 9 bits, one more than a /24 has.
  8. Exceptions: /31 on point-to-point links (2 hosts, no broadcast), /32 for one address. When an octet looks ambiguous, write it in binary: the AND with the mask settles it.

VLSM and summarization rules

  1. VLSM: list the needs, sort them largest first, and give each the smallest block with 2h − 2 ≥ hosts (the gateway counts): 100 → /25, 50 → /26, 20 → /27, a router link → /30 or /31.
  2. Allocate each block at the next free address. A block starts on a multiple of its own size, so largest first never leaves a gap: 192.168.10.0/25, .128/26, .192/27, .224/30, free .228 – .255.
  3. A block that does not start on its boundary does not exist: 192.168.10.4/27 is just a host in 192.168.10.0/27. IOS refuses an overlap between its own interfaces, never between two routers.
  4. VLSM needs a classless protocol that carries the mask (OSPF, EIGRP, IS-IS, BGP, RIPv2) and no auto-summary wherever a major network is discontiguous.
  5. Summarize: write the networks in binary and keep the leading bits they all share: 172.16.0.0/24 – 172.16.3.0/24 share 22 bits → 172.16.0.0/22 (255.255.252.0).
  6. 2n networks fit one summary only if the first is a multiple of 2n: 192.168.1.0 + 192.168.2.0 are not a /23, and 172.16.1.0 – 172.16.4.0 are not a /22.
  7. Summarize only space you own. The router installs a discard route to Null0 for its own summary; a too-wide summary attracts another site's traffic the day that site's specific route disappears, and drops it.
  8. Longest match always wins: a summary never overrides a more specific route, which is why over-summarization looks harmless on a normal day.

IPv4 vs IPv6

TopicIPv4IPv6
size and text32 bits, 4 octets in dotted decimal128 bits, 8 hextets in hex; drop leading zeros, one :: per address, lowercase (RFC 5952)
prefixa dotted mask or /n/n only; a dotted mask is refused
LAN sizesized to the hosts with VLSM (/24 – /28)always /64, whatever the number of hosts
router link · loopback/30 or /31 · /32/127 · /128
sitea few public addresses + RFC 1918 insidea /48 or /56 of global space, 65,536 or 256 LANs
private spaceRFC 1918 + NAT/PAT at the edgeULA fd00::/8, routed inside, no NAT needed
link-local169.254.0.0/16, only when DHCP failsfe80::/10 on every interface, always; gateways and routing protocols use it
one-to-allbroadcast: 255.255.255.255 and directed broadcastsno broadcast: multicast ff02::1 and the solicited-node groups
address resolutionARP, a broadcast requestNDP: NS/NA (ICMPv6 135/136) to the solicited-node group
automatic addressingDHCP; APIPA as a fallbackSLAAC from the RA (EUI-64 or random ID), stateless or stateful DHCPv6 by the O and M flags
default gatewaytyped or DHCP option 3always from the RA (the router's link-local), never from DHCPv6
loopback · unspecified · documentation127.0.0.0/8 · 0.0.0.0 · 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24::1 · :: · 2001:db8::/32, 3fff::/20
on IOSroutes by default; C + L /32 per addressneeds ipv6 unicast-routing; C + L /128 per address, LC for a loopback

The Cisco commands

FunctionIOS-XENX-OSIOS-XR
IPv4 addressip address 192.168.10.1 255.255.255.128ip address 192.168.10.1/25ipv4 address 192.168.10.1 255.255.255.128 (or /25)
second subnetip address 10.1.10.1 255.255.255.0 secondaryip address 10.1.20.1/24 secondaryipv4 address 10.1.10.1 255.255.255.0 secondary
routed port · SVIno switchport · ip routing, interface Vlan20no switchport · feature interface-vlaninterfaces are routed; nothing applies before commit
ACL wildcardaccess-list 10 permit 172.16.32.0 0.0.15.25510 permit ip 172.16.32.0/20 any10 permit ipv4 172.16.32.0 0.0.15.255 any
OSPF on an interfacenetwork 172.16.32.0 0.0.15.255 area 0ip router ospf 1 area 0.0.0.0 on the interfacerouter ospf 1 / area 0 / interface …
OSPF inter-area summaryarea 1 range 172.16.0.0 255.255.252.0area 1 range 172.16.0.0/22area 1 / range 172.16.0.0/22
DHCP relayip helper-address 192.168.10.226feature dhcp, ip dhcp relay address 192.168.10.226dhcp ipv4 / profile RELAY relay / helper-address vrf default 192.168.10.226
NATip nat inside, ip nat outside, ip nat inside source list … overloadfeature nat firstCGN (CGv6), typically on service cards
IPv6 routingipv6 unicast-routingno command neededno command needed
IPv6 addressipv6 address 2001:db8:acad:10::1/64the samethe same
static link-localipv6 address fe80::1 link-localipv6 link-local fe80::1ipv6 address fe80::1 link-local
verifyshow ip interface brief, show ip route connectedshow ip interface brief vrf allshow ipv4 interface brief
verify IPv6show ipv6 interface brief, show ipv6 route, show ipv6 neighbors on all three

And the IOS-XE commands each section adds, by task:

Task on IOS-XECommand§
masks as /n in show outputterminal ip netmask-format bit-count3
subnet zero (default since 12.0)ip subnet-zero5
directed broadcasts off (default since 12.0)no ip directed-broadcast7
DHCP client · unnumbered linkip address dhcp · ip unnumbered Loopback010
stop classful summariesno auto-summary (RIPv2, old EIGRP)2
EIGRP summaryip summary-address eigrp 100 172.16.0.0 255.255.252.0; named mode: summary-address under af-interface9
OSPF external · BGP summarysummary-address 172.20.0.0 255.255.252.0 · aggregate-address 172.16.0.0 255.255.252.0 summary-only9
IPv6 interface ID from the MACipv6 address 2001:db8:acad:20::/64 eui-6414
IPv6 as a hostipv6 address autoconfig · ipv6 address dhcp · ipv6 enable (link-local only)15
RA flagsipv6 nd other-config-flag (O) · ipv6 nd managed-config-flag (M) · ipv6 nd prefix … no-autoconfig (A = 0)14
DHCPv6 server · relayipv6 dhcp server SALES-STATELESS · ipv6 dhcp relay destination 2001:db8:acad:99::54714
IPv6 site aggregateipv6 route 2001:db8:acad::/48 Null013
hardening that exposes wrong masksno ip proxy-arp16

The classic traps

  • 172.16.0.0/12 ends at 172.31.255.255: 172.32.1.1 is public, and 100.64.0.0/10 is shared space, not RFC 1918.
  • Addresses and hosts are different counts: a /26 has 64 addresses but 62 hosts, so 64 hosts need a /25. Subnets are 2s, not 2s − 2.
  • The block counts in the interesting octet only: the broadcast of 172.16.45.200/20 is 172.16.47.255.
  • A mask typed where IOS expects a wildcard is accepted without a warning and matches the wrong addresses.
  • :: appears once; 0010 shortens to 10, never to 1; 2001:db8:: is documentation, fec0:: is deprecated.
  • EUI-64 flips bit 0x02, it does not set it: a MAC starting with 02 gives 00.
  • A second ip address without secondary replaces the first; IPv6 hosts with only fe80:: addresses usually mean ipv6 unicast-routing is missing.
  • A host always decides with its own mask; a wrong mask can work for weeks behind proxy ARP and fail the day no ip proxy-arp is applied.

Where IP addressing appears at each exam

Indicative mapping, based on the public blueprints.

ExamWhat it covers from this pageSections
CCNA 200-301 v1.1the core: IPv4 addressing and subnetting, private ranges, IPv6 addressing, prefixes and types (global, unique local, link-local, anycast, multicast, modified EUI-64), host IP parameters on Windows, macOS and Linux, NAT and DHCP relay1–16
ENCOR 350-401 v1.2assumed knowledge behind OSPF, EIGRP, BGP and NAT/PAT: masks and wildcards, private and special space, summarization, IPv6 format and types for dual-stack designs3–7, 9, 11, 12
ENARSI 300-410troubleshooting: summarization in EIGRP, OSPF and BGP, DHCP relay, DHCPv6 and SLAAC, IPv6 neighbor discovery, wrong masks and overlapping subnets2–5, 7–10, 12–16
SPCOR 350-501 v1.1carrier-grade NAT and 100.64.0.0/10, IPv6 customer prefixes (/48, /56, prefix delegation), NAT64 and the transition prefixes6, 12, 13
CCIE EI v1.1all of it at lab speed: VLSM and summary design inside routing tasks, dual stack with SLAAC and DHCPv6, troubleshooting by symptom2, 4–16

17.QCheck yourself: exam-style questions

CCNACCNA 200-301Q1

A laptop is configured with 172.20.77.130/21. Which statement is correct?

  1. AIt is a private address in 172.20.72.0/21, broadcast 172.20.79.255
  2. BIt is a private address in 172.20.76.0/21, broadcast 172.20.83.255
  3. CIt is a public address in 172.20.72.0/21, broadcast 172.20.79.255
  4. DIt is a private address in 172.20.72.0/21, broadcast 172.20.77.255
Show answer
Answer: A. 172.20 lies inside 172.16.0.0/12 (172.16 to 172.31), so the address is RFC 1918 private. A /21 leaves 3 host bits in the third octet, a block of 8: 77 rounds down to 72, so the subnet is 172.20.72.0/21 and its broadcast is the next block (172.20.80.0) minus one, 172.20.79.255. 172.20.77.255 is the /24 reflex, and 172.20.76.0 is not a multiple of 8, so it cannot start a /21.
CCNACCNA 200-301Q2

Which answer gives the RFC 5952 form of 2001:0DB8:0000:0000:00A0:0000:0000:0001 and its address type?

  1. A2001:db8::a0:0:0:1, a global unicast address routed on the Internet
  2. B2001:db8:0:0:a0::1, a documentation address
  3. C2001:db8::a0::1, a documentation address
  4. D2001:db8::a0:0:0:1, a documentation address
Show answer
Answer: D. There are two runs of two zero hextets; RFC 5952 puts :: on the longest run and, on a tie, on the first one, so 2001:db8::a0:0:0:1 in lowercase. 2001:db8:0:0:a0::1 is valid input but not canonical, and two :: in one address is never valid. 2001:db8::/32 is inside 2000::/3 but reserved for documentation (RFC 3849), so it is never routed on the Internet.
CCNACCNA 200-301Q3

A branch gets 10.1.4.0/24 and needs LANs of 60, 28 and 12 hosts plus one router-to-router link. The engineer allocates largest first, each block at the next free address. Which subnet does the 12-host LAN receive?

  1. A10.1.4.80/28
  2. B10.1.4.128/28
  3. C10.1.4.96/28
  4. D10.1.4.96/29
Show answer
Answer: C. Largest first: 60 hosts need a /26 (62 usable) at 10.1.4.0, 28 hosts a /27 (30 usable) at 10.1.4.64, so the next free address is 10.1.4.96, and 12 hosts need a /28 (14 usable): 10.1.4.96/28, followed by the link at 10.1.4.112/30. A /29 holds only 6 hosts; .80 assumes the 28-host LAN fits a /28 (it needs 30 addresses); .128 assumes the 60-host LAN took a /25.
ProfessionalENARSI 300-410Q4

R1's Gi0/1 is up/up with ip address 192.168.10.129 255.255.255.192, ipv6 address 2001:DB8:ACAD:20::1/64 and ipv6 address FE80::1 link-local. How many entries does Gi0/1 add to the IPv4 and IPv6 routing tables together?

  1. A2: one C route per protocol, since L routes exist only for loopbacks
  2. B6: the link-local FE80::1 adds its own C and L routes as well
  3. C3: C and L for the IPv4 /26, and only a C route for the IPv6 /64
  4. D4: C and L for 192.168.10.128/26, C and L for 2001:DB8:ACAD:20::/64
Show answer
Answer: D. Each global address adds a C route for its subnet and an L route for the address itself: C 192.168.10.128/26 and L 192.168.10.129/32 in IPv4 (IOS 15 and later), C 2001:DB8:ACAD:20::/64 and L 2001:DB8:ACAD:20::1/128 in IPv6 (§10, §15). The link-local FE80::1 adds nothing: IOS does not list per-interface link-local addresses in show ipv6 route. L routes exist for every interface address; only an IPv4 /32 loopback gets its C route alone, and an IPv6 /128 loopback shows as LC.
CCIECCIE EI v1.1Q5

BR1 owns 10.20.0.0/24 to 10.20.5.0/24 and advertises ip summary-address eigrp 100 10.20.0.0 255.255.248.0 to HQ. BR2 owns 10.20.6.0/24, and its WAN link to HQ fails; HQ still has a default route toward its Internet edge. What happens to HQ's traffic for 10.20.6.10, and what is the right fix?

  1. AIt follows HQ's default route toward the Internet edge; no change is needed, because the summary only affects BR1
  2. BHQ drops it because no /24 for 10.20.6.0 is left; advertise 10.20.0.0/20 from BR1 instead
  3. CIt follows the /21 to BR1 and dies in BR1's Null0 route; advertise 10.20.0.0/22 and 10.20.4.0/23 instead
  4. DIt follows the /21 to BR1, which forwards it on its default route to BR2; advertise 10.20.0.0/22 only
Show answer
Answer: C. The /21 covers 10.20.0.0 to 10.20.7.255, so once BR2's /24 is gone it is HQ's longest match for 10.20.6.10 (it beats 0.0.0.0/0). BR1 installed 10.20.0.0/21 to Null0 with its summary, which is also longer than BR1's default route, so the packet is discarded there. Six /24s starting at 10.20.0.0 are exactly a /22 (0 – 3) plus a /23 (4 – 5); a /22 alone would drop two of BR1's own LANs, and a /20 would over-summarize even more.

The full analogy: a city with a land registry

TL;DRA single story that covers everything you saw in sections 1–16, with the correspondence table and the places where the analogy breaks down.

One universe, taken all the way: a city with a land registry. The model holds closely up to §10; from §11 on the city moves to a planet-sized registry, and the comparison stretches (see where it breaks, at the end).

  1. The street and the house number

    Every plot in the city has one long number of 32 binary digits, which people write as four groups (192.168.10.37). The registry reads it in two parts: the street, then the house number. A card attached to every deed says how many digits are the street; since the street always comes first, the card can be written as a single count, /25. When Anna, in house 37, posts a letter, she compares the street part of the address with her own, using her own card: same street, she walks over and knocks; another street, she drops it at the post office on her corner, and the postmen look only at streets, one line per street in their book. Gate clerks (ACLs, OSPF) use a stencil instead, with holes over the digits to compare. When the city was founded, land came in three fixed district sizes, told apart by the first digits: huge (A), medium (B) and small (C), plus a square for public announcements (D) and a fenced-off field (E). A firm of 300 people got a medium district and left 65,000 plots empty, so the city scrapped fixed sizes: every deed now carries its own card. Old maps still group streets under the old district names, and a few old postmen still announce whole districts, which misroutes mail when a district is split in two.

  2. The street sign, the town crier and the surveyor

    On every street the first plot holds the street sign, which gives the street its name in the books, and the last one holds the town crier, who shouts a message to every house on the street. Neither can be a home, so a street of 128 plots has 126 homes. A lane between exactly two houses needs neither (a /31), and a kiosk with one number and no street around it is a street of one (a /32). When a developer needs more streets than he has, the surveyor takes digits from the house number and uses them for the street: every digit he borrows doubles the streets and halves the plots on each, and the streets start every block, so to find a plot's street you round its number down to the last corner.

  3. Room numbers and the reception desk

    Inside office buildings, rooms are numbered from three reserved series, 10, 172.16 to 172.31, and 192.168. The same room numbers exist in thousands of buildings, so no city postman ever delivers to a room. When a letter leaves, the reception desk crosses out the room number in the return address, writes the building's street address, and notes in a ledger which room sent it, with a ticket number, so the reply finds its way back upstairs. A reception that forgets to swap sends out letters signed "room 37", and the city's first sorting counter throws them in the bin. Room 172.32 is not in the reserved series at all: it is a real house somewhere in the city. And when the city runs out of street addresses, the district opens a big reception of its own that swaps a second time, with corridor numbers from the series 100.64.

  4. Numbers that are not homes

    Some numbers are on no map. "My own house" (127): a letter to it never leaves your hands. Tent numbers that people pitch for themselves on the field while the registry office is closed (169.254): neighbours on the same field can find them, but no postman delivers to a tent. "123 Example Street" (192.0.2, 198.51.100 and 203.0.113): printed only in textbooks. "Nobody yet" (0.0.0.0), the return address of a newcomer writing to the registry office for a number. And the shout "everyone on this street!" (255.255.255.255), which never goes round the corner. The newcomer's shout reaches the registry office only because the post office on the corner carries it there as a letter, and the post office no longer lets outsiders hire another street's crier.

  5. Streets of every size and the sorting office

    A developer with one block and four needs, a big shopping street, a medium one, a small one and a lane, has the surveyor cut streets of different sizes. He cuts the biggest first, and each street starts on a corner that is a multiple of its own size, so nothing overlaps and the leftover land stays in one piece. Cutting the lane first would make the next street start mid-block, right across the lane, and the registry refuses that deed. Far away, the regional sorting office reads only the postcode, the leading digits that all four streets share: one line in its book for the whole quarter. The office always prefers a more detailed line when it has one, so a postcode drawn too wide looks harmless, until the neighbouring quarter's own line disappears: then the neighbour's mail goes to this quarter's office, which keeps a shredder for letters to streets that do not exist.

  6. The registry clerk

    Before a post office can serve a street, the clerk registers its counter: the address, the card, and the door opened. The clerk refuses the street-sign plot and the crier's plot, a card with gaps in it, and a street that runs into one the same post office already serves; a second street on the same counter must be marked "secondary", or it replaces the first. Once registered, the post office's book gets two lines, one for the street and one for its own door. Clerks in other cities have their own forms: one writes the card as a count, another stamps nothing until you sign at the bottom.

  7. The planet-sized registry

    Running out of plots, the world builds a new registry the size of a planet. Numbers are 128 digits long, written in hexadecimal in eight groups, with two shorthand rules: drop the zeros at the front of a group, and write one run of empty groups as a double colon, once. Every residential street is the same huge size, 264 plots, whatever lives on it, and nobody saves plots: a company receives a whole district of 65,536 streets, a home 256, and the streets are numbered on whole hex digits so the number itself says building and floor. Every house also has a yard name that is valid only on its own street, private estates use numbers starting with fd and a random estate code, and there are no town criers any more: messages go to mailing lists, one of them for every house-number ending. The old "district-local" numbers were abolished in 2004.

  8. Self-made house numbers, the noticeboard and the inspector

    In the new registry a house usually picks its own number on the street: from the serial number of its front door, split in two with ff:fe in the middle and one digit flipped, or drawn by lot so it cannot be followed from street to street. Before moving in, it calls out "does anyone live at this number?". It learns the street name from the post office's noticeboard, which also says whether to ask the registry office for a number or only for other information, and the post office's yard name becomes its way to the rest of the planet. The post office puts up that noticeboard only once it is licensed as a post office; without the licence, houses know only their yard names. When something goes wrong, the inspector starts at the house: a resident with the wrong card who knocks on doors in other streets, long covered by a post office that answered for the neighbours; a street drawn twice by two surveyors; a street where nobody put up the noticeboard.

The correspondence table

In the analogyIn IP addressing
the plot number, 32 binary digitsthe IPv4 address (32 bits, dotted decimal)
the street partthe network part (prefix)
the house numberthe host part
the card: how many digits are streetthe subnet mask / prefix length /n
the clerk's stencil with holesthe wildcard mask (ACLs, OSPF network statements)
comparing streets with your own cardthe host's AND with its own mask: on-link or off-link
walking over and knockingARP for an on-link destination
the post office on the cornerthe default gateway (192.168.10.1)
one line per street in the postmen's bookthe routing table: one route per network
the three fixed district sizesclasses A, B, C with the default masks /8, /16, /24
the announcements squareclass D multicast (224.0.0.0/4)
the fenced-off fieldclass E reserved (240.0.0.0/4)
every deed carrying its own cardCIDR (RFC 1519, now RFC 4632)
old postmen announcing whole districtsauto-summary at the classful boundary
the street signthe network address (host bits all 0)
the town crierthe broadcast address (host bits all 1)
a lane between two housesa /31 point-to-point link (RFC 3021)
a kiosk with one numbera /32: loopback or host route
digits borrowed from the house numberborrowed (subnet) bits: 2s subnets
the distance between two street cornersthe block size, 256 − the mask octet
room numbers that repeat in every buildingRFC 1918 private addresses
the reception desk that swaps the return addressNAT / PAT on the edge router
the ledger with ticket numbersthe NAT translation table, with ports
letters signed "room 37", binnedbogon filtering and BCP 38 at the ISP
the district reception, corridor numberscarrier-grade NAT and 100.64.0.0/10 (RFC 6598)
"my own house"loopback 127.0.0.0/8
tent numbers while the registry office is closedAPIPA 169.254.0.0/16 (RFC 3927)
"123 Example Street"the documentation ranges (RFC 5737; 2001:db8::/32 in IPv6)
the registry officethe DHCP server
the post office carrying the shoutthe DHCP relay (ip helper-address)
the shout that never goes round the cornerthe limited broadcast 255.255.255.255
hiring another street's criera directed broadcast (dropped by default since IOS 12.0)
streets of different sizes, biggest firstVLSM
the postcodethe summary route (the common leading bits)
the regional sorting officethe router that receives the summary
the more detailed line winslongest-prefix match
the shredderthe discard route to Null0
the clerk refusing a deedIOS checks: Bad mask, % … overlaps with …
two lines: the street, its own doorthe C route and the L /32 route
the planet-sized registryIPv6, 128 bits in hexadecimal
empty groups as a double colonzero compression with ::, once per address
every street the same huge sizea /64 on every LAN
a district of 65,536 streetsa /48 site prefix
the yard namethe link-local address fe80::/10
private estates, random estate codeunique local addresses fd00::/8 (RFC 4193)
mailing lists instead of town criersmulticast (ff02::1, solicited-node groups); no broadcast
the number from the door's serialmodified EUI-64 from the MAC
a number drawn by lotrandom, stable opaque and temporary interface IDs (RFC 7217, RFC 8981)
"does anyone live at this number?"Duplicate Address Detection
the noticeboardthe Router Advertisement (SLAAC, M and O flags)
the post office licenceipv6 unicast-routing
a post office answering for neighboursproxy ARP (RFC 1027)

Where the analogy breaks

  • Addresses belong to interfaces, not to buildings. A router has a different address on each of its doors, one per subnet, and an IPv6 host holds several at once (link-local, global, temporary). A house has one number.
  • The street is not painted on the ground. The mask is each host's own setting, so two hosts on the same wire can disagree about where their street ends: Host B with a /24 inside a /26 LAN knocks on doors that are not on its street, and nothing in the network stops it.
  • Real postcodes follow geography and can have any size. A summary only works on a power-of-two block that starts on its own boundary: 172.16.1.0 to 172.16.4.0 cannot share one postcode, whatever the map says.
  • No real registry would give three houses a street of 18 billion billion plots, or accept a house that renames itself every day. In IPv6 both are normal: the /64 is about how SLAAC works, not about need, and temporary addresses change on purpose.

18.QCheck yourself: exam-style questions

CCNACCNA 200-301Q1

In the city analogy, the first plot of every street holds the street sign and the last one holds the town crier. Which two addresses of the Sales LAN, 192.168.10.0/25, do they stand for?

  1. A192.168.10.1, the network address, and 192.168.10.128, the broadcast
  2. B192.168.10.1, the gateway, and 192.168.10.126, the last usable host
  3. C192.168.10.0, the network address, and 192.168.10.255, the broadcast
  4. D192.168.10.0, the network address, and 192.168.10.127, the broadcast
Show answer
Answer: D. The street sign is the address with all host bits 0, the name the routing table uses: 192.168.10.0. The town crier is the address with all host bits 1, which reaches every host of the subnet: for a /25 (block of 128) that is 192.168.10.127. 192.168.10.255 is the broadcast of the whole /24, and .1 and .126 are ordinary homes, the first and last usable hosts.
CCNACCNA 200-301Q2

In the analogy, an office building's reception desk replaces a room number in the return address with the building's street address and notes a ticket number in a ledger. What do the room number, the street address and the ledger stand for?

  1. AThe inside local private address, the inside global address and the PAT translation table
  2. BA public address, an RFC 1918 address and the DHCP binding table
  3. CThe inside global address, the inside local address and the ARP cache
  4. DA 169.254 link-local address, the default gateway and the routing table
Show answer
Answer: A. Room numbers repeat in every building, like RFC 1918 addresses, so they are the inside local addresses (192.168.10.37). The building's street address is the public inside global address (198.51.100.2), and the ledger with ticket numbers is the NAT table, where PAT tells the hosts apart by port. Swapping local and global reverses which side of the router each address lives on.
CCNACCNA 200-301Q3

In the planet-sized registry, every house has a yard name that is valid only on its own street, and the post office puts up its noticeboard only once it is licensed. Which pair matches these two ideas?

  1. ASolicited-node ff02::1:ff00:0/104 groups, and Router Advertisements sent after ipv6 enable
  2. BLink-local fe80::/10 addresses, and DHCPv6 Advertise messages sent only when the M flag is set
  3. CUnique local fd00::/8 addresses, and DHCPv6 replies sent only with ipv6 dhcp server
  4. DLink-local fe80::/10 addresses, and Router Advertisements sent only with ipv6 unicast-routing
Show answer
Answer: D. Every IPv6 interface has a link-local address that is valid only on its link, the yard name; routers use theirs as the hosts' default gateway. The noticeboard is the RA, which gives hosts the prefix for SLAAC, and IOS sends it only once ipv6 unicast-routing is configured. A ULA is routed across the whole site, not one street, and ipv6 enable alone gives the router a link-local address but no RAs.