static-routing-featured-image

CCNA Lab: Static Routing

Lab Overview

This free CCNA lab is all about static routing. Static routing is an important concept to master in networking. A static route is a route manually entered into the routing table (usually through CLI) of a router by a network administrator. Static routes are not widely used on large networks due to constraints in scaling, lack of link redundancy, and having to keep static routes up to date manually. Because of these disadvantages, static routes are often replaced with dynamic routing protocols such as OSPF in large networks. However, a popular type of static route is the default static route, which many networks use. We’ll get into the types of static routes later in the post. Static routes also have the advantage of having less overhead on a network due to no routing protocol updates and are less resource-intensive on routers.

In this lab, we will cover the following:

  • Dissecting the route table
  • Administrative distance
  • Types of static routes
  • Configuring static routes and verifying in the routing table

I have provided a free Packet Tracer lab to complete as part of your learning. Everything necessary to complete the lab has already been configured. It is your job to implement static routing to allow end-to-end connectivity between each router in the topology.

Dissecting the Route Table

A routing table is a list of networks that the router knows about and contains information about how to reach those networks. If you’re new to networking and haven’t ever seen a routing table, it may look a little intimidating at first. Routing tables have several types of routes in them:

  • Directly connected networks — Added to the routing table automatically. Lists networks directly connected to local interfaces. If the interface is shutdown, the directly connected entry is removed.
  • Static Routes — Routes that have been manually added by an administrator. Good for small, simple networks. Does not dynamically adjust for topology changes.
  • Default Routes — Special type of static route that is used when the router does not have an entry for a destination in its routing table. The router uses this route for traffic with an unknown destination.
  • Dynamically learned routes — Routes learned through routing protocols such as OSPF.

Let’s take a look at the initial routing table and configured interfaces for R1. We can look at the routing table on Cisco routers using the show ip route command, and we can use show ip interface brief to see interface information.

We can see that R1 has two interfaces configured: Loopback1 and GigbitEthernet0/0. Let’s keep that in mind and have a look at the route table. The codes are used to indicate what kind of route it is. They help distinguish between directly connected routes, static routes, and dynamically learned routes. You can see that “C” is used to indicate directly connected, and “S” is used to indicate a static route. If we had a routing protocol running, such as OSPF, we would see one of the various codes associated with OSPF.

Notice that we have a piece of text saying “Gateway of last resort is not set”. We’ll come back to that.

The last part of the output is where we can see the actual route table entries. Let’s focus on just the entries with “C”, which as previously mentioned, are our directly connected networks. The first entry we see is an entry for loopback1. This entry is saying that the router can get to 1.1.1.1/32 through its loopback1 interface, which of course is virtual. Going to the next entry, we can see that 172.16.1.0 /24 is directly connected. This entry is saying that the router can get to the 172.16.1.0/24 network through its GigbitEthernet0/0 interface. We can verify that to be true by looking at the topology.

We’ll take a look at the route table again after we’ve configured some static routes.

Administrative Distance

Administrative distance is an important concept to understand when it comes to routing. It is the metric used to decide which routing table entry is the most “believable”. In simpler terms, if a router has multiple entries to the same destination, it will use the administrative distance as the tiebreaker. The lower the administrative distance, the better. As an example, if a router has an entry in its routing table through OSPF and EIGRP, it will use the EIGRP entry because EIGRP has an AD of 90 vs OSPF’s AD of 110.

The reason I mention AD in this post is that both directly connected routes and static routes have administrative distances. Directly connected routes have an AD of 0, and static routes have an AD of 1. This means that those entries will always be preferred over a routing protocol entry since they are lower.

EntryAdministrative Distance
Directly Connected0
Static1
EIGRP90
OSPF110
RIP120
External BGP20
Internal BGP200

Types of Static Routes

There are 3 main types of statics routes: the traditional static routes, default static routes, and floating static routes.

  • Standard Static Routes – These are the traditional static routes you’ll see in a route table. They’ll have the destination network, and the next-hop IP address or exit interface to reach it.
  • Default Static Routes – A default static route is a route used to send traffic with an unknown destination. Think of it as the default gateway on your home network. These are widely used to connect a home router back to the ISP. This route is also known as the gateway of last resort.
  • Floating Static Routes – Floating static routes are used as a backup to a pimrary static route. For example, you could use a floating static route as a backup to your default route if the link your default route is using goes down. This works by configuring a static route with a higher adminsitrative disance than the primary. That way, the primary route is preferred over the floating static route.

Configuring Static Routes

Let’s put what we’ve covered into practice to see how static routes work. In this lab, we’ll practice configuring standard static routes and default static routes.

static-routing-lab-topology-poster
Lab Topology
DeviceInterfaceAddress
R1Lo11.1.1.1 /32
R1GigabitEthernet0/0172.16.1.1 /24
R2Lo22.2.2.2 /32
R2GigabitEthernet0/0172.16.1.2/24
R2GigabitEthernet0/110.1.1.1. /24
R3Lo33.3.3.3 /32
R3GigabitEthernet0/110.1.1.2 /24

