Cisco Summarization and Default Routes Tutorial

In this Cisco CCNA training tutorial, you’ll learn about route summarization and the default route. Scroll down for the video and text tutorial.

Cisco Summarization and Default Routes Tutorial

YouTube video

 

John Salmon

John Salmon

I kept hearing how getting your CCNA would change your life. Well it’s true.

I “Crushed” the CCNA exam and went from working as a mail courier to getting my first tech job as a network lab engineer working for Cisco.

Neil’s courses were a critical factor in this. The way he structured the course and provided labs for each section really made it easier to absorb the information. I still go back and watch sections when I am setting up a new lab at work.

Thank you so much for the awesome video courses.

John Salmon

Static Routes

On the router R1, we don't need to enter routes for its directly connected networks. They were automatically put into the routing table when we configured our IP addresses.

 

Cisco Summarization and Default Routes Tutorial

However, we need to configure routes for the networks that the router is not directly attached to. We've got separate routes to the 10.1.2.0/24, 10.1.1.0/24, and 10.1.0.0/24 networks which are all available behind R2, but it is actually possible to summarise those three routes into a single route.

Summary Routes

For static routing, summary routes lessen the administrative overhead.

  • Fewer routes to configure
  • Less workload

 

It also lessens the memory usage on the routers.

  • Fewer routes in the routing table
  • Less memory

 

In our example, we're going down from three routes to one route. It isn't much of a difference but in large environments, it can make a big difference.

 

We can have a summary route on R1 instead of the traditional way of having separate routes for the 10.1.0.0/24, 10.1.1.0/24, and the 10.1.2.0/24 networks, which are all pointing to the same next hop, 10.0.0.2.

 

When our subnets are in contiguous ranges like this, it's usually possible to summarise them. Rather than having separate routes for 10.1.0.0, 10.1.1.0, and 10.1.2.0, which are all with a /24 subnet mask, I've configured one route for 10.1.0.0 with a subnet mask of 255.255.0.0.

 

This route will be good for all subnets that begin with 10.1, such as 10.1.0.0, 10.1.1.0, 10.1.2.0, and so on. They are all reachable through 10.0.0.2. So that's how we configure summarization.

 

In our example, I summarised the routes using the classful boundary for a class B address. It covers routes all the way from 10.1.0.0 to 10.1.255.255, which is a pretty big range.

 

Maybe we don't want to have all of those subnets available behind R2, maybe some of them are within the 10.1.0.0 range but are available through a different path. You can be a bit tighter with your summarization like in the example below.

 

Rather than saying:

ip route 10.1.0.0 255.255.0.0 10.0.0.2

Here I've said:

ip route 10.1.0.0 255.255.252.0 10.0.0.2

If you remember the subnetting topic, I know that the subnet mask would definitely begin with 255.255 because all of the subnets I'm pointing begins with 10.1. It is on the next octet that I am going to be summarising.

 

Here, I just want to summarise 10.1.0.0 to 10.1.3.0 so, I've used the subnet mask value of 255.255.252.0. You know the way that the subnetting goes up from 252 to 254, and then to 255. That means that I've used two bits there.

 

The two bits give us four possible values, 10.1.0.0/22, 10.1.1.0/22, 10.1.2.0/22, and 10.1.3.0/22. So that's how we configure our summary routes.

Longest Prefix Match

The longest prefix match can come up particularly when you have summary routes. The example below has the same topology with our previous example but with an additional router, R5.

 

The link from R1 to R5 is on the 10.0.3.0/24 network and it is directly connected. There is also a subnet of 10.1.3.0/24 which is running from R4 to R5.

 

If I just left it with the route of:

ip route 10.1.0.0 255.255.0.0 10.0.0.2

The path the traffic would take to get to R5 at 10.1.3.2 (or anything on the 10.1.3.0 network) would be from R1 to R2, to R3, to R4, and then to R5 because the route is pointing at 10.0.0.2 on R2.

 

