Dynamic Routing Protocols vs Static Routes Tutorial

In this Cisco CCNA training tutorial, you’ll learn about the basics of dynamic routing protocols and how they compare to using static routes. Scroll down for the video and also text tutorials.

 

Dynamic Routing Protocols vs Static Routes Video Tutorial

YouTube video

 

Todd Howe

Todd Howe

Hi Neil, I took your course and ended up passing the exam on my first try! I wanted to say thank you for your course. Prior to this I had little to no networking knowledge. The way you explained the processes really helped me retain and learn the information. Great job!

Todd Howe

 

Dynamic Routing Protocols

 

When a routing protocol is used, routers automatically advertise their best paths to known networks to each other. The routers then use this information to determine their own best path to the known destinations.

 

When the state of the network changes, such as a link going down or when a new subnet is being added, the routers would update each other. The routers would automatically recalculate a new best path and update the routing table whenever there are network changes.

 

Dynamic Routing Protocols

 

In the example below, I've got three routers: R1, R2, and R3. To the right of R1, I've got the 10.0.1/24 and the 10.0.2/24 networks. R2 and R3 are not directly connected to those networks, so they're going to need a way to find out about them.

 

Dynamic Routing Protocols 1

 

We could use traditional static routing, which would require an administrator to configure static routes everywhere, or we can have them learn it automatically through the use of dynamic routing protocols.

 

What we'll do is configure the routing protocol in all of the routers; R1, R2, and R3, and they will be able to share information about their networks with each other.

 

R1 and R2 will form a peering relationship with each other, while R2 and R3 will form an adjacency. R1 advertises its routes to R2, allowing R2 to reach the 10.0.1.0/24 and 10.0.2.0/24 networks through R1.

 

That information will come in on the fast ethernet 0/0 interface on R2 and it will see that it came from R1 on the IP address of 10.0.0.1/24. It will then use that information to update its routing table. The routing table will now show that R2 is directly connected to the 10.0.0./24 network on fast ethernet 0/0.

 

Dynamic Routing Protocols 2

 

It's also directly connected to 10.1.0.0/24 on fast ethernet 1/0, and it will also show the two routes that it learned about from R1, the 10.0.1.0 and 10.0.2.0/24 networks.

 

Both of the newly learned routes have the next hop of 10.0.0.1, which is on R1, and are reachable via the fast ethernet 0/0 interface. R2 and R3 have an adjacent relationship, therefore information will be advertised between them as well. R3 can get to the 10.0.0.0/24, 10.0.1.0/24, and 10.0.2.0/24 networks via R2.

 

Dynamic Routing Protocols 3

 

R2 doesn't only advertise the routes it is directly connected to, but it also advertises the routes that it learned from R1. R3 updates its routing table and it shows the routes to 10.1.1.0/24 and 10.1.0.0/24 which are directly connected on fast ethernet 0/0 and 1/0 respectively.

 

It also shows the newly learned routes to 10.0.0.0/24, 10.0.1.0/24, and 10.0.2.0/24 networks. They're all reachable through fast ethernet 1/0 with 10.1.0.2. as their next hop address which is on R2.

 

Dynamic Routing Protocols 4

 

Similar to static routes, R3 does not see R1 as the next hop because it's not directly connected to it. The next hop is always going to be reachable via a directly connected interface, such as R2 in this example.

 

That’s how our routes got propagated from right to left, from R1 to R2 and then to R3. Obviously, the same thing is going to happen in the opposite direction where R3 is going to advertise routes to R2, which will then advertise it to R1.

 

So with this setup, all the routes will be advertised everywhere and the routers will update their routing tables with that information.

 

Summary Routes

 

Just like what we could do with static routes, we can also use summary routes with our dynamic routing protocols as well.

 

Using the same example, R2 is going to learn about the 10.0.1.0/24 and the 10.0.2.0/24 networks. But rather than advertising the 10.0.0.1/24 and 10.0.2.0/24 networks to R3, we can have this configured so it will send a summary route to R3, thus advertising 10.0.0.0.0/16 instead.

 

Summary Routes

 

Reasons for using Summary Routes:

  • Summary routes lead to less memory usage in routers as their routing tables contain less routes. In our example, it wouldn't make much difference, but this can make a big difference in large networks.

 

  • It leads to less CPU usage as changes in the network only affect other routers in the same area. To explain this, let's say that the 10.0.1.1 link on R1 goes down. When that happens, R2 will be notified that the link has gone down.

 

Routers that have a route to 10.0.1.1 will reconverge and will recalculate the routing table, then, finding an alternate path that takes up CPU cycles on the router. R3 has a route to the 10.0.0.0/16 network only. Therefore, its routing table doesn't change and it doesn't need to recalculate anything.

 

  • Through summarization, R3 will be using less memory. It has less routes and because we've compartmentalized our network, changes are only going to affect that specific part of the network. They're not going to be propagated anywhere on the network, thus, utilizing less CPU cycles on our other routers.

 