When it comes to configuring static routes, I like to keep a basic rule in mind: If a network is not not directly connected, there needs to be static route to reach it. This simply means if we need to be able to communicate with a network that isn’t directly connected to the router, then we need to configure a static route for it. For example, if I want R1 to be able to talk to R3, we need to have a static route to 10.1.1.0 /24 and vice versa. This same logic can be used for the loopback interfaces. If we want to be able to ping 2.2.2.2 and 3.3.3.3, we need to have routes to them. Let’s go ahead and configure those. The command to configure a static route on Cisco routers is ip route {destination prefix} {subnet mask} {next-hop IP/exit interface}.

R1(config)# ip route 10.1.1.0 255.255.255.0 172.16.1.2
R1(config)# ip route 2.2.2.2 255.255.255.255 172.16.1.2
R1(config)# ip route 3.3.3.3 255.255.255.255 172.16.1.2

With those three routes configured, R1 now knows how to get to all 3 networks. Notice how 172.16.1.2 is used as the next-hop IP for all three. This is because R2 is the next-hop router t get to all three networks. As a side note, next-hop IP is preferred over exit interface. The exit interface should only be used for point-to-point links. Let’s take a look at R1s route table now.

We can see that R1 now has three static route entries: One for 2.2.2.2 /32, one for 3.3.3.3 /32, and one for 10.1.1.0 /24. Also, notice the [1/0]. The first number within the brackets is the administrative distance. As mentioned before, static routes have an AD of 1.

Let’s try to ping some routers from R1. Try pinging 2.2.2.2, 10.1.1.1, 10.1.1.2, and 3.3.3.3.

You may have noticed that pings to 10.1.1.2 and 3.3.3.3 fail. Recall that ALL routers need to have static routes to networks that are NOT directly connected. The problem here is that we’ve only configured routes on R1. R1 knows it needs to send that ping traffic to R2, but R2 and R3 need to know where to send traffic also. It is important to note that routers make routing decisions independently. R1 sends the ping traffic to R2, then R2 must make its own routing decision on where to send that traffic.

Let’s move to R2 and look at the network from R2’s perspective. We know 172.16.1.0 /24 and 10.1.1.0 /24 are directly connected to R1, which means we don’t need static routes there. However, R2 doesn’t know about the loopbacks on R1 or R3. If R1 knows about the loopback on R3, it knows it needs to send ping traffic to R2, but R2 doesn’t know about 3.3.3.3, so it will drop that traffic. We need to add a static route to 1.1.1.1 /32 and 3.3.3.3 /32 on R2 and verify them in the route table.

R2(config)# ip route 1.1.1.1 255.255.255.255 172.16.1.1
R2(config)# ip route 3.3.3.3 255.255.255.255 10.1.1.2

We should now be able to ping 1.1.1.1 and 3.3.3.3 from R2.

The only router we have to work on now is R3. At this point, you should be able to ping from R1 to 2.2.2.2 and 10.1.1.1, and from R2 to 1.1.1.1 and 3.3.3.3. In order to complete end-to-end connectivity, we need to configure R3 with static routes to 1.1.1.1 /32, 172.16.1.0 /24, and 2.2.2.2 /32. Similarly to R1, the next-hop address for all three will be R2, which is 10.1.1.1 in this case. Let’s configure those, verify in the routing table, and try pinging.

R3(config)# ip route 1.1.1.1 255.255.255.255 10.1.1.1
R3(config)# ip route 172.16.1.0 255.255.255.0 10.1.1.1
R3(config)# ip route 2.2.2.2 255.255.255.255 10.1.1.1

You should have successful pings to 1.1.1.1, 2.2.2.2, and 172.16.1.1 from R3:

With R3 being configured, you should now have full connectivity between all three routers. Go back to R1 and attempt the pings we tried at the beginning of the lab. They should all now be successful.

What about Default Static Routes?

The topology in this lab isn’t really suited for a default static route but let’s configure one on R1 anyway just to see how they work. To configure a default static route on Cisco routes, use the ip route 0.0.0.0 0.0.0.0 {next-hop/exit interface} command. This command tells the router to match any IP address with any mask, and send it to the specified next-hop address. This route is only used when the router does NOT have a better route to use. Let’s issue this command on R1 and use 172.16.1.2 as the next-hop and take a look at the routing table./i

R1(config)# ip route 0.0.0.0 0.0.0.0 172.16.1.2

Notice how we have a gateway of last resort. This command has set the interface on R2 facing R1 as R1’s gateway of last resort. This means that any traffic that arrives on R1 with a destination R1 does not know about will be forwarded to R2. It is sort of like saying “I don’t know what to do with this, you deal with it!”. Since R1 does not have anything else connected, the route is not needed. We can remove it with the no ip route 0.0.0.0 0.0.0.0 172.16.1.2 command.

Thanks for Reading!

I hope this post has provided a solid understanding of static routing. If you believe there is something wrong with the initial configuration, please contact me via my contact form to let me know.

Full Configuration

The full configurations for both labs can be found on my github!

Leave a Comment

Your email address will not be published. Required fields are marked *