Cisco IOS IP routing -- dynamic routing

In our last article, we talked about the importance of static IP routing. Static routing still has an important place, but as a network administrator, you must also know dynamic IP routing like the back of your

    Requires Free Membership to View

hand. In this article, we'll explore dynamic IP routing and you'll learn the practical information that you need to know about it.

Routing in general

To review from the last tip, the router learns the next hop for packets using one of two methods:

  1. Static routing: With static routing, you -- as the administrator -- manually enter the routes and tell the router, for each IP network, what next hop that traffic should be delivered to.
  2. Dynamic routing: With dynamic routing, you -- as the administrator -- configure a routing protocol on your network interfaces. Your routing protocol learns about other routers automatically. Your router and the other routers exchange routes, and each learns about the networks that the other is connected to. When new networks are added or removed, the routers update each other.

Static routing issues

With static routing, you are telling your router to send traffic with a destination IP address to a router with an IP address of x.x.x.x. This is handy for a small network with very few routes or for someone who wants to have absolute control, but it can become very cumbersome as your network grows. To keep a multi-site wide-area network fully connected (fully meshed) via static routes, you have to create a route on every router for every other router. This mean that, as you add more sites, the number of routes you have to create increases exponentially, and when sites go down or links are performing poorly, any corrections must be entered manually.

Benefits of dynamic routing

A dynamic routing protocol can resolve these issues for you. Here are some general benefits of using a dynamic routing protocol:

  • More automation: Routing updates are automatically sent to all other routers.
  • Change notification: The dynamic routing protocol may be able to reroute traffic around a link that is down or congested.
  • Greater uptime for users: Because the routing protocol has intelligence and can react faster, the users may see more uptime.
  • Greater network throughput: Because the routing protocol may be able to calculate the most responsive network link to use, the users may see less latency and more performance out of the network.
  • Less work for administrators: As the network grows, the administrator doesn't have to worry about configuring all the other routers on the network. Instead, the administrator configures the dynamic routing protocol on the new router to talk to the other routers and let them know what networks the new router has to offer.

Gotchas of dynamic routing

Don't think that dynamic routing protocols are perfect, however. Here are some possible gotchas of using dynamic routing protocols:

  • Routers may need more CPU and RAM to hold routing tables and calculate dynamic routes.
  • Dynamic routing protocols aren't perfect and can experience routing loops in some cases.
  • Dynamic routing protocols will introduce complexity to your network. You will need to understand how to configure and troubleshoot the new dynamic routing protocols.

Dynamic routing protocols

You may be wishing you had some examples of dynamic routing protocols. I'm not going to cover or compare all possible routing protocols, but let's talk about the dynamic routing protocols you need to know.

First off, there are the interior gateway routing protocols (IGP). These are protocols that you would use within your own network. They are the protocols that are supported by just about every router and server operating system (such as Windows 2003 Server and Linux):

  • OSPF (Open Shortest Path First) -- RFC2328 -- is the most popular dynamic routing protocol in use today. It is an open protocol, so that any router or server operating system can run OSPF. OSPF selects the best route using "cost" as its metric. OSPF is a full-featured routing protocol and can be complex, but it can also scale to any size of network.
  • EIGRP – (Enhanced Interior Gateway Routing Protocol) is a Cisco proprietary protocol. Only Cisco devices run EIGRP. EIGRP is a full-featured routing protocol, similar to OSPF. EIGRP has some great features, but unless you can guarantee that you will always have an all-Cisco network, I would recommend an open protocol like OSPF, instead. EIGRP replaced IGRP, its predecessor. With EIGRP, the metric used to select the best route is calculated using a formula that takes into account the bandwidth, reliability, load and delay of the link.
  • RIP (Routing Information Protocol) Version 2 -- RFC2453 -- is also an open source protocol. Version 2 of RIP is what you should use today as it provides support for VLSM (Variable Length Subnet Mask). RIP is the simplest and easiest routing protocol to configure, but it also has fewer features than OSPF and is limited to routing for a network with fewer than 15 hops. RIP works very well for a small network that doesn't plan on growing large, however. Another great thing about RIP is that it is commonly supported by even small routers and firewalls.

And, in a class by itself, there is Border Gateway Protocol (BGP):

  • BGP (Border Gateway Protocol) is the routing protocol of the Internet. BGP is an Exterior Gateway Protocol (EGP). What that means is that BGP is used by routers that make routing decisions on the Internet. Just because your home or work router has a connection to the Internet, you don't necessarily need BGP or want to run it. Once your router has more than one dedicated connection to the Internet from business-class providers, you may want to look at running BGP. BGP is a path-vector protocol, and it selects the best route, unlike other routing protocols. BGP uses the "AS-PATH" as its routing metric and would select the route that has the shortest path through the Internet.

Configuring dynamic routing

So all this theoretical stuff is great, right? It gives you a good foundation, but you probably want to see how to configure a dynamic routing protocol.

Let's say that we have the basic network, shown below:

It is our job to configure RIP between these two locations so that each network knows about the other router's networks. Assuming that all normal router IP addressing is configured and interfaces have been enabled, we need issue only a few simple commands on each router to accomplish this. Here is the configuration:

Location A
Router rip
Ver 2
No auto-summary

Location A
Router rip
Ver 2
No auto-summary

What this does is:

  • Enter routing configuration mode on each router.
  • Enable Version 2 of the RIP routing protocol.
  • Enable RIP routing on both the LAN and the WAN networks. This will tell the router both to advertise these networks to other routers and to try and find other routers on these networks.

    Once completed, here is the routing table and ping output for Location A:

    Location-A# show ip route
    Codes: 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
    Gateway of last resort is not set
     is subnetted, 2 subnets
    R [120/1] via, 00:00:16, Serial0
    C is directly connected, Ethernet0 is subnetted, 1 subnets
    C is directly connected, Serial0
    Location-A# ping
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to, timeout is 2 seconds:
    Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms
    And here is Location B's routing table:
    Location-B# show ip route
    Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
           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, * - candidate default
           U - per-user static route
    Gateway of last resort is not set
     is subnetted, 2 subnets
    R [120/1] via, 00:00:00, Serial0
    C is directly connected, Ethernet0 is subnetted, 1 subnets
    C is directly connected, Serial0
    Location-B# ping
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echoes to, timeout is 2 seconds:
    Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms

    As you can see, each router knows about the other router's LAN networks through RIP (the "R" in the routing table source shows that these routes were learned through RIP). Also, each router can ping other routers' Ethernet interfaces.

    We could have accomplished the same connectivity with only one static route on each router. However, as this network grows from two routers to 20 or 200, the time needed to administer static routing would be a horrible administrative burden.

    In summary, as a network administrator, you should have some basic knowledge of the four most popular dynamic routing protocols in use today. If you are new at this, I recommend that you start by learning about RIP and move up to the other protocols from there.

    About the author:
    David Davis (CCIE #9369, CWNA, MCSE, CISSP, Linux+, CEH) has been in the IT industry for 15 years. Currently, he manages a group of systems/network administrators for a privately owned retail company and authors IT-related material in his spare time. He has written more than 50 articles, eight practice tests and three video courses and has co-authored one book. His Web site is HappyRouter.com.

    This was first published in December 2006

  • There are Comments. Add yours.

    TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

    REGISTER or login:

    Forgot Password?
    By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
    Sort by: OldestNewest

    Forgot Password?

    No problem! Submit your e-mail address below. We'll send you an email containing your password.

    Your password has been sent to:

    Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.