Now, I want the traffic for all of the 10.1.0.0 network, like 10.1.0.0, 10.1.1.0, and so on, to go via R2. But if I'm sending traffic to the 10.1.3.0 subnet, I don't want it to go along the top path. I want it to go along the bottom path via R5 because that's a more direct route.

 

So I'm going to add a route for that as well, which is:

ip route 10.1.3.0 255.255.255.0 10.0.3.2

If I send traffic to 10.1.1.0, it matches one of these routes, which is the top one. Obviously, it doesn't match 10.1.3.0, so it will take the top route and it will go via R2 at 10.0.0.2.

 

If I send traffic to 10.1.3.0, it matches the top route, and it also matches the bottom route. Both of these routes are in the routing table. So, which route is the router going to take? It would take the one with the longest prefix.

  • First route prefix: 255.255.0.0
  • Second route prefix: 255.255.255.0

The router would take the second route which has the longest prefix.

 

Therefore, all traffic for the 10.1.0.0 networks will go via R2 unless it's for 10.1.3.0, which will go via R5, which is exactly what I want to happen.

 

A more intuitive way of thinking about the longest prefix match is, whichever the most specific route is going to win.

Load Balancing

So that what happens when you have overlapping routes. But what if you've got multiple routes for the exact same destination? Meaning, it has the same destination IP address and the same prefix as well?

 

In that case, the router will load balance the traffic over those routes. See the example below. On R1, we have a couple of routes and they're both going to the exact same destination.

 

 

They're both for 10.1.0.0, and both have the subnet mask of 255.255.0.0. One route has the next hop of 10.0.0.2 and the other route has the next hop of 10.0.3.2.

 

In this case, they're both exactly the same, then the router will load balance traffic over the two different next hops.

Default Route (Gateway of Last Resort)

The default gateway that shows up when you do a show ip route command is the gateway of last resort. In the topology below, we added a route going out to the internet. R1 is connected to the internet and we're using a public IP address there.

 

The IP address on the R1 side is 203.0.113.1 and on the internet side, at our service provider, it is 203.0.113.2. To add a route going out to everywhere else that we haven't specifically had a route for, we use the full command:

ip route 0.0.0.0 0.0.0.0 203.0.113.2

The next hop is the address going to our service provider. Technically, a default route is a catch-all for any traffic that does not match one of our more specific routes.

 

In our example, if we sent traffic to the 10.1.1.0 network, it will match the top route going to 10.1.0.0 and it will also match to the bottom route going to 0.0.0.0, which is everything. The top route is more specific so the traffic will be sent to R2 at 10.0.0.2.

 

If we send traffic to the 10.1.3.0 network, that will match all three routes but it will take the middle route which is the most specific, therefore, the traffic will be sent to R5 at 10.0.3.2.

 

If we send traffic out to the internet at 50.50.50.50, it doesn't match any of the first two routes. It only matches the last route, therefore, it will be sent out to the internet.

 

That was the default route and summarization.

Summarization and Default Routes Configuration Example

This configuration example is taken from my free ‘Cisco CCNA Lab Guide’ which includes over 350 pages of lab exercises and full instructions to set up the lab for free on your laptop.

 

Click here to download your free Cisco CCNA Lab Guide.

 

YouTube video

 

YouTube video

 

 

Summary Routes 

  1. Remove all the static routes on R1

R1(config)#no ip route 10.1.0.0 255.255.255.0 10.0.0.2

R1(config)#no ip route 10.1.1.0 255.255.255.0 10.0.0.2

R1(config)#no ip route 10.1.2.0 255.255.255.0 10.0.0.2

R1(config)#no ip route 10.1.3.0 255.255.255.0 10.0.0.2

 

2. Verify that PC1 loses connectivity to PC3

C:\>ping 10.1.2.10

Pinging 10.1.2.10 with 32 bytes of data:

Reply from 10.0.1.1: Destination host unreachable.

Reply from 10.0.1.1: Destination host unreachable.

