Config Lab: Layer 3 Switching w/ SVIs

 In 200-301 V1 Ch18: Routing in LANs, 200-301 V1 Part 5: IPv4 Routing, 200-301 V1 Parts, Config Lab, Config Lab CCNA Vol 1 Part 5, Hands-on

Layer 3 switches, aka multilayer switches, route packets using the same logic as IP routers. A layer 3 switch can simultaneously support layer 2 features such as LAN switching and VLANs. To route packets for devices in those VLANs, the switch needs a switched virtual interface (SVI): An interface enabled for layer 3 processing that in effect connects to the VLAN. In this lab, you configure two switches to act as layer 3 switches to support two different VLANs.

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 begins with a working network. It shows two PCs, each in two separate VLANs/Subnets. To start the lab, PCs in the same subnet/VLAN can ping each other. However, PCs in different subnets cannot ping each other to begin the lab. Therefore, you need to configure layer 3 switching on the two distribution switches to route packets between the subnets.

Once you understand the initial configuration, configure distribution switches Dist1 and Dist2 with SVIs – VLAN interfaces – for VLAN 10 and VLAN 11. Use the following details:

  1. For VLAN 10, create and configure a VLAN 10 interface:
    1. For Dist1, use address/mask 10.1.10.1/24.
    2. For Dist2, use address/mask 10.1.10.2/24.
  2. For VLAN 11, create and configure a VLAN 11 interface:
    1. For Dist1, use address/mask 10.1.11.1/24.
    2. For Dist2, use address/mask 10.1.11.2/24.

Figure 1: Topology for this Lab

 

Figure 2: Layer 3 Topology – Subnet 10

 

Figure 3: Layer 3 Topology – Subnet 11

 

Initial Configuration

The four switches begin with VLAN, VLAN trunking, and STP configuration to support the two VLANs used in this lab (VLANs 10 and 11.) The STP config causes switch Dist1 to be the root switch for VLAN 10 and Dist2 to be the root switch for VLAN 11. All switch-to-switch links act as VLAN trunks. For information about the PCs and the router, look below these next four examples.

hostname Dist1
!
vtp mode transparent
vlan 10,11
!
spanning-tree vlan 10 root primary
spanning-tree vlan 11 root secondary
!
interface range GigabitEthernet1/1/1-4
 switchport mode trunk

Example 1: Dist1 Config

 

hostname Dist2
!
vtp mode transparent
vlan 10,11
!
spanning-tree vlan 11 root primary
spanning-tree vlan 10 root secondary
!
interface range GigabitEthernet1/1/1-4
 switchport mode trunk

Example 2: Dist2 Config

 

hostname Access3
!
vtp mode transparent
vlan 10,11
!
interface range GigabitEthernet1/1/1-2
 switchport mode trunk
!
interface GigabitEthernet1/0/11
 switchport mode access
 switchport access vlan 10
!
interface GigabitEthernet1/0/21
 switchport mode access
 switchport access vlan 11

Example 3: Access3 Config

 

hostname Access4
!
vtp mode transparent
vlan 10,11
!
interface range GigabitEthernet1/1/1-2
 switchport mode trunk
!
interface GigabitEthernet1/0/12
 switchport mode access
 switchport access vlan 10
!
interface GigabitEthernet1/0/22
 switchport mode access
 switchport access vlan 11

Example 4: Access4 Config

 

The four PCs connect to two different access VLANs and subnets, as follows:

  • PC11 and PC12: VLAN 10, subnet 10.1.10.0/24, gateway 10.1.10.1.
  • PC21 and PC22: VLAN 11, subnet 10.1.11.0/24, gateway 10.1.11.2.

 

Address: 10.1.10.11
Mask: 255.255.255.0
Gateway: 10.1.10.1

Example 5: PC11 Configuration Settings

 

Address: 10.1.10.12
Mask: 255.255.255.0
Gateway: 10.1.10.1

Example 6: PC12 Configuration Settings

 

Address: 10.1.11.21
Mask: 255.255.255.0
Gateway: 10.1.11.2

Example 7: PC21 Configuration Settings

 

Address: 10.1.11.22
Mask: 255.255.255.0
Gateway: 10.1.11.2

Example 8: PC22 Configuration Settings

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 used in the lab exercise documentation that differ from those used in the sample CML file.

Device Lab Port  CML Port
Dist1 G1/1/2 G1/2
Dist1 G1/1/3 G1/3
Dist1 G1/1/4 G1/0
Dist2 G1/1/1 G1/1
Dist2 G1/1/3 G1/3
Dist2 G1/1/4 G1/0
Access3 G1/1/1 G1/1
Access3 G1/1/2 G1/2
Access3 G1/0/11 G0/1
Access3 G1/0/21 G0/2
Access4 G1/1/1 G1/1
Access4 G1/1/2 G1/2
Access4 G1/0/12 G0/1
Access4 G1/0/22 G0/2

