Build a multi-site addressing plan and advertise one summary per site
Cisco IOSWorking
Tasks
- Check that each branch's subnets fall inside its /20 and that no two branches overlap.
- Address the WAN links as /31s and the loopbacks as /32s from the infrastructure block.
- On each branch router, create one subinterface per VLAN with the gateway address.
- Run OSPF with the WAN links and loopbacks in area 0 and each branch LAN in its own area. LAN interfaces are passive.
- On each ABR, summarize the branch area into one /20.
- Confirm R1 sees exactly one route per branch, and that the ABR holds a discard route for its summary.
Solution
1Hub router R1R1
R1 on Cisco IOS interface Loopback0 ip address 10.0.0.1 255.255.255.255 ! interface GigabitEthernet0/0/0 description WAN to BR1 ip address 10.0.1.0 255.255.255.254 ip ospf network point-to-point no shutdown ! interface GigabitEthernet0/0/1 description WAN to BR2 ip address 10.0.1.2 255.255.255.254 ip ospf network point-to-point no shutdown ! router ospf 1 router-id 10.0.0.1 network 10.0.0.1 0.0.0.0 area 0 network 10.0.1.0 0.0.0.255 area 0Some IOS-XE releases print a warning when you put a /31 on an Ethernet interface. It works on a point-to-point link. Setting the OSPF network type to point-to-point skips the DR election on a link that only ever has two routers.
2Branch 1 interfacesBR1
BR1 on Cisco IOS interface Loopback0 ip address 10.0.0.11 255.255.255.255 ! interface GigabitEthernet0/0/0 description WAN to R1 ip address 10.0.1.1 255.255.255.254 ip ospf network point-to-point no shutdown ! interface GigabitEthernet0/0/1 description Trunk to SW1 no shutdown interface GigabitEthernet0/0/1.10 encapsulation dot1Q 10 ip address 10.16.0.1 255.255.255.0 interface GigabitEthernet0/0/1.20 encapsulation dot1Q 20 ip address 10.16.1.1 255.255.255.0 interface GigabitEthernet0/0/1.30 encapsulation dot1Q 30 ip address 10.16.2.1 255.255.254.0 interface GigabitEthernet0/0/1.99 encapsulation dot1Q 99 ip address 10.16.14.1 255.255.255.03Branch 1 OSPF with the area range summaryBR1
BR1 on Cisco IOS router ospf 1 router-id 10.0.0.11 passive-interface default no passive-interface GigabitEthernet0/0/0 network 10.0.0.11 0.0.0.0 area 0 network 10.0.1.0 0.0.0.1 area 0 network 10.16.0.0 0.0.15.255 area 1 area 1 range 10.16.0.0 255.255.240.0One
networkstatement with wildcard0.0.15.255puts every current and future branch 1 subnet into area 1.area 1 rangemakes BR1 send one type 3 LSA for10.16.0.0/20into area 0 instead of one per subnet, and IOS installs a matching discard route to Null0 on BR1.4Branch 2 interfacesBR2
BR2 on Cisco IOS interface Loopback0 ip address 10.0.0.12 255.255.255.255 ! interface GigabitEthernet0/0/0 description WAN to R1 ip address 10.0.1.3 255.255.255.254 ip ospf network point-to-point no shutdown ! interface GigabitEthernet0/0/1 description Trunk to SW2 no shutdown interface GigabitEthernet0/0/1.10 encapsulation dot1Q 10 ip address 10.16.16.1 255.255.255.0 interface GigabitEthernet0/0/1.20 encapsulation dot1Q 20 ip address 10.16.17.1 255.255.255.0 interface GigabitEthernet0/0/1.30 encapsulation dot1Q 30 ip address 10.16.18.1 255.255.254.0 interface GigabitEthernet0/0/1.99 encapsulation dot1Q 99 ip address 10.16.30.1 255.255.255.05Branch 2 OSPF with the area range summaryBR2
BR2 on Cisco IOS router ospf 1 router-id 10.0.0.12 passive-interface default no passive-interface GigabitEthernet0/0/0 network 10.0.0.12 0.0.0.0 area 0 network 10.0.1.2 0.0.0.1 area 0 network 10.16.16.0 0.0.15.255 area 2 area 2 range 10.16.16.0 255.255.240.0
Verify
R1# show ip route ospf | begin Gateway
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
O 10.0.0.11/32 [110/2] via 10.0.1.1, 00:12:04, GigabitEthernet0/0/0
O 10.0.0.12/32 [110/2] via 10.0.1.3, 00:11:58, GigabitEthernet0/0/1
O IA 10.16.0.0/20 [110/2] via 10.0.1.1, 00:06:40, GigabitEthernet0/0/0
O IA 10.16.16.0/20 [110/2] via 10.0.1.3, 00:06:12, GigabitEthernet0/0/1One inter-area (O IA) route per branch and none of the /24s or /23s. The 9 subnets are the 4 OSPF
routes, the loopback, and the two /31 links with their /32 local routes.
BR1# show ip route ospf | begin Gateway
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 15 subnets, 5 masks
O 10.0.0.1/32 [110/2] via 10.0.1.0, 00:12:04, GigabitEthernet0/0/0
O 10.0.0.12/32 [110/3] via 10.0.1.0, 00:11:58, GigabitEthernet0/0/0
O 10.16.0.0/20 is a summary, 00:06:40, Null0
O IA 10.16.16.0/20 [110/3] via 10.0.1.0, 00:06:12, GigabitEthernet0/0/010.16.0.0/20 is a summary ... Null0 is the discard route. A packet for an unused address such as
10.16.9.9 matches it and is dropped here, instead of following a default route back to the hub and
looping. Branch 2 also arrives as one /20.
R1# show ip route 10.16.2.50
Routing entry for 10.16.0.0/20
Known via "ospf 1", distance 110, metric 2, type inter area
Last update from 10.0.1.1 on GigabitEthernet0/0/0, 00:06:40 ago
Routing Descriptor Blocks:
* 10.0.1.1, from 10.0.0.11, 00:06:40 ago, via GigabitEthernet0/0/0
Route metric is 2, traffic share count is 1A Wi-Fi client address at branch 1 matches the /20 summary, learned from router ID 10.0.0.11 (BR1).
Metric 2 is the WAN link (cost 1) plus the summary cost (1).
Mistakes people make
- A subnet outside the branch block, for example a printer VLAN numbered
10.16.40.0/24at branch 1. It falls in branch 3's /20, so it either leaks as its own route or is hidden behind the wrong summary. - Summarizing on the wrong router.
area rangeonly works on the ABR that has interfaces in that area. On an internal router it does nothing. - Using
summary-addressfor internal routes. That command is for external (redistributed) routes on an ASBR. Inter-area summaries usearea range. - Forgetting the discard route on platforms or protocols that do not add one, which lets traffic for unused addresses loop toward a default route.
- Sizing the per-site block for today. A branch that outgrows its /20 needs a second, non-contiguous block and a second route.
On other platforms
The ABR summary on Junos is area-range under the area.
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 interface-type p2p
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.1 interface ge-0/0/1.10 passive
set protocols ospf area 0.0.0.1 interface ge-0/0/1.20 passive
set protocols ospf area 0.0.0.1 area-range 10.16.0.0/20The same one-route-per-branch result with EIGRP in classic mode, configured on the WAN interface toward the hub.
interface GigabitEthernet0/0/0
ip summary-address eigrp 100 10.16.0.0 255.255.240.0Say it in the interview
"I give every site one block that summarizes, here a /20 per branch out of 10.16.0.0/16, and the same VLAN
layout inside each block. The branch router is the ABR, so area 1 range 10.16.0.0 255.255.240.0 turns all
the branch subnets into one type 3 LSA, and IOS adds a Null0 discard route so unused addresses do not loop.
The hub then has one route per branch, and a flapping branch subnet never leaves its area."