Reply from 10.0.1.1: Destination host unreachable.

Reply from 10.0.1.1: Destination host unreachable.

Ping statistics for 10.1.2.10:

Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)

 

3. Restore connectivity to all subnets with a single command on R1.

A summary route to 10.1.0.0/16 will add all remote subnets with one command.

R1(config)#ip route 10.1.0.0 255.255.0.0 10.0.0.2

 

4. Verify the routing table on R1 does not contain /24 routes to remote subnets.

R1#sh ip route

Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP

+ - replicated route, % - next hop override

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 7 subnets, 3 masks

C 10.0.0.0/24 is directly connected, FastEthernet0/0

L 10.0.0.1/32 is directly connected, FastEthernet0/0

C 10.0.1.0/24 is directly connected, FastEthernet0/1

L 10.0.1.1/32 is directly connected, FastEthernet0/1

C 10.0.2.0/24 is directly connected, FastEthernet1/0

L 10.0.2.1/32 is directly connected, FastEthernet1/0

S 10.1.0.0/16 [1/0] via 10.0.0.2

 

5. Ensure that connectivity is restored between PC1 and PC3.

C:\>ping 10.1.2.10

Pinging 10.1.2.10 with 32 bytes of data:

Reply from 10.1.2.10: bytes=32 time<1ms TTL=124

Reply from 10.1.2.10: bytes=32 time<1ms TTL=124

Reply from 10.1.2.10: bytes=32 time<1ms TTL=124

Reply from 10.1.2.10: bytes=32 time<1ms TTL=124

Ping statistics for 10.1.2.10:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 0ms, Average = 0ms

 

Longest Prefix Match

  1. Configure IP addresses on R5 according to the Lab Topology diagram

R5(config)#int f0/0

R5(config-if)#ip add 10.1.3.2 255.255.255.0

R5(config-if)#no shut

R5(config-if)#int f0/1

R5(config-if)#ip add 10.0.3.2 255.255.255.0

R5(config-if)#no shut

 

2. Do not add any additional routes. Does PC1 have reachability to the FastEthernet 0/0 interface on R5? If so, which path will the traffic take?

The summary route on R1 to 10.1.0.0/16 will provide a route to R5 over the path R1 > R2 > R3 > R4 > R5, but R5 does not have a route back to PC1.

A ping from PC1 to 10.1.3.2 on R5 will fail.

C:\>ping 10.1.3.2

Pinging 10.1.3.2 with 32 bytes of data:

Request timed out.

Request timed out.

Request timed out.

Request timed out.

Ping statistics for 10.1.3.2:

Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)

 

Traceroute will show replies from R1 > R2 > R3 > R4 before failing. (You can hit Ctrl-C on the keyboard to break out of the command.)

C:\>tracert 10.1.3.2

Tracing route to 10.1.3.2 over a maximum of 30 hops:

1 0 ms 0 ms 1 ms 10.0.1.1

2 0 ms 0 ms 0 ms 10.0.0.2

3 1 ms 0 ms 0 ms 10.1.0.1

4 0 ms 2 ms 0 ms 10.1.1.1

5 * * * Request timed out.

6 *

Control-C

^C

 

3. Ensure reachability over the shortest possible path from R5 to all directly connected networks on R1. Achieve this with a single command.

Add a summary route on R5 for all the directly connected networks on R1.

R5(config)#ip route 10.0.0.0 255.255.0.0 10.0.3.1

 

4. Verify the path traffic takes from PC1 to the FastEthernet 0/0 interface on R5.

C:\>tracert 10.1.3.2

Tracing route to 10.1.3.2 over a maximum of 30 hops:

1 0 ms 0 ms 0 ms 10.0.1.1

2 0 ms 0 ms 0 ms 10.0.0.2

3 0 ms 0 ms 0 ms 10.1.0.1

4 0 ms 0 ms 1 ms 10.1.1.1

5 * 0 ms 1 ms 10.1.3.2

