Config Lab: IPv4 Static Routes 1
One of the best ways to learn IPv4 routing is to think hard about IPv4 static routes. Today’s lab gives you more of that with a typical config lab. It starts with a topology and with IPv4 addresses configured. Your job: add IPv4 static routes for all remote subnets on all four routers in the topology.
The Lab Exercise
Requirements
Configure static IPv4 routes on the routers shown in the figure so that each router can forward packets to all the subnets shown in the figure. The specific rules for this lab are:
- Configure static routes on each of the four routers
- Configure static routes to each subnet that is not a connected subnet
- Assumptions:
- All router interfaces shown in the lab are up, working and have correct IPv4 addresses assigned per the figure
- All PCs have been configured with an IPv4 address and are working
Â
Figure 1: Simple Hub and Spoke Topology
Initial Configuration
Examples 1, 2, 3 and 4 show the beginning configuration state of Core, Branch1, Branch2 and Branch3.
hostname Core
!
interface GigabitEthernet0/1
ip address 10.100.200.1 255.255.255.252
no shutdown
!
interface GigabitEthernet0/2
ip address 10.100.200.5 255.255.255.252
no shutdown
!
interface GigabitEthernet0/0
ip address 10.100.200.9 255.255.255.252
no shutdown
Example 1: Core Config
hostname Branch1
!
interface GigabitEthernet0/1
ip address 10.100.200.2 255.255.255.252
no shutdown
!
interface GigabitEthernet0/2
ip address 192.168.50.1 255.255.255.0
no shutdown
Example 2: Branch1 Config
hostname Branch2
!
interface GigabitEthernet0/1
ip address 10.100.200.6 255.255.255.252
no shutdown
!
interface GigabitEthernet0/2
ip address 192.168.51.1 255.255.255.0
no shutdown
Example 3: Branch2 Config
hostname Branch3
!
interface GigabitEthernet0/1
ip address 10.100.200.10 255.255.255.252
no shutdown
!
interface GigabitEthernet0/2
ip address 192.168.52.1 255.255.255.0
no shutdown
Example 4: Branch3 Config
Config Lab Intro Video
The above lab intro – the text, figures, and initial configuration – tells you all you need to know. But if you want a little more, with a little different slant on what to do in this lab, watch this lab intro video!
Answer Options - Click Tabs to Reveal
You can learn a lot and strengthen real learning of the topics by creating the configuration – even without a router or switch CLI. In fact, these labs were originally built to be used solely as a paper exercise!
To answer, just think about the lab. Refer to your primary learning material for CCNA, your notes, and create the configuration on paper or in a text editor. Then check your answer versus the answer post, which is linked at the bottom of the lab, just above the comments section.
You can also implement the lab using the Cisco Packet Tracer network simulator. With this option, you use Cisco’s free Packet Tracer simulator. You open a file that begins with the initial configuration already loaded. Then you implement your configuration and test to determine if it met the requirements of the lab.
(Use this link for more information about Cisco Packet Tracer.)
Use this workflow to do the labs in Cisco Packet Tracer:
- Download the .pkt file linked below.
- Open the .pkt file, creating a working lab with the same topology and interfaces as the lab exercise.
- Add your planned configuration to the lab.
- Test the configuration using some of the suggestions below.
This Lab Supports Both CML-Free and CML-Personal!!!
The downloadable file listed here works in both CML-P or CML-F because it uses the IOL (router) and IOL-L2 (switch) reference platform images supported by both products as of CML V2.8. Note that these images also require less CPU and RAM than the other CML-P options.
Use the same general workflow as with Cisco Packet Tracer, as follows:
- Download the CML file (filetype .yaml) linked below.
- Import the lab’s CML file into CML.
- Start the lab in CML.
- Compare the CML lab topology and interface IDs to this lab Blog page, as they may differ (more detail below).
- Add your planned configuration to the lab, adjusting for interface ID differences.
- Test the configuration using some of the suggestions below.
Download this lab’s CML file!
Interface ID Differences:
The lab diagrams on this page use interface IDs (IIDs) that match the Packet Tracer version of the lab. When using CML, adjust the lab IIDs based on this table. Also, note that the IOL and IOL-L2 images used by the supplied CML file support only the “Ethernet” interface type, and not “FastEthernet” or “GigabitEthernet”.
The conventions for this lab are:
- All Gigabit interface types become Ethernet.
- All interface numbers stay the same. For instance, G0/0 becomes E0/0, and G0/1 becomes E0/1.
Port Shown in Lab | Â CML Port |
G0/0 | E0/0 |
G0/1 | E0/1 |
G0/2 | E0/2 |
Using the “One-Router as Many Hosts” Feature
The lab diagram on this page shows:
- 3 routers
- 3 LANs with unspecified LAN switches
- 3 hosts
However, CML-Free allows only five active nodes. To overcome that limitation, the supplied CML does the following:
- Uses the CML “Unmanaged Switch” node type to create each LAN. Unmanaged switches do not count against the five-node limit. Each unmanaged switch places all ports in the same VLAN with all ports up.
- Uses an extra router as a “One-Router-as-Many-Hosts” router. The router, per its pre-configuration, acts like ALL the hosts in the design – while counting as only one node towards the CML five-node limit. With this node, you can test as if sitting at the lab’s host, for instance, to issue ping and traceroute commands.
To learn about the one-router-as-many-hosts method, look to the following videos:
I also made a video showing examples of using this feature – a video that uses this lab as the backdrop!
Note: The one-router-as-many-hosts router may use passwords. The passwords and usernames are always “cisco”.
Host device info:
This table lists host information pre-configured in CML, which might not be required by the lab but may be helpful to you.
Device | IP Address | User/password |
PC1 | 192.168.50.100 | cisco/cisco |
PC2 | 192.168.51.100 | cisco/cisco |
PC3 | 192.168.52.100 | cisco/cisco |
Lab Answers Below: Spoiler Alert
Lab Answers: Configuration (Click Tab to Reveal)
Answers
Figure 1: Simple Hub and Spoke Topology
ip route 192.168.50.0 255.255.255.0 10.100.200.2
ip route 192.168.51.0 255.255.255.0 10.100.200.6
ip route 192.168.52.0 255.255.255.0 10.100.200.10
Example 1: Core Config
ip route 10.100.200.4 255.255.255.252 10.100.200.1
ip route 10.100.200.8 255.255.255.252 10.100.200.1
ip route 192.168.51.0 255.255.255.0 10.100.200.1
ip route 192.168.52.0 255.255.255.0 10.100.200.1
Example 2: Branch1 Config
ip route 10.100.200.0 255.255.255.252 10.100.200.5
ip route 10.100.200.8 255.255.255.252 10.100.200.5
ip route 192.168.50.0 255.255.255.0 10.100.200.5
ip route 192.168.52.0 255.255.255.0 10.100.200.5
Example 3: Branch2 Config
ip route 10.100.200.0 255.255.255.252 10.100.200.9
ip route 10.100.200.4 255.255.255.252 10.100.200.9
ip route 192.168.50.0 255.255.255.0 10.100.200.9
ip route 192.168.51.0 255.255.255.0 10.100.200.9
Example 4: Branch3 Config
Commentary, Issues, and Verification Tips (Click Tabs to Reveal)
Commentary
When configuring static routes, it is important to ensure that you have all of the correct IPv4 subnet information, just a little difference in subnet mask can make a big difference in routing behavior.
For this lab you were tasked with configuring static routes to all remote subnets on all routers. The figure shows six different subnets. The Core router connects to three subnets, so it will need three static routes. Each branch router connects to two subnets, so each branch router will need static routes for four different subnets.
For Core, the three remote LAN subnets are 192.168.50.0/24, 192.168.51.0/24 and 192.168.52.0/24. Just to help us get our bearings, Table 1 lists the three destination subnets, with router Core’s outgoing interface and next-hop global unicast address:
Destination Subnet |
Off of Router… |
Core Router’s Outgoing interface |
Core’s Next-Hop Address |
192.168.50.0/24 |
Branch1 |
G0/1 |
10.100.200.2 |
192.168.51.0/24 |
Branch2 |
G0/2 |
10.100.200.6 |
192.168.52.0/24 |
Branch3 |
G0/3 |
10.100.200.10 |
Table 1: Data to Use in Router Core’s Static IPv4 Routes
The configuration, shown in Example 1, repeats the ip route command three times. Each time it lists the destination subnet per the first column of the table, and the next hop address per the last column. For example, the complete command to configure one static route would be ip route 192.168.50.0 255.255.255.0 10.100.200.2. (Note that the mask is in DDN format, not prefix format.)
For Branch1, before thinking about the configuration command, think about the topology in the figure. Branch1 has two connected subnets. Then, to send packets to the other four subnets, router Branch1 will always send the packets out its G0/1 interface to the Core router next. As a result, and as seen in Example 2, all four of Branch1’s routes list 10.100.200.1 as the next hop address. The four commands each list different destination subnets: 10.100.200.4/30, 192.168.51.0/24, 10.100.200.8/30, and 192.168.52.0/24.
Branch2 uses the same basic logic as router Branch1. Branch2 has two connected subnets, four remote subnets, and all four static routes for the remote subnets points to router Core next. In Branch2’s case, the next-hop address of the Core router is 10.100.200.5. As seen in Example 3, the four ip route commands list 10.100.200.5 as the next-hop address, with subnets 10.100.200.0/30, 192.168.50.0/24, 10.100.200.8/30, and 192.168.52.0/24 in the four different commands.
As you probably guess by now, Branch3 uses the same basic logic as routers Branch1 and Branch2. Branch3 has two connected subnets, four remote subnets, and all four static routes for the remote subnets points to router Core next. In Branch3’s case, the next-hop address of the Core router is 10.100.200.9. As seen in Example 4, the four ip route commands list 10.100.200.9 as the next-hop address, with subnets 10.100.200.0/30, 192.168.50.0/24, 10.100.200.4/30, and 192.168.51.0/24.
Known Issues in this Lab
This section of each Config Lab Answers post hopes to help with those issues by listing any known issues with Packet Tracer related to this lab. In this case, the issues are:
# | Summary | Detail |
1 | None | No known issues related to this lab. |
Why Would Cisco Packet Tracer Have Issues?
(Note: The below text is the same in every Config Lab.)
Cisco Packet Tracer (CPT) simulates Cisco routers and switches. However, CPT does not run the same software that runs in real Cisco routers and switches. Instead, developers wrote CPT to predict the output a real router or switch would display given the same topology and configuration – but without performing all the same tasks, an actual device has to do. On a positive note, CPT requires far less CPU and RAM than a lab full of devices so that you can run CPT on your computer as an app. In addition, simulators like CPT help you learn about the Cisco router/switch user interface – the Command Line Interface (CLI) – without having to own real devices.
CPT can have issues compared to real devices because CPT does not run the same software as Cisco devices. CPT does not support all commands or parameters of a command. CPT may supply output from a command that differs in some ways from what an actual device would give. Those differences can be a problem for anyone learning networking technology because you may not have experience with that technology on real gear – so you may not notice the differences. So this section lists differences and issues that we have seen when using CPT to do this lab.
Known Issues in this Lab w/ CML
This tab lists known issues with running this lab in CML with the supplied file. The issues are:
# | Summary | Detail |
1 | No known issues. | . |
Why Would CML Have Issues?
(Note: The text below is the same as every Config Lab.)
CML supports a variety of Cisco operating systems (called reference platforms.) To make them work in CML, Cisco makes some adjustments to the code. Also, because no real router or switch hardware exists, some software features do not work the same when running in CML versus a real Cisco device. When we come across any difference when testing the lab, we’ll try to leave a note just above in case it helps you with the lab.
Beyond comparing your answers to this lab’s Answers post, you can test in Cisco Packet Tracer (CPT) or Cisco Modeling Labs (CML). In fact, you can and should explore the lab once configured. For this lab, once you have completed the configuration, try these verification steps.Â
Answer on Paper, or Maybe Test in Lab
Next, write your answer on paper. Or if you have some real gear, or other tools, configure the lab with those tools.
If you do implement the entire network in a lab, you can test the solution by going to each PC and pinging the other three. All the pings should work. Additionally, you could use an extended ping command to ping from each router’s G0/2 interface to each other router’s G0/2 interface IP address. For instance, from R1, the command ping 192.168.52.1 source 192.168.50.1 would test the forward route to R4’s G0/2 subnet, and the reverse route back to R1’s G0/2 subnet. Finally, issuing a traceroute command from any of the PCs in the lab would let you see the path through the network.
Config Lab Review Video
Want to hear more about this lab’s solution? Check out the video to the left.
In my solution, I used a 10.100.200.0/28 summary route on each of my branch routers, rather than add each /30 route individually. Am I on the right track in summarizing these, or should it be avoided?
Hey Brett,
It’s not harmful to use a summary route as you did here. But I think you’re asking more about what makes sense in real networks. While you could create one route instead of many, I’d even go for a default route on each of the remote routers and do away with all of the more specific routes. Of course, the lab exercise is written to encourage exercise with the commands, and this one hopes to give exercise with subnet routes rather than default routes. So as long as you understand what static routes you configured and what they do, the goal is met.
In my solution, I did not need to enter ip route 10.100.200.X.Y for the branch routers. Each pc was able to ping the other by only adding the ip route 192.168.5X.0 routes. Since the core is directly attached to the 10.100.200.X.Y routes, why do I need to add them to the branch routers? As I said, what I have works and I did not add them.
Hi Matt,
Ignoring the lab steps for a moment, I agree, what you did should work to support the PCs, in subnets 192.168.5x.0, to ping each other successfully.
Now thinking about the lab, the routes on the branch routers for the WAN subnets were needed in the lab because the lab asked for them. But why? Well, say if the lower left router wanted to ping the WAN interface IP addresses for the two not-connected WAN subnets, it would need routes for those. Or, if from any of the branch routers, you tested by pinging remote PCs, the source IP address of those pings, by default, would the the branch router’s WAN IP address. So the return packet would need to be supported by a route to the WAN subnet.
So, if you’re interested, repeat your test with your current config, but now ping from the branch routers, and see the results. Then try adding those static routes for the WAN subnets and thinking through the logic.
in order to avoid adding those routes manually in the branchs routers. Can I just put “ip ro 0.0.0.0 0.0.0.0 10.100.200.5”?
Yep! I wrote the instructions to ask for routes to all subnets to give more practice on choosing the parameters for those routes. But yes, default routes work just fine.
Wendell, You’ve stated interface GigabitEthernet0/3 for Example 1: Core Config.
There is no GigabitEthernet0/3 interface. It should be GigabitEthernet0/0!
Ian,
Yep, there was an error. Thanks for the note. I just fixed it. Thanks again,
Wendell
Hello Wendell,
Please a question about the show ip route command for this exercise.
Here is my output from one of the routers from the exercise showing before and after config. I have underlined the part that I do not quite understand.
What constitutes the 2 subnets for 10.0.0.0/8 & 192.168.50.0/24 in the before config screen shot? I only see 1 subnet each for the class A & C addresses. Am I missing something?
On the after config output, why is 192.168.50.0/24 still showing 2 subnets when there are 3 subnets -192.158.50.0/192.168.51.0/192.168.52.0? And the 10.0.0.0/8 showing 4 subnets instead of 3?
Before config
Branch1>enable
Branch1#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, 2 subnets, 2 masks
C 10.100.200.0/30 is directly connected, GigabitEthernet0/1
L 10.100.200.2/32 is directly connected, GigabitEthernet0/1
192.168.50.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.50.0/24 is directly connected, GigabitEthernet0/2
L 192.168.50.1/32 is directly connected, GigabitEthernet0/2
After config
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, 4 subnets, 2 masks
C 10.100.200.0/30 is directly connected, GigabitEthernet0/1
L 10.100.200.2/32 is directly connected, GigabitEthernet0/1
S 10.100.200.4/30 [1/0] via 10.100.200.1
S 10.100.200.8/30 [1/0] via 10.100.200.1
192.168.50.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.50.0/24 is directly connected, GigabitEthernet0/2
L 192.168.50.1/32 is directly connected, GigabitEthernet0/2
S 192.168.51.0/24 [1/0] via 10.100.200.1
S 192.168.52.0/24 [1/0] via 10.100.200.1
Hi Tewa,
First, note that the lack of indention, and added indention, in the output – not reflected in your pasted output due to formatting issues here at the blog – are the key to what the output is attempted to tell us. Keeping that in mind…
The underlined lines tell us a summary of the routes known by a router for the class A, B, or C network listed in the NOT indented heading line. EG, the 10.0.0.0/8 represents class A network 10.0.0.0, while 192.168.50.0/24 represents class C network 192.168.50.0. Why? Well, when IOS has learned two or more routes within one classful network, it adds a heading line in the output of “show ip route”, with the heading line identifying the classful network/default mask, number of know routes (listed as “X subnets”), and number of different masks in that classful network (“Y masks”).
So, in this case, by adding two static routes to subnets of network 10.0.0.0, you increased the number of routes known by the router from within network 10.0.0.0 from 2 to 4. That’s the change.
However, the other two static routes are routes in OTHER classful networks: 192.168.51.0 and 192.168.52.0. So, those new static routes did NOT change the number of routes known to this router from within network 192.168.50.0.
And if you’re looking for this level of detail in the books… it’s not there. Maybe I should add it…
Hope this helps,
wendell
Hi Wendell,
Is it equally good practice to specify the outgoing interface instead of the next hop address?
Thanks,
Sam
Hey Sam,
With Ethernet WAN links, it’s considered better to use the next-hop address. The issue w/ using outgoing interface has to do with what makes the route work. The outgoing interface reference does not identify the next-router. So, the router using such a static route will ARP for the destination address, and the next-hop router will have to use a feature called proxy ARP, sending a reply on behalf of the distant host. It works with IPv4 (but does not with IPv6). So it works… but then the staff might get confused. Next-hop address makes the meaning of the route more obvious.
Hi Wendell,
In the “Option 3: Cisco Modelling Labs” Tab, when I click to the “Download this lab’s CML file!” hyperlink I’ll end up to a pop up window that invite me to download the file with the following name: clab519-free.yaml.
That file name made me think if it was accidentally made a mistake with the attached file, because logically it shuould have been named as “club118.something”.
Indeed, when I downloaded it and imported in my CML 2.8 Free Tier environment, I realized that the topology in the canvas did not properly match the original one shown on web page https://www.certskills.com/clab118/#1621530103349-9fcead1f-a530.
I can clearly see router R1, R2 and R3, with SW1, SW2, SW3 and the Router-as-Many-Hosts interconnected and arranged in a triangle shape but without the Core Router.
Also, in the associated youtube video, https://youtu.be/oHqV9tvT2-g
I can see that the figure topology resembles the original one in the web page with an exagon shape (Core connected to Branch1, Branch2, Branch3; Branch1 connected to SW1, Branch2 connected to SW2, Branch3 connected to SW3, and finally Branch1, Branch2 and Branch3 all toghether connected to the Router-as-Many-Hosts).
I hope I’m not wrong, but could you please check?
Thank you so much.
Hey Gsplexy,
So sorry for the delay – I just missed the message.
So, blog page edit mistake by me. I fixed the link. If you try again, the correct lab file should download. If you try it and it fails, comment again! Thanks…