Summary Routes 1

 

Dynamic Routing Protocols vs Static Routes

 

Routing protocols are more scalable than administrator defined static routes. Moreover, using purely static routes is only feasible in very small environments.

 

Dynamic Routing Protocols vs Static Routes

Dynamic Routing Protocol Advantages

 

The reasons for using Dynamic Routing Protocols are the following:

  • The routers automatically advertise available subnets to each other without the administrator having to manually enter every route on every router. With static routing, the administrator has to manually enter routes which is very tedious and time-consuming.

 

  • If a subnet is added or removed, the routers will automatically discover that change and they will update their routing tables.

 

  • If the best path to subnet goes down, dynamic routing protocol routers will automatically discover that and will calculate a new best path if one is available. With static routes, everything is manually configured by the administrator. It's a lot of work and it doesn't recover very well from any failure.

 

Dynamic Routing Protocol Advantages

 

Dynamic Routing Protocols vs Static Routes

 

Using a combination of a dynamic routing protocol and static routes is very common in real-world environments. The smallest or test environments would always be going to use a dynamic routing protocol but that doesn't mean that we don't use static routes.

 

In this case, the routing protocol will be used to carry the bulk of the network information. Static routes can also be used on an as-needed basis. For example for backup purposes or for a static route to the Internet (which will typically be injected into the dynamic routing protocol and advertised to the rest of the routers.)

 

The edge router you can propagate that default static route into the routing protocol and then you can have the routing protocol carry it through the rest of your network. There will be no need to configure a default static route on all of your routers, just the one that is on the edge.

 

Dynamic Routing Protocols vs Static Routes 1

 

Dynamic Routing Protocols vs Static Routes Tutorial 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
Dynamic Routing Protocols vs Static Routes Tutorial Configuration Example

 

  1. Enter the command below to remove OSPF on every router

no router ospf 1

 

2. Will R1 still have connectivity to R4?

Yes. RIP is still running so RIP routes will replace the removed OSPF routes in the routing table.

R1#show 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, 10 subnets, 2 masks

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

R 10.1.0.0/24 [120/3] via 10.0.3.2, 00:00:12, FastEthernet1/1

R 10.1.1.0/24 [120/2] via 10.0.3.2, 00:00:12, FastEthernet1/1

R 10.1.2.0/24 [120/2] via 10.0.3.2, 00:00:12, FastEthernet1/1

R 10.1.3.0/24 [120/1] via 10.0.3.2, 00:00:12, FastEthernet1/1

 

3. What is the metric to the 10.1.1.0/24 network on R1?

A hop count of 2.

 

4. Why is there only one route on R1 to the 10.1.1.0/24 network now?

Interface FastEthernet 0/0 on R2 is still shut down so no routes go through it.

 

5. Make the required change so that there are two routes to the 10.1.1.0/24 network in the routing table on R1.

R2(config)#interface f0/0

R2(config-if)#no shut

R1#show 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, E - EGP

i - IS-IS, 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

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 12 subnets, 2 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

R 10.1.0.0/24 [120/1] via 10.0.0.2, 00:00:03, FastEthernet0/0

R 10.1.1.0/24 [120/2] via 10.0.3.2, 00:00:15, FastEthernet1/1

[120/2] via 10.0.0.2, 00:00:03, FastEthernet0/0

R 10.1.2.0/24 [120/2] via 10.0.3.2, 00:00:15, FastEthernet1/1

R 10.1.3.0/24 [120/1] via 10.0.3.2, 00:00:15, FastEthernet1/1

 

6. Enter the commands below on each router to provision a basic EIGRP configuration and enable EIGRP on every interface.

router eigrp 100

no auto-summary

network 10.0.0.0 0.255.255.255

 

7. What changes do you expect to see in the routing tables? Why?

The RIP routes will be replaced by EIGRP because its Administrative Distance of 90 is preferred to RIP’s AD of 120.

 

8. Verify the changes to the routing table on R1.

R1#show 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, 12 subnets, 2 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

D 10.1.0.0/24 [90/30720] via 10.0.0.2, 00:00:32, FastEthernet0/0

D 10.1.1.0/24 [90/33280] via 10.0.0.2, 00:00:29, FastEthernet0/0

D 10.1.2.0/24 [90/35840] via 10.0.0.2, 00:00:25, FastEthernet0/0

D 10.1.3.0/24 [90/261120] via 10.0.3.2, 00:00:19, FastEthernet1/1

 

9. What is the metric to the 10.1.1.0/24 network on R1?

A composite metric of 33280.

 

10. Why is there only one route to the 10.1.1.0/24 network on R1?