Lab Answers Below: Spoiler Alert

Lab Answers: Configuration (Click Tab to Reveal)

Lab Answers

Figure 1: Topology for this Lab


ip routing

interface vlan 10
 ip address 10.1.10.1 255.255.255.0
!
interface vlan 11
 ip address 10.1.11.1 255.255.255.0

Example: Dist1 Config


ip routing
!
interface vlan 10
 ip address 10.1.10.2 255.255.255.0
!
interface vlan 11
 ip address 10.1.11.2 255.255.255.0

Example: Dist2 Config

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

Lab Commentary

First, to configure the lab as requested, you simply need to create VLAN interfaces and configure the IP address and mask information as noted in the lab. 

Note that in production networks, you would normally include a First Hop Redundancy Protocol (FHRP) like Hot Standby Router Protocol (HSRP). With HSRP, both layer 3 switches would share an IP address in each subnet, and the PCs would use that IP address as their default gateway address. Both layer 3 switches could then mutually support each other, handling the routing load if the other device fails.

Note that in this lab, because all the PCs refer to the IP addresses on Dist1 as their default gateway, Dist1 will do all the routing in this small lab. Dist2 does not perform any routing. We included both layer 3 switches for extra configuration practice and to let you ponder the issues related to using multiple layer 3 switches.

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 between the two subnets. Verify the routing tables on each using the show ip route command.
  2. The distribution switches act as the default gateway for the PCs. Use the ping command on the PCs to test whether the PCs can ping their respective default gateways.
  3. Once configured, PCs in one subnet should be able to successfully ping PCs in the other subnet. Use ping to test connectivity between PCs in different subnets.

More Labs with Related Content!

Config Lab: Layer 3 Switching 2
Config Lab: Layer 3 Switching w/ Routed Ports
Subscribe
Notify of
guest

24 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Raed

You are forgot ” IP ROUTING ” global configration command on distbrution switches

certskills

added just now. Thanks, Raed!

Emil

Hi Wendell, the answer config for both switches are still not showing the “ip routing” command.

Frank

Hi Wendell,

Following up on the comment of Raed. I didn’t use the ip routing command, but after creating the. SVI’s on both dist switches and checking the ip routing table, I noticed everything was working. I was able to ping every PC. I did the lab in CML btw.

So, I’m unsure why this is the case when I haven’t specifically enabled ip routing manually. How can you verify if ip routing is enabled in the first place, does the fact I get output from the command show ip route confirms it is enabled? Should it be mentioned in the running config?

Hope you can clear this up for me.

Thanks!

certskills

Hi Frank,
First, let’s consider real Cisco switches. Most Cisco switches built for enterprises support some kind of layer 3 switching. Some are almost certainly used as layer 3 switches, being intended as distribution or core switches, while others, typically access switches, are more commonly used as layer 2 switches. So, it’s pretty common for Cisco switches to ship with default settings that do not enable layer 3 switching and IP routing. So on those real switches, you would need to do two commands before you could configure SVIs and have IP routing work:
the **ip routing** global command
Some other command, platform-dependent, that changes how the switch’s forwarding ASIC allocates entries, so it allocates some for layer 3 entries.

**ip routing** is a non-default command on a switch. So, how to know if it is or isn’t set?
**show run** – if NOT there, the switch default of **no ip routing** should be expected. If there, **ip routing** has been configured.
**show ip route** – if **ip routing** is configured, you see the legend of routing codes, even if there are no routes. if the default of **no ip routing** is in use, then you some different output that’s NOT the IP routing table.

Last thing on real switches – I’ve never attempted to track the defaults across Cisco’s entire product line. Some switches may come with **ip routing** as the default setting… so think of the above as the normal behavior on access switches that are layer 3 capable.

Then, on Cisco Packet Tracer, it depends on the switch model as to whether you need to add the **ip routing** command. To make this lab work correctly, I used the PT’s simulated 3650 switches. Real 3650s do support layer 3 switching. Anyway, whether a default or not, **ip routing** must be set (explicitly, or by default) for IP routing to work. I just checked, and you can too. If you download the original .pkt file for this lab, and open the console of DIST1, and do those checks above, you’ll see (a) the absence of **ip routing** and (b) something other than the IP routing table in response to **show ip route**. Configure just that command, and you’ll see signs of IP routing.

Hope this helps…
Also, check out Chapter 17 of the CCNA OCG Vol 1 for more depth on this entire topic.

certskills

PS: You did the lab, without **ip routing** configured, and it worked, and even the pings worked. On real switches it would not have worked. So I’ll get something put together on that new “feature” of PT. Thanks!
Wendell

Frank

Hi Wendell,

Thanks for reaching out and clearing this up, it does help!
It’s good to know how I can check this and to know that the lab I actually did wasn’t supposed to work.

Just bare in mind, I did the lab in CML and not in Packet Tracer.

Thanks again!

