Connected, static & dynamic routes

Connected routes

Subnets directly connected to a router interface are added to the router’s routing table. Interface has to have an IP address configured and both interface status codes must be in the “up and up” state. A router will be able to route all packets destined for all hosts in subnets directly connected to its active interfaces.

Consider the following example. The router has two active interfaces, Fe0/0 and Fe0/1. Each interface has been configured with an IP address and is currently in the up-up state, so the router adds these subnets to its routing table.

As you can see from the output above, the router has two directly connected routes to the subnets and The character „C“ in the routing table indicates that a route is a directly connected route.

TIP – you can see only connected routes in a router’s routing table by typing the show ip route connected command.

Static routes

By adding static routes, a router can learn a route to a remote network that is not directly connected to one of its interfaces. Static routes are configured manually by typing the global configuration mode command ip route DESTINATION_NETWORK SUBNET_MASK NEXT_HOP_IP_ADDRESS. This type of configuration is usually used in smaller networks because of scalability reasons (you have to configure each route on each router).

A simple example will help you understand the concept of static routes.
Router A is directly connected to router B. Router B is directly connected to the subnet Since that subnet is not directly connected to Router A, the router doesn’t know how to route packets destined for that subnet. You have to configure that route manually.

First, consider the router A’s routing table before adding the static route:

Now, we’ll use the static route command to configure router A to reach the subnet The router now has the route to reach the subnet.

TIP – another version of the ip route command exists. You don’t have to specify the next-hop IP address. You can rather specify the exit interface of the local router. In the example above you could have typed the ip route DEST_NETWORK NEXT_HOP_INTERFACE command to instruct router A to send all traffic destined for the subnet out the right interface.

Dynamic routes

A router can learn dynamic routes if a routing protocol is enabled. A routing protocol is used by routers to exchange routing information with each other. Every router in a network can then use information to build its routing table. A routing protocol can dynamicaly choose a different route if a link goes down, so this type of routing is fault-tolerant. Also, unlike with static routing, there is no need to manually configure every route on every router, which greatly reduces the administrative overhead. You only need to define which routes will be advertised on a router that connect directly to the corresponding subnets, routing protocols take care of the rest.

One of the disadvantages of dynamic routing is that it increases memory and CPU usage on a router, because every router has to process received routing information and calculate its routing table.

To better understand the advantage that dynamic routing procotols bring, consider the following example.
 Both routers are running a routing protocol, namely EIGRP. There is no static routes on Router A, so R1 doesn’t know how to reach the subnet that is directly connected to Router B. Router B then advertises the subnet to Router A using EIGRP. Now Router A has the route to reach the subnet. This can be verified by typing the show ip route command:

 You can see that Router A has learned the subnet from EIGRP. The letter „D“ in front of the route indicates that the route has been learned through EIGRP.
If the subnet fails, Router B can immediately inform Router A that the subnet is no longer reachable.

Post a Comment

NETWORKSTIP © 2013. All Rights Reserved. Shared by NetworksTip Muhammad Nafees