EIGRP uses a composite metric that takes into account interface bandwidth and delay. The interfaces on R5 have a configured bandwidth of 10Mbps. The interfaces along the top path of the network topology all have the default FastEthernet bandwidth of 100Mbps so this route is preferred. All traffic will go via the next hop 10.0.0.2.

 

11. Disable RIP and EIGRP on R5 with the commands below.

R5(config)#no router rip

R5(config)#no router eigrp 100

 

12. Configure the network so that there is still connectivity between all subnets if the link between R1 and R2 goes down. Accomplish this with six commands. Do not enable EIGRP on R5 but note that the routing protocol is expected to be enabled there in the future.

Floating static routes need to be added as a backup to the EIGRP routes. We want to ensure EIGRP routes are preferred when available so set the AD to be higher than EIGRP’s AD of 90.

R1(config)#ip route 10.1.0.0 255.255.0.0 10.0.3.2 95

R2(config)#ip route 10.0.0.0 255.255.0.0 10.1.0.1 95

R3(config)#ip route 10.0.0.0 255.255.0.0 10.1.1.1 95

R4(config)#ip route 10.0.0.0 255.255.0.0 10.1.3.2 95

R5(config)#ip route 10.0.0.0 255.255.0.0 10.0.3.1 95

R5(config)#ip route 10.1.0.0 255.255.0.0 10.1.3.1 95

R5 is not running EIGRP so it is not currently necessary to set the Administrative Distance for its routes to 95. It is required to prevent the floating static routes from being preferred when EIGRP is enabled in the future however.

Summary routes need to be used to accomplish the task in six commands.

 

13. What changes do you expect to see to the routing table on R1?

The summary route will be added to the routing table but not used because it has a prefix length of /16, compared to the EIGRP routes which have a longer prefix length of /24.

If individual floating static routes had been added for each of the /24 destination networks then these would not have appeared in the routing table (unless a link went down) because EIGRP has a better Administrative Distance.

 

14. Verify the changes to the routing table on R1.

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, 13 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 [95/0] via 10.0.3.2

D 10.1.0.0/24 [90/30720] via 10.0.0.2, 00:04:48, FastEthernet0/0

D 10.1.1.0/24 [90/33280] via 10.0.0.2, 00:04:45, FastEthernet0/0

D 10.1.2.0/24 [90/35840] via 10.0.0.2, 00:04:41, FastEthernet0/0

D 10.1.3.0/24 [90/266240] via 10.0.0.2, 00:03:02, FastEthernet0/0

 

15. Verify that traffic from PC1 to PC3 still goes via R2.

C:\>tracert 10.1.2.10

Tracing route to 10.1.2.10 over a maximum of 30 hops:

1 1 ms 0 ms 1 ms 10.0.1.1

2 0 ms 3 ms 0 ms 10.0.0.2

3 1 ms 0 ms 0 ms 10.1.0.1

4 0 ms 1 ms 0 ms 10.1.1.1

5 * 0 ms 0 ms 10.1.2.10

Trace complete.

 

16. Shut down interface FastEthernet 0/0 on R2.

R2(config)#interface f0/0

R2(config-if)#shutdown

 

17. What changes do you expect to see on R1’s routing table?

The EIGRP routes will be removed.

 

18. Verify the changes to the routing table on R1.

R1#show 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.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 [95/0] via 10.0.3.2

 

19. Verify connectivity 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=125

Reply from 10.1.2.10: bytes=32 time=1ms TTL=125

Reply from 10.1.2.10: bytes=32 time=1ms TTL=125

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

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 = 1ms, Average = 0ms

 

20. Verify the traffic goes via R5.

C:\>tracert 10.1.2.10

Tracing route to 10.1.2.10 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.3.2

3 0 ms 0 ms 0 ms 10.1.3.1

4 0 ms 0 ms 1 ms 10.1.2.10

Trace complete.

 

21. Bring interface FastEthernet 0/0 on R2 back up.

R2(config)#interface f0/0

R2(config-if)#no shutdown

 

22. Enter the commands below on R5 to provision a basic EIGRP configuration and enable EIGRP on every interface.

R5(config)#router eigrp 100

R5(config-router)#no auto-summary

R5(config-router)#network 10.0.0.0 0.255.255.255

 

Additional Resources

 

Cisco Networking Academy's Introduction to Routing Dynamically: https://www.ciscopress.com/articles/article.asp?p=2180210&seqNum=5

Chapter: Configuring Static Routing: https://www.cisco.com/c/en/us/td/docs/switches/datacenter/sw/5_x/nx-os/unicast/configuration/guide/l3_cli_nxos/l3_route.html

Routing Protocols: https://www.cisco.com/c/en/us/td/docs/net_mgmt/prime/network/3-8/reference/guide/routpro.html

 

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.