Config Lab: Layer 3 Switching w/ Routed Ports

Wendell Odom
By Wendell Odom September 17, 2021 17:05

Layer 3 switches, aka multilayer switches, route packets using the same logic as IP routers. For ports connected to another layer 3 switch or a router, the layer 3 switch benefits from using that port as a routed port. In effect, the switch applies routing logic, and only routing logic, to messages flowing in and out of that physical port. This Config Lab uses a grid of four devices (two routers and two layer 3 switches) for which you configure the layer 3 switches to use routed ports.

All about Config Labs

The blog has a series of lab exercises called “Config Labs.” Each lab presents a topology with the relevant initial configuration for each device. The lab also lists new requirements, after which you should create the additional configuration to meet those requirements. You can do the lab on paper, in a text editor, or use software tools like Cisco Packet Tracer or Cisco Modeling Labs.

Once you have created your answer, you can click various tabs at the bottom of this post to see the lab answers, comments about the lab, and other helpful information.

The Lab Exercise

Lab Requirements

This lab focuses on four devices, but you need to understand the broader context as well.

First, consider two routers that connect to various WAN links. Those routers connect the site to the WAN so that devices in the local site can communicate with hosts in other sites inside the Enterprise.

Figure 1: Context for this Lab


The LAN also uses a traditional distribution/access 2-tier design, as seen at the bottom of Figure 1. The access switches act as layer 2 switches, while the distribution switches act as layer 3 switches.

Focusing on the two routers (R1 and R2) and the two distribution switches (Dist1 and Dist2), the devices each use configuration and behave like routers on the links between them. Routers route the packets received on their interfaces just because of the nature of routers. Layer 3 switches do not switch LAN frames received on an interface, as layer 2 switches do, but instead route packets received on an interface, just like a router.

For this lab, focus on four devices, as shown in Figure 2. Consider routers R1 and R2 to be pre-configured to route IP packets and learn routes with OSPF. You need to configure switches Dist1 and Dist2 to route IP packets, using the links shown in Figure 2 as routed ports and using the IP address/mask combinations as shown.

Figure 2: Specific Devices for this Lab


Once you understand the initial configuration, configure distribution switches Dist1 and Dist2 to make the ports shown in Figure 2 operate as routed ports.  Use the following details:

  1. Enable IP routing on both Dist1 and Dist2.
  2. For the Dist1 and Dist2 ports per Figure 2, configure the ports as routed ports instead of as switched ports. Do NOT use Switched Virtual Interfaces (SVIs). That is, do NOT use VLAN interfaces.
  3. On those same ports, configure an IP address/mask as follows:
    1. Use the subnets shown in Figure 2.
    2. For the fourth octet on Dist1, use .3.
    3. For the fourth octet on Dist2, use .4.
  4. Enable OSPF on both Dist1 and Dist2 with these commands, supplied so that this lab can focus on the routed interface details:
    1. router ospf 1
    2. network area 0


Initial Configuration

Layer 3 switches require the configuration of several IP-related features before they can route packets. None of those features come pre-configured for this lab. However, do the lab as if routers R1 and R2 have been pre-configured for all IP routing features per the design details listed in this lab. Layer 3 switches Dist1 and Dist2 should now exchange routes with R1 and R2 and be able to ping all the addresses on routers R1 and R2, and so on. To that end, the configuration on both routers already have:

  • IP routing enabled (a default setting on all routers)
  • OSPF enabled (assuming the use of the addressing plan for this lab)
  • Interface IP addresses configured (per the addressing plan for this lab)

Example 1: R1 Config


Example 2: R2 Config

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:

  1. Download the .pkt file linked below.
  2. Open the .pkt file, creating a working lab with the same topology and interfaces as the lab exercise.
  3. Add your planned configuration to the lab.
  4. Test the configuration using some of the suggestions below.

Download this lab’s Packet Tracer File

You can also implement the lab using Cisco Modeling Labs – Personal (CML-P). CML-P (or simply CML) replaced Cisco Virtual Internet Routing Lab (VIRL) software in 2020, in effect serving as VIRL Version 2.

If you prefer to use CML, use a similar workflow as you would use if using Cisco Packet Tracer, as follows:

  1. Download the CML file (filetype .yaml) linked below.
  2. Import the lab’s CML file into CML and then start the lab.
  3. Compare the lab topology and interface IDs to this lab, as they may differ (more detail below).
  4. Add your planned configuration to the lab.
  5. Test the configuration using some of the suggestions below.

Download this lab’s CML file!

Network Device Info:

This table lists the interfaces listed in the lab exercise documentation versus those used in the sample CML file.

Device Lab Port  CML Port
Dist1 G1/0/1 G1/1
Dist1 G1/0/2 G1/2
Dist1 G1/0/4 G1/0
Dist2 G1/0/1 G1/1
Dist2 G1/0/2 G1/2
Dist2 G1/0/3 G1/3

Lab Answers Below: Spoiler Alert

Lab Answers: Configuration (Click Tab to Reveal)

Lab Answers


Figure 1: Layer 3 Topology for this Lab


Example 1: Dist1 Config


Example 2: Dist2 Config

Commentary, Issues, and Verification Tips (Click Tabs to Reveal)

Lab Commentary

Although you configure a pair of switches for this lab, the configuration uses commands associated more with routing than switching because the lab enables routing on the switches.

First, most Cisco switches capable of routing – that is, layer 3 switching – require the ip routing global command. Note that in some switch models, you may also need to use another command to enable some low-level hardware functions in the switch ASIC so that the ASIC will perform routing. Because those commands vary from device to device, this lab does not require adding any such command.

Next, the lab specifically asks you not to use Switched Virtual Interfaces (SVIs) but instead use the physical ports as routed ports instead of as switch ports. Using the no switchport interface subcommand, you tell the switch to stop using layer 2 switching logic on the port but instead use layer 3 routing logic, making that port a routed port.

Once the switch treats a port as a routed port, it allows the direct configuration of an IP address and mask on the port. Note that before you issue the no switchport command, the ip address interface subcommand is rejected.

Finally, the two commands suggested to enable OSPF should enable OSPF on all three ports on each distribution switch, placing those in OSPF area 0. Both R1 and R2 use identical OSPF configuration. Once OSPF has time to form neighbor relationships and converge, all four devices should learn routes to all six subnets and be able to ping all other devices’ interface IP addresses.

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 ASIC configuration To perform this lab in Cisco PT, you do not need to use any hardware-focused command to enable IP routing entries in the switch ASIC, eg, sdm prefer lanbase-routing. On real switches, you might need to enable L3 switching with such a command.


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.

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. 

  1. The distribution switches act as layer 3 switches, routing IP packets. The links between the routers and layer 3 switches include six subnets. Confirm each switch has routes to all six of those subnets using the show ip route command.
  2. For each distribution switch, ping the IP address of the device on the other end of each link.

More Labs with Related Content!

Config Lab: Layer 3 Switching w/ SVIs
Config Lab: L3 EtherChannel 1
Wendell Odom
By Wendell Odom September 17, 2021 17:05
Write a comment


  1. almeidajoaodealmeida December 4, 23:29

    For those who copy the initial configs(just like me) :), don’t forget to enable the router interfaces.

    Reply to this comment
  2. Jay Mahannah February 4, 10:45

    Good tip almeidajoaodealmeida!

    I thought “ip routing” would allow me to enter the IPs for the layer 3 switch but the key was actually “no switchport”. This is my big takeaway here.

    Reply to this comment
View comments

Write a comment

Comment; Identify w/ Social Media or Email


Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.