Frank

Went back to the lab to check out the ip routing settings like you explained. I must be doing something wrong or the switches in CML aren’t capable of ip routing (which I don’t believe) because the config wont show the ip routing anywhere after I issued the command from global config. Very confused on why I got it working in the first place if the ip routing isn’t enabled.

Sorry to keep bothering you with this, I’d really appreciate your insight on this.
Thanks!

Frank

Couldn’t let it go so I turned Google upside down and think I figured it out, sorry to spam you so much. Tried to edit my previous comment but I don’t think thats possible.

The fact nothing showed up in the running config after enabling ip routing was really bothering me. And I found out that you can do a show run all command, which list probably everything you can enable or configure, right? So when I did the command show run all | include routing the output was:

ip routing protocol purge interface
ip routing
service-routing capabilities-manager
event manager detector routing bootup-delay 0

So I’m guessing this would mean that ip routing is in fact turned on and it’s a default actually (checked it on a newly deployed switch and it shows the same output).

So I guess that explains why it did work earlier without me enabling it manually. Took me long enough to figure it out, but eventually with the help of you and Google I got there 🙂

Thanks again for your help again Wendell, really appreciate it!

Frank

certskills

You’re welcome, and no worries on the posts. When I have less time, well, you may not hear for a while. 🙂 I just like doing it. Anyway…

Because you’re using CML, try a **show run all**. It shows all non-default settings too. You’ll see the **ip routing** command there. But not when using only **show run**. Which tells me… **ip routing** is the default in that image.

Anyway, I don’t think you’re doing anything wrong. I think you’ve discovered a feature of the CML IOSL2 image in that it appears **ip routing** is the default in that image. That is, if you add a new IOSL2 image to that topology:

show run – does not display **ip routing**
show ip route – displays the legend of routing codes, indicating **ip routing** is configured

Then, if you configure **no ip routing**
show run – displays **no ip routing**, confirming that’s NOT a default setting
show ip route – No longer displays the legend of routing codes, indicating **no ip routing** is configured

Hope this helps…
Wendell

certskills

Frank – comments passed in the Ether. Glad you figured it out!

Vicente Torres

Hi Wendell,

An observation. The picture shows interface G1/1/2 of switch Dist1 as a link to Dist2. But in the config shows G1/1/1 (Packet Tracer File).

Best regards.

covah17

unable to open file. the file is not compatible with this version of Cisco PT (8.1.1)

Juan Camilo

Hi Wendell,

I successfully did this lab according to the solution shown here. But it seems on PacketTracer version 8.2.0.0162 It’s not working correctly.

If I do >show ip route on either of Dist switches I get an empty routing table with the message “ICMP redirect cache is empty”

I’m not sure if there is something else missing in the PT file, as just creating vlan interfaces on both Dist switches is not enough.

Thank you

Tewa

Hello Wendell,

Please a question not related to this lab. Back in chapter 6 of ccna study guide, you discussed management ip address for the switch and the fact that the address is configured using SVI. I would assume L3 switch still needs a management ip address? How/where would I configure a management ip on a L3 switch and differentiate it from other ip addresses on the switch using SVI? Or can any of the ip addresses on the switch be used as management ip address for the switch? Don’t know if my question makes sense.

Tom

Hi Wendell,

I’m a bit lost why we configure 4 different IP addresses on the vlan interafaces:

  1. For VLAN 10, create and configure a VLAN 10 interface:
  2. For Dist1, use address/mask 10.1.10.1/24.
  3. For Dist2, use address/mask 10.1.10.2/24.
  4. For VLAN 11, create and configure a VLAN 11 interface:
  5. For Dist1, use address/mask 10.1.11.1/24.
  6. For Dist2, use address/mask 10.1.11.2/24.

The 2 different subnet requires 2 different gateways only as per my understanding:
Gateway: 10.1.10.1
Gateway: 10.1.11.2

the 10.1.10.2 and the 10.1.11.1 seems redundant to me. I dont understand, can you please explain?

Tom

Very well explained, thank you!

Tewa

Hello Wendell,

Please a question. I am reviewing some topics and came across a question I had left on the margins of a page and still can’t wrap my head around the reason for the configuration option. I would appreciate if you can shed some light on this.
Vol 1, Chapter 17, page 402, figure 17-3. You indicated Vlan 30 was needed to connect the L3 switch to the physical router, why is that? Why is there a need to create a vlan interface to be able to connect to the router. Is it not sufficient to just connect both interfaces with a cable, assign them ip addresses in the same subnet and have them route traffic?

Sana

so we have to use( sdm prefer )command to enable routing if a lab like this comes in exam?how to chk if we need this command or not like is there any show for this sdm command?

to confirm:
if our physical interface is up then we dont need to use no shut for svi’s (as they are virtual)?

thanks

Last edited 4 months ago by Sana
Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

24
0
Would love your thoughts, please comment.x
()
x