Trace complete.

Traffic takes the path R1 > R2 > R3 > R4 > R5

 

Verify the path the return traffic takes from R5 to PC1.

R5#traceroute 10.0.1.10

Type escape sequence to abort.

Tracing the route to 10.0.1.10

1 10.0.3.1 2 msec 0 msec 0 msec

2 10.0.1.10 1 msec 0 msec 1 msec

 

Traffic takes the path R5 > R1. This shows that routers make independent decisions based on their routing table and it is possible (though not common) for return traffic to take an asynchronous path.

 

5. Ensure that traffic between PC1 and the FastEthernet 0/0 interface on R5 takes the most direct path in both directions.

A route from R1 to the 10.1.3.0/24 network on R5 will achieve this.

R1(config)#ip route 10.1.3.0 255.255.255.0 10.0.3.2

 

Traffic to 10.1.3.0/24 will now match two routes in the routing table.

S 10.1.0.0/16 [1/0] via 10.0.0.2

S 10.1.3.0/24 [1/0] via 10.0.3.2

 

The new route has a longer prefix match so it will be preferred.

 

6. Verify that traffic between PC1 and the FastEthernet 0/0 interface on R5 takes the most direct path in both directions.

On PC1:

C:\>ping 10.1.3.2

Pinging 10.1.3.2 with 32 bytes of data:

Reply from 10.1.3.2: bytes=32 time=10ms TTL=254

Reply from 10.1.3.2: bytes=32 time=1ms TTL=254

Reply from 10.1.3.2: bytes=32 time<1ms TTL=254

Reply from 10.1.3.2: bytes=32 time<1ms TTL=254

Ping statistics for 10.1.3.2:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 10ms, Average = 2ms

C:\>tracert 10.1.3.2

Tracing route to 10.1.3.2 over a maximum of 30 hops:

1 2 ms 0 ms 0 ms 10.0.1.1

2 0 ms 0 ms 0 ms 10.1.3.2

Trace complete.

 

On R5:

R5#traceroute 10.0.1.10

Type escape sequence to abort.

Tracing the route to 10.0.1.10

1 10.0.3.1 0 msec 1 msec 0 msec

2 10.0.1.10 0 msec 0 msec 0 msec

 

Default Route and Load Balancing

  1. Configure an IP address on the Internet FastEthernet 1/1 interface on R4 according to the lab topology diagram.

R4(config)#int f1/1

R4(config-if)#ip add 203.0.113.1 255.255.255.0

R4(config-if)#no shut

 

2. Ensure that all PCs have a route out to the internet through the Internet Service Provider connection on R4. (Note that the lab does not actually have Internet connectivity.)

R1(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.2

R2(config)#ip route 0.0.0.0 0.0.0.0 10.1.0.1

R3(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.1

R4(config)#ip route 0.0.0.0 0.0.0.0 203.0.113.2

R5(config)#ip route 0.0.0.0 0.0.0.0 10.1.3.1

 

All routers should have a default route to the next hop IP on the path to the Internet.

R4#sh ip route

Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP

+ - replicated route, % - next hop override

Gateway of last resort is 203.0.113.2 to network 0.0.0.0

10.0.0.0/24 is subnetted, 8 subnets

S 10.0.0.0 [1/0] via 10.1.1.2

S 10.0.1.0 [1/0] via 10.1.1.2

S 10.0.2.0 [1/0] via 10.1.1.2

S 10.0.3.0 [1/0] via 10.1.1.2

S 10.1.0.0 [1/0] via 10.1.1.2

C 10.1.1.0 is directly connected, FastEthernet0/0

C 10.1.2.0 is directly connected, FastEthernet0/1

C 10.1.3.0 is directly connected, FastEthernet1/0

C 203.0.113.0/24 is directly connected, FastEthernet1/1

S* 0.0.0.0/0 [1/0] via 203.0.113.2

 

3. Traffic from PC1 and PC2 going to the internet should be load-balanced over R2 and R5.

Add an additional default route on R1 to send Internet traffic via R5.

R1(config)#ip route 0.0.0.0 0.0.0.0 10.0.3.2

The routing table will show that R1 will load balance traffic over both paths.

R1#sh ip route

Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP

+ - replicated route, % - next hop override

Gateway of last resort is 10.0.0.2 to network 0.0.0.0

10.0.0.0/8 is variably subnetted, 10 subnets, 3 masks

C 10.0.0.0/24 is directly connected, FastEthernet0/0

L 10.0.0.1/32 is directly connected, FastEthernet0/0

C 10.0.1.0/24 is directly connected, FastEthernet0/1

L 10.0.1.1/32 is directly connected, FastEthernet0/1

C 10.0.2.0/24 is directly connected, FastEthernet1/0

L 10.0.2.1/32 is directly connected, FastEthernet1/0

C 10.0.3.0/24 is directly connected, FastEthernet1/1

L 10.0.3.1/32 is directly connected, FastEthernet1/1

S 10.1.0.0/16 [1/0] via 10.0.0.2

S 10.1.3.0/24 [1/0] via 10.0.3.2

S* 0.0.0.0/0 [1/0] via 10.0.0.2

[1/0] via 10.0.3.2

 

Add additional routes on R4 to load balance the return traffic to PC1 and PC2 from the Internet.

R4(config)#ip route 10.0.1.0 255.255.255.0 10.1.3.2

R4(config)#ip route 10.0.2.0 255.255.255.0 10.1.3.2

 

R4’s routing table should show both paths back to 10.0.1.0/24 and 10.0.2.0/24

R4#sh ip route

Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP

+ - replicated route, % - next hop override

Gateway of last resort is 203.0.113.2 to network 0.0.0.0

10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks

S 10.0.0.0/24 [1/0] via 10.1.1.2

S 10.0.1.0/24 [1/0] via 10.1.3.2

[1/0] via 10.1.1.2

S 10.0.2.0/24 [1/0] via 10.1.3.2

[1/0] via 10.1.1.2

S 10.0.3.0/24 [1/0] via 10.1.1.2

S 10.1.0.0/24 [1/0] via 10.1.1.2

C 10.1.1.0/24 is directly connected, FastEthernet0/0

L 10.1.1.1/32 is directly connected, FastEthernet0/0

C 10.1.2.0/24 is directly connected, FastEthernet0/1

L 10.1.2.1/32 is directly connected, FastEthernet0/1

C 10.1.3.0/24 is directly connected, FastEthernet1/0

L 10.1.3.1/32 is directly connected, FastEthernet1/0

203.0.113.0/24 is variably subnetted, 2 subnets, 2 masks

C 203.0.113.0/24 is directly connected, FastEthernet1/1

L 203.0.113.1/32 is directly connected, FastEthernet1/1

S* 0.0.0.0/0 [1/0] via 203.0.113.2

Additional Resources

Configuring a Gateway of Last Resort Using IP Commands: https://www.cisco.com/c/en/us/support/docs/ip/routing-information-protocol-rip/16448-default.html

IGP route redistribution, route summarization and default routing: https://searchnetworking.techtarget.com/feature/IGP-route-redistribution-route-summarization-and-default-routing

Longest Prefix Matching in Routers: https://www.geeksforgeeks.org/longest-prefix-matching-in-routers/

 

Want to practice Cisco CCNA technologies on your laptop? Download my complete 350-page Cisco CCNA Lab Guide for free.

 

Click Here to get my Cisco CCNA Gold Bootcamp, the highest rated CCNA course online with a 4.8 star rating from over 20,000 public reviews.

 

Libby Teofilo

Text by Libby Teofilo, Technical Writer at www.flackbox.com

With a mission to spread network awareness through writing, Libby consistently immerses herself into the unrelenting process of knowledge acquisition and dissemination. If not engrossed in technology, you might see her with a book in one hand and a coffee in the other.