What Does Layer 3 switch Mean?
On This Page
What do you want to do?
Quick Definition
A Layer 3 switch is a network device that moves data between devices on the same network very quickly, just like a regular switch, but it can also make decisions about where to send data that needs to go to a different network. It does this by reading IP addresses, which is something routers do. This makes it useful for connecting different parts of a large office or building network without needing a separate router for every connection.
Common Commands & Configuration
enable
configure terminal
ip routingGlobally enables IP routing on the Layer 3 switch, allowing it to route between VLANs. Without this command, the switch acts only as a Layer 2 device.
CCNA and Network+ often ask: 'What command enables routing on a multilayer switch?' The answer is 'ip routing' in global configuration mode.
interface vlan 10
ip address 192.168.10.1 255.255.255.0
no shutdownCreates and configures a Switch Virtual Interface (SVI) for VLAN 10 with the IP address that serves as the default gateway for hosts in that VLAN.
Common CCNA exam scenario: configuring an SVI and understanding that the VLAN must exist and have active ports for the SVI to come up. The 'no shutdown' command is often forgotten.
interface gigabitethernet 0/1
no switchport
ip address 10.0.0.1 255.255.255.252
no shutdownConverts a switch port into a routed Layer 3 interface (no longer a switchport) and assigns an IP address, typically used for router-to-switch or switch-to-router connections.
CCNA tests the concept of 'routed ports' and the 'no switchport' command. Also appears in Network+ as a method to create a Layer 3 link.
access-list 100 permit tcp 192.168.1.0 0.0.0.255 any eq 80
access-list 100 deny ip any any
interface vlan 10
ip access-group 100 inCreates an extended ACL that permits HTTP traffic from network 192.168.1.0/24 to any destination, denies all other traffic, and applies it inbound on VLAN 10 SVI.
Security+ and CCNA focus on ACL order, implicit deny, and the difference between standard and extended ACLs. This example tests understanding of 'access-group' on Layer 3 interfaces.
ip route 0.0.0.0 0.0.0.0 10.0.0.2Configures a default static route on the Layer 3 switch, pointing all unknown traffic to the next-hop IP address 10.0.0.2, typically a router or firewall for internet access.
Network+ and CCNA ask for the command to set a default gateway on a Layer 3 device. The syntax differs from a host's 'ip default-gateway' command, which is for Layer 2 switches.
router ospf 1
network 10.0.0.0 0.255.255.255 area 0Enables OSPF routing process 1 and advertises networks in the 10.0.0.0/8 range into area 0, allowing the Layer 3 switch to exchange routes with adjacent routers.
CCNA requires understanding of OSPF configuration, wildcard masks, and area design. This command tests the difference between 'network' statements in OSPF vs. enhanced interior gateway routing protocol (EIGRP).
ip dhcp snooping vlan 10
interface gigabitethernet 0/24
ip dhcp snooping trustEnables DHCP snooping for VLAN 10 and marks a specific uplink port as trusted to prevent rogue DHCP server attacks. All other ports are untrusted by default.
Security+ and CCNA Security test DHCP snooping as a defense against DHCP spoofing. The trust boundary is critical; configuring a trunk port to the DHCP server as trusted is a common step.
Layer 3 switch appears directly in 9exam-style practice questions in Courseiva's question bank — one of the most-tested concepts on Cisco CCNA. Practise them →
Must Know for Exams
The concept of a Layer 3 switch is a recurring theme in several major IT certification exams. Understanding it is not just about knowing the definition but about understanding the network architecture decisions it enables and how it differs from other devices.
For the CCNA (Cisco Certified Network Associate), the Layer 3 switch is a core concept. The exam objectives, particularly under “Network Access” and “IP Connectivity,” explicitly test inter-VLAN routing methods, including the configuration of a multilayer switch using Switch Virtual Interfaces (SVIs). You can expect multiple-choice questions asking which technology allows a switch to perform routing functions, as well as troubleshooting scenarios where a client in one VLAN cannot reach a server in another. The correct solution often involves configuring an SVI on the Layer 3 switch and enabling IP routing. Also, routing protocol configuration (OSPF, EIGRP) on a Layer 3 switch is a standard topic for the CCNA.
For the Network+ (CompTIA Network+), the Layer 3 switch appears in the context of network devices and their functions. The exam expects you to know that a switch operates at Layer 2 and a router at Layer 3, but also that a multilayer switch can operate at both. You may be asked to select the appropriate device for a given scenario, such as “Which device would you use to connect multiple VLANs and provide high-speed routing within a building?” The answer is a Layer 3 switch. The exam also covers the OSI model, and you must know that routing is a Layer 3 function.
For the AWS Certified Solutions Architect – Associate (AWS SAA), the Layer 3 switch is not a direct exam objective, but it provides crucial background knowledge. AWS follows a “stateless, simple network” philosophy, so you will not configure a physical Layer 3 switch in the cloud. However, understanding the concept helps you grasp how virtualized network functions work in AWS. For example, a Virtual Private Cloud (VPC) acts like a giant Layer 3 router, and its route tables and subnets are analogous to the routing table and SVIs of a physical Layer 3 switch. You will need to understand how traffic is routed between subnets in a VPC (which is implicit routing, similar to a Layer 3 switch).
For the CompTIA Security+, the Layer 3 switch is relevant in a security context. The exam covers segmentation and VLANs as security mechanisms. A Layer 3 switch is the device that enforces these segmentations by routing between them. You should understand that a Layer 3 switch can be used to implement a DMZ (demilitarized zone) by routing traffic between the internal, DMZ, and external subnets while applying ACLs to filter traffic.
For Azure AZ-104, the Layer 3 concept is analogous to Azure Virtual Network peering and routing. Azure’s virtual network routers perform Layer 3 functions, and understanding the physical concept of a Layer 3 switch makes it easier to understand how Azure routes traffic between virtual networks and subnets.
For Google ACE (Associate Cloud Engineer), similar to AWS, the exam expects you to understand routing and subnetting in Google Cloud VPCs. The physical device concept of a Layer 3 switch is not tested directly, but the routing concepts are fundamental.
For CompTIA A+, the topic is very light. You may see a basic question asking if a switch can route, but it is not a primary objective. The term might appear in a list of network devices, but the depth of understanding required is minimal.
Simple Meaning
Imagine you are in a huge office building with many departments, like Sales, Engineering, and HR, each on a different floor. Now, think of a regular Layer 2 switch as a super-efficient mailroom clerk on your floor. This clerk knows every single desk on that floor, so when you want to send a memo to someone on the same floor, the clerk delivers it instantly. But if you want to send a memo to the Engineering floor, this clerk has no idea where that is. The memo would just sit there.
A Layer 3 switch is like having a mailroom clerk on your floor who is also the building’s postmaster. This clerk still knows every desk on your floor and can deliver memos instantly within the same floor. But when you hand them a memo for Engineering, they don't get confused. They look at the memo’s address, recognize that it’s for a different floor, and then make a decision. They know the quickest route to reach Engineering, possibly by taking the elevator to the third floor. They then hand the memo to the mailroom clerk on that floor, who delivers it to the right desk.
In technical terms, the “floor” is your local network segment, often called a VLAN (Virtual Local Area Network). The “desk” is a device like your computer. The regular switch (Layer 2) uses MAC addresses to talk to devices on the same VLAN. The Layer 3 switch, however, sees the IP address, which tells it that the destination is not on the local VLAN. It then uses a routing table, like a map of the building, to find the correct path to the other VLAN. This built-in routing capability is what makes it a “Layer 3” device, because it makes decisions based on the Network Layer (Layer 3) of the OSI model, not just the Data Link Layer (Layer 2).
The biggest advantage is speed. Because the routing logic is built into the hardware using specialized chips (ASICs), a Layer 3 switch can route data between different networks at the same lightning-fast speed as it switches data within a network. This is much faster than a traditional router, which processes these decisions in software. This is why large companies, data centers, and campus networks use Layer 3 switches to connect many different VLANs and subnets without slowing down the network.
However, a Layer 3 switch is not a replacement for a full-featured router. Routers usually have more advanced features like Network Address Translation (NAT), which allows many devices to share one public internet address, and advanced security features like firewalls. A Layer 3 switch focuses on fast internal routing, while a router is typically used to connect your entire internal network to the internet or to a wide area network (WAN).
Full Technical Definition
A Layer 3 switch, also known as a multilayer switch (MLS), is a network device that performs the functions of both a Layer 2 switch and a Layer 3 router within a single hardware chassis. Its primary purpose is to provide high-performance routing and switching within a local area network (LAN) or a campus network, efficiently handling traffic both within a single broadcast domain and between multiple broadcast domains or subnets.
At its core, a Layer 3 switch leverages Application-Specific Integrated Circuits (ASICs) for packet forwarding. ASICs are custom-designed chips that can process packets at wire speed, meaning they can forward packets as fast as the network interface can receive them. This is in contrast to traditional routers, which often rely on general-purpose CPUs and software-based routing tables, leading to higher latency and lower throughput. The ASICs in a Layer 3 switch can inspect both the Layer 2 MAC header and the Layer 3 IP header simultaneously. For traffic that is destined for a device on the same VLAN, the switch uses its MAC address table to forward the frame at Layer 2. For traffic destined for a different subnet or VLAN, the switch performs a Layer 3 route lookup.
The fundamental process by which a Layer 3 switch routes between VLANs is known as “route once, switch many.” The first packet in a new flow destined for a different VLAN is handled by the switch’s routing engine. The switch looks at the destination IP address, consults its routing table, determines the next-hop IP address, and rewrites the Layer 2 frame header with the destination MAC address of the next-hop device (which might be the destination device itself if it is on a directly connected network). This process is known as “hardware switching” or “ASIC switching.” The switch then installs a forwarding entry in its hardware (the ASIC’s Ternary Content-Addressable Memory, or TCAM) for that specific flow. All subsequent packets in the same conversation are forwarded directly by the ASIC at wire speed, bypassing the routing engine entirely.
Layer 3 switches support dynamic routing protocols such as OSPF (Open Shortest Path First), EIGRP (Enhanced Interior Gateway Routing Protocol), and static routing. This allows them to build and maintain routing tables automatically, enabling the network to adapt to changes in topology, such as a link failure. They also support VLAN tagging according to the IEEE 802.1Q standard, allowing them to trunk multiple VLANs over a single physical link.
In an enterprise IT implementation, a Layer 3 switch is typically deployed as a distribution layer device in the classic three-tier hierarchical network model (Access, Distribution, Core). The access layer switches (Layer 2) connect end-user devices like workstations and printers. These access switches connect to the distribution Layer 3 switches, which act as the aggregation point for multiple VLANs. The distribution switches perform routing between VLANs, enforce policies (like access control lists), and provide redundant connections to the core layer. The core layer, which is often composed of high-speed Layer 3 switches or routers, provides the backbone for high-speed transport between distribution blocks.
Key standards and protocols relevant to Layer 3 switches include RFC 1812 for router requirements, IEEE 802.1D for bridging and switching, IEEE 802.1Q for VLAN tagging, and the various routing protocol RFCs. The switch also uses Address Resolution Protocol (ARP) to map IP addresses to MAC addresses for devices on its directly connected subnets. This ARP table is essential for the initial step of routing, as the switch must know the MAC address of the destination or the next-hop router before it can rewrite the Layer 2 header.
A common configuration for a Layer 3 switch involves creating a Switch Virtual Interface (SVI) for each VLAN. For example, if you have VLAN 10 for Sales and VLAN 20 for Engineering, you would create an SVI interface for each and assign them IP addresses from the respective subnets (e.g., 10.0.10.1/24 for VLAN 10 and 10.0.20.1/24 for VLAN 20). These SVIs act as the default gateway for devices in those VLANs. The Layer 3 switch then routes traffic between the two SVIs using its routing table.
In data center environments, Layer 3 switches are often used in a spine-leaf architecture, providing high-bandwidth, low-latency connectivity between servers in the same rack (leaf) and between racks (spine). The switch’s ability to route traffic at line rate is critical for modern applications that generate east-west traffic (traffic between servers within the data center).
Real-Life Example
Think of a large corporate campus with three separate buildings: Building A (Finance), Building B (Engineering), and Building C (HR). Each building has its own internal phone system for calling people within the same building. This is like a Layer 2 switch-it is great for internal calls, but if someone in Finance needs to call someone in Engineering, the finance phone system simply doesn’t know how to connect the call. You would need to hire a central operator (a router) to handle calls between buildings.
Now, imagine that each building gets a smart switchboard operator at the front desk. This operator knows every extension inside their own building and can connect calls instantly. But this operator also has a map and a phone directory for the other buildings. When a person in Finance dials an Engineering extension, the Finance operator looks at the area code (which is like the IP subnet), sees it is not local, and immediately routes the call over a dedicated line to the Engineering operator. That Engineering operator then connects the call to the correct desk. This smart operator is your Layer 3 switch.
Here is the key advantage: the smart operator does not have to call the central operator for every single call. The map and routing are built into their own console. So, the connection between Finance and Engineering happens almost as fast as a call within the same building. In network terms, this means a Layer 3 switch can route packets between different VLANs (buildings) at the same speed it switches packets within a single VLAN.
Let us map this back to IT. The “building” is a VLAN or a subnet. The “extension number” is a device’s IP address, and the “local desk” is the MAC address. The smart operator’s internal console is the ASIC hardware that does the fast routing. The operator’s map and directory are the routing table and ARP table. The dedicated line between the operators is the trunk link connecting the Layer 3 switch to other network segments.
This analogy also highlights the limitation. If the Engineering operator needs to call someone outside the campus, say a client in another country, the smart operator cannot do that because they only have maps for the campus buildings. They would have to forward that call to a dedicated international operator (the internet router) who handles external calls. This is why a Layer 3 switch is used for internal routing within a large site, while a WAN router handles the connection to the internet or other remote offices.
Why This Term Matters
In modern enterprise networks, the Layer 3 switch is a critical component for achieving both performance and scalability. Without it, network designers would face a difficult choice: use a single flat network (which is insecure and prone to broadcast storms) or insert a traditional router between every subnet, which would create a bottleneck and increase latency. The Layer 3 switch solves this by delivering routing functionality at switching speeds.
For IT professionals, understanding Layer 3 switching is essential for designing efficient networks. When you have multiple VLANs, you need inter-VLAN routing. Using a router-on-a-stick topology (where a single router interface is connected to a switch and handles all inter-VLAN traffic) can work for small networks, but the bandwidth is limited by the speed of the router’s interface. A Layer 3 switch, however, has multiple internal routing paths and ASICs, allowing it to handle hundreds of gigabits of inter-VLAN traffic without breaking a sweat.
Layer 3 switches support advanced features like policy-based routing (PBR), quality of service (QoS), and access control lists (ACLs) that can be applied to routed traffic. This allows a network administrator to prioritize voice traffic over regular data traffic, even when it is crossing VLAN boundaries. It also allows for the creation of security policies that block traffic between specific subnets, such as preventing guest Wi-Fi users from accessing the corporate server VLAN, all while maintaining high throughput.
The decision of where to place Layer 3 switches in the network hierarchy directly impacts performance and cost. Using them at the distribution layer reduces the load on the core router, allowing the core to focus on high-speed transport. It also localizes routing, meaning that a device in VLAN 10 and VLAN 20 within the same building can communicate without ever sending traffic to the core, which reduces latency and core bandwidth utilization.
How It Appears in Exam Questions
Exam questions about Layer 3 switches typically fall into several patterns: scenario-based, configuration, and troubleshooting.
Scenario-based questions often present a network topology and ask the test taker to identify the correct device. For example, a CCNA question might state: “A company has 10 VLANs. A router is currently handling inter-VLAN traffic using a single trunk link to the switch. The network performance is suffering. Which device should be installed to improve performance?” The answer is a Layer 3 switch. The reasoning is that it can route between the VLANs using internal hardware, eliminating the bottleneck of the single router link.
Another common scenario is cost and complexity. A question might ask: “A small office needs to connect two separate subnets. Which device provides the simplest and most cost-effective solution?” The answer might be a Layer 3 switch, as it eliminates the need for a separate router and a separate switch.
Configuration-related questions appear mainly in Cisco exams (CCNA, CCNP). A question might provide a snippet of a running configuration and ask what the configuration does. For example, you might see:
``` interface Vlan10 ip address 10.0.10.1 255.255.255.0 ! interface Vlan20 ip address 10.0.20.1 255.255.255.0 ! ip routing ```
A question would then ask: “What is the purpose of the above configuration on a switch?” The correct answer is: “To enable routing between VLAN 10 and VLAN 20 on a Layer 3 switch.” They might ask what command is missing (e.g., `ip routing` is needed, or `no switchport` if using a routed port instead of an SVI).
Troubleshooting questions are also common. A scenario might describe that PCs in VLAN 10 can ping the default gateway (the SVI on the Layer 3 switch) but cannot ping a server in VLAN 20. Potential causes could be missing IP routing on the switch, an ACL blocking traffic, a misconfigured SVI, or a missing VLAN on the trunk. The test taker must deduce the cause.
For Network+, expect questions that test the difference in function: “Which of the following is a characteristic of a Layer 3 switch?” Options might include “Uses MAC addresses only” (wrong), “Routes traffic based on IP addresses” (correct), “Connects to the internet via a modem” (wrong). Another Network+ style question: “A network administrator wants to create multiple VLANs and allow devices on those VLANs to communicate without purchasing a separate router. Which device should they use?”
For Security+, the question might be security-focused: “Which feature of a Layer 3 switch can be used to implement a security policy that blocks traffic from the Guest VLAN to the Corporate VLAN?” The answer is an Access Control List (ACL).
Practise Layer 3 switch Questions
Test your understanding with exam-style practice questions.
Example Scenario
You are a network administrator for a medium-sized college. The college has three key networks: Student Network (VLAN 10, subnet 192.168.10.0/24), Faculty Network (VLAN 20, subnet 192.168.20.0/24), and Administration Network (VLAN 30, subnet 192.168.30.0/24). Each network has its own switch, and all these switches are connected to a central network closet. Currently, a single router with one interface is connected to a switch in the central closet. That router handles all traffic between the three networks. This is a “router-on-a-stick” setup.
You notice that during peak hours, the link between the central switch and the router is saturated, causing slow performance for everyone. Students cannot access faculty web pages, and administration cannot access student records. You have been asked to fix this.
Your solution is to replace the current distribution switch and the router with a single Layer 3 switch. Here is how it works: 1. You configure three SVIs on the Layer 3 switch: one for each VLAN (VLAN 10, VLAN 20, VLAN 30). You assign the IP addresses 192.168.10.1, 192.168.20.1, and 192.168.30.1 to these SVIs, respectively. These become the default gateways for the devices in each network. 2. You enable IP routing on the switch with the command `ip routing`. 3. You connect the access switches for each network to the Layer 3 switch using trunk ports carrying the respective VLANs.
Now, when a student (IP 192.168.10.5) wants to access a faculty server (IP 192.168.20.10), the packet is sent to its default gateway, which is the SVI for VLAN 10 (192.168.10.1). The Layer 3 switch’s ASIC inspects the destination IP, sees that it belongs to VLAN 20, and because the switch has a direct route between its own SVIs, it forwards the packet directly from VLAN 10 to VLAN 20. This entire process happens at hardware speed. The original router is now freed up, and the bottleneck is eliminated.
The result: performance improves dramatically because the Layer 3 switch is not a single point of congestion. It is a cost-effective solution because you replaced two devices (switch and router) with one. And the network is now more scalable-you can add VLAN 40 (Library) easily by creating another SVI.
Common Mistakes
Thinking a Layer 3 switch can replace an internet router in all cases.
A Layer 3 switch typically lacks the advanced WAN features, such as Network Address Translation (NAT), DHCP server, VPN termination, and stateful firewall capabilities, that are essential for connecting to the internet.
Use a Layer 3 switch for internal routing between LAN subnets, and use a dedicated router or firewall for the internet connection.
Believing that all switches are Layer 2 and cannot handle IP addresses.
Layer 3 switches (multilayer switches) are specifically designed to process IP headers and make routing decisions, operating at both Layer 2 and Layer 3 of the OSI model.
Remember that a simple managed switch is Layer 2, but an enterprise switch with routing capabilities is a Layer 3 switch.
Assuming that enabling IP routing on a Layer 2 switch will make it a Layer 3 switch.
IP routing requires specialized hardware (ASICs) to perform route lookups at high speed. A Layer 2 switch lacks this hardware and will fail or perform very poorly if forced to route.
Check the switch model specifications. Only switches explicitly called ‘Layer 3’ or ‘multilayer’ support hardware routing.
Configuring a routed port on a Layer 3 switch without removing the switchport mode.
By default, ports on a switch operate as Layer 2 switchports. To use a port as a Layer 3 routed interface, you must enter the global configuration mode and use the command `no switchport` on that specific interface. If you do not do this, the switch will try to switch the traffic instead of routing it.
When configuring a routed port, type `no switchport` on the interface. This changes the interface from Layer 2 to Layer 3 mode.
Confusing a Layer 3 switch with a load balancer.
A load balancer is a device that distributes traffic across multiple servers based on application-layer data (Layer 7) or health checks, whereas a Layer 3 switch routes packets based on destination IP addresses without inspecting the application payload.
Layer 3 switches route traffic between subnets; load balancers distribute traffic to specific servers within a subnet.
Exam Trap — Don't Get Fooled
{"trap":"The exam presents a scenario where a network has multiple VLANs and a router-on-a-stick, and asks what improvement would reduce latency. The trap option is: “Replace the router with a router with a faster CPU.”","why_learners_choose_it":"Learners might think that a faster router CPU would speed up routing, but they forget that the bottleneck is the speed of the single link between the router and the switch, not the CPU."
,"how_to_avoid_it":"Understand that routing between VLANs on a router-on-a-stick requires all traffic to traverse that single link. A Layer 3 switch routes within its own backplane, which is much faster and eliminates the single-link bottleneck. Always look for answers that ‘switch’ the routing function to the switch for internal VLANs."
Commonly Confused With
A Layer 2 switch forwards frames based solely on MAC addresses and operates within a single broadcast domain or VLAN. It cannot route between different subnets or VLANs without a separate router. A Layer 3 switch can do both forwarding and routing.
You connect two PCs in VLAN 10 to a Layer 2 switch. They can talk. If one PC is in VLAN 10 and another in VLAN 20, they cannot talk without a router or Layer 3 switch.
A router is a device dedicated to routing, but it typically uses software to process routing decisions, making it slower for LAN-to-LAN routing. A Layer 3 switch uses hardware ASICs for speed. Routers also support advanced WAN features like NAT and VPN that most Layer 3 switches do not.
For a home network, a router is great because it connects your home to the internet. For a large campus, a Layer 3 switch is better for connecting 50 different VLANs because it is faster.
This is a topology where a single router interface is used as a trunk to a switch to route between VLANs. It is slower because all inter-VLAN traffic must go through that one link. A Layer 3 switch internalizes the routing function, removing that bottleneck.
In a router-on-a-stick, a student in VLAN 10 sends traffic to a server in VLAN 20, the traffic goes from the switch to the router and back. With a Layer 3 switch, the traffic stays within the switch.
An access switch is a Layer 2 switch that connects end-user devices to the network. It does not have any routing capability. A Layer 3 switch is typically used as a distribution or core switch to aggregate multiple access switches and route traffic between them.
The switch on your desk that connects your computer is an access switch (Layer 2). The switch in the server room that connects all the floor switches is often a Layer 3 switch.
A firewall is a security device that filters traffic based on rules. It operates at multiple layers but typically acts as a gateway between networks. A Layer 3 switch can have ACLs for filtering, but it is not a stateful packet inspection (SPI) firewall and does not have the same security capabilities.
A Layer 3 switch can block traffic from VLAN 10 to VLAN 20 using an ACL, but it cannot perform deep packet inspection to detect malware. A firewall can.
Step-by-Step Breakdown
Packet Arrival
A device in VLAN 10 sends a packet to a device in VLAN 20. The source IP is 10.0.10.5, destination IP is 10.0.20.10. The source device realizes the destination is on a different subnet, so it sends the packet to its default gateway, which is the IP of the Layer 3 switch's SVI for VLAN 10 (10.0.10.1).
Layer 2 Frame Inspection
The Layer 3 switch receives the frame. It first looks at the destination MAC address in the Layer 2 header. The frame’s destination MAC is the MAC address of the SVI for VLAN 10. The switch confirms this is a packet addressed to itself (the switch).
Layer 3 Header Extraction
The switch then strips away the Layer 2 header and examines the Layer 3 IP header. It looks at the destination IP address: 10.0.20.10.
Route Table Lookup
The switch consults its routing table. The routing table, populated by either static routes or a dynamic routing protocol (like OSPF), indicates that the network 10.0.20.0/24 is directly connected to the SVI for VLAN 20. The next hop is the SVI itself (10.0.20.1).
ARP Table Check
The switch needs to know the MAC address of the destination device (10.0.20.10) to build a new Layer 2 frame. It checks its ARP (Address Resolution Protocol) table. If an entry exists, it uses that MAC address. If not, the switch sends an ARP request out of the VLAN 20 interface to discover the MAC address.
Frame Rewrite & Forwarding
The switch constructs a new Layer 2 frame. The source MAC address is the MAC address of the SVI for VLAN 20. The destination MAC address is the MAC address of the target device (10.0.20.10). The IP packet remains unchanged. The switch then forwards this new frame out of the appropriate port(s) that belong to VLAN 20.
Hardware Caching
The first packet in the conversation was processed by the routing engine. The switch then installs a hardware forwarding entry (in its TCAM) for this flow. All subsequent packets between 10.0.10.5 and 10.0.20.10 are switched by the ASIC at wire speed, bypassing the routing engine entirely.
Return Path
When the destination device replies, the process reverses. The reply packet arrives at the SVI for VLAN 20, and the switch routes it to VLAN 10 using the same process. The routing table and ARP cache are used symmetrically.
Practical Mini-Lesson
When you work as a network administrator, the Layer 3 switch is one of your most valuable tools for designing high-performance local networks. Practical deployment involves understanding when to use routing versus switching, how to configure SVIs, and how to troubleshoot inter-VLAN issues.
First, assess your network needs. If you have only one subnet and no need to separate traffic, a Layer 2 switch is sufficient. But if your organization segregates departments or functions into different VLANs (which is a security best practice), you will need a Layer 3 switch to route between them efficiently. The decision to use a Layer 3 switch is also a cost-performance analysis: a single Layer 3 switch can replace a separate router and a separate distribution switch, saving rack space and power.
Configuration in a Cisco environment typically begins with creating the VLANs globally. For example:
``` vlan 10 name Sales vlan 20 name Marketing ```
Next, you create the Switch Virtual Interface (SVI) for each VLAN and assign an IP address:
``` interface vlan 10 ip address 192.168.10.1 255.255.255.0 no shutdown
interface vlan 20 ip address 192.168.20.1 255.255.255.0 no shutdown ```
Then, you must enable IP routing globally on the switch. Without this, the SVIs will be created but will not route traffic between them:
``` ip routing ```
Finally, the ports that connect to your access switches should be configured as trunk ports that carry the respective VLANs:
``` interface GigabitEthernet0/1 switchport mode trunk switchport trunk allowed vlan 10,20 ```
Now, the switch can route between VLAN 10 and VLAN 20. However, practice also involves potential pitfalls. If you are using a dynamic routing protocol, you must configure it under the SVIs, not the physical ports. For example, for OSPF you would configure:
``` router ospf 1 network 192.168.10.0 0.0.0.255 area 0 network 192.168.20.0 0.0.0.255 area 0 ```
But the interface-level command is `ip ospf 1 area 0` under each SVI.
What can go wrong? One common issue is that the SVI for a VLAN goes down if there are no active ports in that VLAN on the switch. This is because the SVI is a virtual interface that is tied to the physical or logical existence of the VLAN. If all ports assigned to VLAN 10 are down, the SVI for VLAN 10 will also go down, and the switch will no longer be able to route traffic to that VLAN. This is a design consideration: you need at least one active port in that VLAN, or you can use the `autostate exclude` command on the SVI to prevent it from going down when no ports are active.
Another practical issue is the routing table. A Layer 3 switch has a limited amount of hardware memory (TCAM) to store routes. If you inject too many routes (e.g., full internet BGP table), the switch may run out of memory and start dropping packets or use software switching, which is slow. This is why Layer 3 switches are used for internal routing with a limited number of routes, not for internet edge routing.
From a security perspective, you can apply access control lists (ACLs) to the SVIs to control traffic between VLANs. For example, you can allow HTTP traffic from Marketing to the Web Server but block FTP, all while keeping the routing hardware fast.
Finally, remember the command `show ip route` to verify the routing table, `show ip arp` to verify the ARP cache, and `show ip interface brief` to verify SVIs are up/up. Troubleshooting inter-VLAN connectivity almost always starts with verifying these three items.
Layer 3 Switch Operation Principles
A Layer 3 switch, also known as a multilayer switch, is a network device that combines the functionality of a traditional Layer 2 switch with routing capabilities typically found in routers. Unlike a simple switch that forwards frames based on MAC addresses, a Layer 3 switch can make forwarding decisions based on IP addresses, enabling it to route traffic between different VLANs or subnets without requiring an external router. This is achieved through a process called 'route once, switch many,' where the first packet of a flow is routed via the control plane (using the routing table), and subsequent packets are switched at wire speed in hardware using the forwarding information base (FIB).
The FIB is populated by the routing process and cached in ternary content-addressable memory (TCAM), allowing for extremely fast lookups. Layer 3 switches typically support static routing, dynamic routing protocols (such as OSPF, EIGRP, and RIP), and VLAN trunking. They are widely used in enterprise networks to create efficient routed backbones without the latency overhead of a traditional router.
In exam contexts, the key distinction is that a Layer 3 switch uses ASICs for hardware-based routing, whereas a router often uses CPU-based processing. This makes Layer 3 switches ideal for high-speed local area networks where inter-VLAN routing is required. They also support ACLs (access control lists) at Layer 3 and often at Layer 4, providing packet filtering capabilities.
Understanding the control plane versus data plane separation is critical: the control plane handles routing protocols and builds the routing table (RIB), while the data plane handles the actual packet forwarding using the FIB. A common exam scenario involves configuring a Layer 3 switch to route between VLANs using an SVI (switch virtual interface) or a routed port. The SVI is a virtual interface that represents a VLAN and is assigned an IP address, acting as the default gateway for hosts in that VLAN.
The switch then uses its routing table to forward traffic between SVIs. Another important concept is the 'router on a stick' alternative, but a Layer 3 switch performs this function much more efficiently. For CCNA and Network+ exams, you must understand how a Layer 3 switch reduces broadcast domains and improves network performance by localizing traffic and only routing when necessary.
Security+ and AWS SAA exams may touch on how Layer 3 switches implement security policies via VLAN segmentation and ACLs, providing both performance and security benefits. Layer 3 switches are foundational for modern campus networks, offering high-performance routing features that are essential for designing scalable and secure network architectures.
Layer 3 Switch VLAN Routing Configuration
Configuring inter-VLAN routing on a Layer 3 switch is a critical skill tested in CCNA, Network+, and even Security+ exams. The process involves creating VLANs, assigning switch ports to those VLANs, creating SVIs (switch virtual interfaces) for each VLAN, and enabling routing on the switch. The first step is to create the VLANs using the 'vlan <vlan-id>' command in global configuration mode, optionally giving them descriptive names.
Next, access ports must be assigned to these VLANs using the 'switchport access vlan <vlan-id>' command on the respective interfaces. Alternatively, for trunk interfaces carrying multiple VLANs, you configure 'switchport mode trunk' and allow specific VLANs. After VLANs are set up, you create SVIs by entering interface configuration mode for a VLAN interface (e.
g., 'interface vlan 10') and assigning an IP address with a subnet mask. This IP address becomes the default gateway for hosts in that VLAN. Then, you must enable IP routing globally on the switch with the 'ip routing' command; without this command, the switch remains a Layer 2 device and will not route between VLANs.
Once IP routing is enabled, the switch automatically builds routes for directly connected networks (the SVIs). For route advertisement, you can add static routes or configure dynamic routing protocols like OSPF. For example, to configure OSPF, you enter router configuration mode with 'router ospf <process-id>' and then advertise networks using the 'network <network-address> <wildcard-mask> area <area-id>' command.
A common exam question might ask which command enables IP routing on a Layer 3 switch, with the correct answer being 'ip routing' in global config. Another frequent scenario involves configuring a 'port-channel' or etherchannel on a Layer 3 switch to bundle multiple physical links for redundancy and increased bandwidth, which can be configured as a routed interface using 'no switchport' on the port-channel interface. Also, understand that some switch models have dedicated routed ports (often GigabitEthernet ports) that can be configured with an IP address directly by using the 'no switchport' command, making them Layer 3 interfaces akin to router interfaces.
Troubleshooting inter-VLAN routing often involves verifying VLAN membership, SVI state (they must be up/up), and routing table entries. Commands like 'show ip route', 'show ip interface brief', and 'show vlan' are invaluable. In AWS SAA and Google ACE exams, the concept translates to VPC routing and subnet segmentation, but the underlying principle of Layer 3 switching remains similar.
For AZ-104, understanding Layer 3 switching helps in designing Azure virtual networks with route tables and NVAs. Mastering this configuration not only helps pass exams but also builds a strong foundation for real-world network design.
Layer 3 Switch Hardware Architecture and ASIC Role
The performance advantage of a Layer 3 switch over a traditional router lies in its hardware architecture, specifically the use of application-specific integrated circuits (ASICs). Unlike routers that rely on a general-purpose CPU for packet processing, Layer 3 switches use ASICs to perform packet forwarding at line rate, enabling wire-speed routing even with complex ACLs. The key component is the ternary content-addressable memory (TCAM), which stores the forwarding information base (FIB) and can perform lookups in a single clock cycle regardless of table size.
When a packet arrives, the switch extracts the destination IP address and performs an exact or longest prefix match lookup in the FIB. If a match is found, the packet is forwarded in hardware; if not, it is sent to the CPU for software routing. This 'deferred routing' or 'slow path' is only used for the first packet of a flow, after which the route is cached in the FIB for subsequent hardware switching.
The architecture also includes separate memory for MAC address tables, routing tables, and ACLs. Understanding this architecture helps in explaining why Layer 3 switches can handle millions of packets per second (pps), while routers may handle only hundreds of thousands. In exams like CCNA and Network+, you may be asked about the difference between a router and a Layer 3 switch in terms of forwarding mechanisms.
The correct answer often highlights that Layer 3 switches use ASICs for hardware forwarding, while routers use CPU-based software forwarding. Another important architectural feature is the backplane bandwidth; a Layer 3 switch must have sufficient switching fabric capacity to support all ports simultaneously at full duplex. For example, a 24-port gigabit switch requires at least 48 Gbps of backplane capacity for non-blocking performance.
Security+ and A+ exams might touch on how Layer 3 switches can apply hardware-based ACLs to filter traffic without impacting performance, unlike software-based firewalls. In real-world deployments, understanding this architecture helps when choosing between a Layer 3 switch and a router for a particular network segment. For instance, in a data center, Layer 3 switches are preferred for top-of-rack (ToR) switching to minimize latency.
In campus networks, they serve as distribution or core switches. Some advanced Layer 3 switches support features like VRF (Virtual Routing and Forwarding), which allows multiple routing instances on the same hardware, and MPLS (Multiprotocol Label Switching) for service provider environments. These features rely on TCAM and ASIC capabilities.
For AWS SAA and Google ACE, while the physical hardware is abstracted, understanding ASIC-based forwarding helps in comprehending the performance characteristics of cloud network services like AWS Transit Gateway or Google Cloud Router. Overall, the hardware architecture of a Layer 3 switch is what enables it to combine the flexibility of routing with the speed of switching, making it a cornerstone of modern high-performance networks.
Layer 3 Switch Security Implications and ACLs
Layer 3 switches are not just about speed and routing; they also play a vital role in network security, which is why topics related to them appear in Security+, CCNA, Network+, and even AWS SAA and AZ-104 exams. One of the primary security features implemented on Layer 3 switches is Access Control Lists (ACLs). ACLs can be applied to SVIs or routed ports to filter traffic based on source/destination IP addresses, protocols (TCP, UDP, ICMP), and port numbers.
For example, a standard ACL (numbered 1-99 or 1300-1999) filters only source IP addresses, while an extended ACL (100-199 or 2000-2699) provides more granular control. ACLs can be applied inbound or outbound on an interface, and they are processed in order; once a match is found, no further lines are evaluated. A common exam question asks about the implicit deny at the end of every ACL, which blocks all traffic that does not match any permit statement.
Understanding the placement of ACLs is critical: applying them on Layer 3 interfaces near the source can conserve bandwidth by dropping unwanted traffic early. Another security feature is the implementation of private VLANs, which restrict communication between ports within the same VLAN, preventing host-to-host attacks. Layer 3 switches also support DHCP snooping, dynamic ARP inspection (DAI), and IP source guard, which protect against DHCP spoofing, ARP poisoning, and IP address spoofing.
DHCP snooping filters untrusted DHCP messages, DAI validates ARP packets against the DHCP snooping database, and IP source guard ensures that only the assigned IP address can be used from a port. These features are heavily tested in Security+ and CCNA security sections. VLAN segmentation itself is a security measure; by placing sensitive systems in separate VLANs and routing between them via a Layer 3 switch with ACLs, you can enforce strict access control policies.
For example, HR data can be isolated from guest Wi-Fi traffic. In AWS SAA, the equivalent concept is using security groups and network ACLs to control traffic between subnets, but the Layer 3 switch principles remain analogous. AZ-104 covers Azure Network Security Groups (NSGs) which function similarly.
Another security consideration is the management plane: you should restrict access to the Layer 3 switch via SSH instead of Telnet, use authenticated routing protocols (like OSPF with MD5 authentication), and configure VTY access lists. The 'service password-encryption' command encrypts plaintext passwords in the config, though it is weak encryption. For exam purposes, remember that a Layer 3 switch can act as a firewall lite but not a full stateful firewall; it lacks deep packet inspection.
However, it can help implement a defense-in-depth strategy. In troubleshooting, an incorrect ACL might block all traffic, which is a common symptom. Using 'show access-lists' and 'show ip interface' helps verify ACL counters.
By understanding these security features, you not only prepare for exams but also build more resilient and secure networks.
Troubleshooting Clues
Inter-VLAN routing not working
Symptom: Hosts in different VLANs cannot ping each other, but hosts in the same VLAN communicate fine.
This occurs if IP routing is not enabled ('no ip routing'), SVIs are not configured or are in shutdown state, or VLANs are not created on the switch. Also, the SVIs must have IP addresses in the correct subnet for each VLAN.
Exam clue: CCNA and Network+ exam questions often present a scenario where pings between VLANs fail and ask for the most likely cause: missing 'ip routing' command or misconfigured SVIs.
SVI remains down/down
Symptom: When using 'show ip interface brief', the VLAN interface shows 'down/down' and no traffic flows.
An SVI remains down if the corresponding VLAN does not have any active access ports (in up/up state) or if all trunk ports that carry that VLAN are down. The SVI requires at least one active Layer 2 port in the VLAN to be operational.
Exam clue: An exam question might show a topology where a VLAN has no hosts and ask why the SVI is down. The correct answer is that the VLAN must have at least one active port to bring the SVI up.
ACL blocking all traffic unexpectedly
Symptom: After applying an ACL, all communication stops for hosts in a VLAN, even legitimate traffic.
This is typically due to the implicit 'deny any' at the end of every ACL. If the ACL does not have explicit permit statements for required traffic (e.g., ARP, DHCP, routing protocols), those packets are dropped. Also, ACLs are processed top-down; an incorrect order can block traffic prematurely.
Exam clue: Security+ and CCNA exams frequently test the concept of implicit deny. A classic question: 'After configuring an ACL with only a permit statement, traffic from other sources is blocked-why?' Answer: the implicit deny at the end.
High CPU usage on Layer 3 switch
Symptom: Switch CPU utilization is high ( >80%), causing slow management responses and packet loss.
High CPU often occurs if there is excessive traffic that requires software routing (e.g., packets that cannot be fast-switched by ASICs). This can be due to ACL logging, ICMP unreachables, or routing protocol instability. Another cause is a broadcast storm or a loop (even with STP, certain misconfigurations can cause CPU spikes).
Exam clue: Network+ and CCNA include troubleshooting high CPU: common causes include 'process switching' many packets, or a 'routing loop' causing route flapping. Using 'show processes cpu' helps identify the process consuming CPU.
DHCP not working across VLANs
Symptom: Hosts in one VLAN cannot obtain an IP address from a DHCP server located in a different VLAN.
This is usually because the DHCP server is on a different subnet and the switch (acting as default gateway) is not configured with a DHCP relay agent. The 'ip helper-address' command must be configured on the SVI of the client VLAN to forward DHCP broadcasts as unicasts to the DHCP server.
Exam clue: CCNA tests the 'ip helper-address' command. A typical question: 'Users in VLAN 10 cannot get IP addresses. The DHCP server is in VLAN 20. What is missing?' Answer: the 'ip helper-address' on VLAN 10 SVI.
Routing loop or inconsistent connectivity
Symptom: Pings sometimes work and sometimes fail, or TTL exceeded messages appear for destinations that should be reachable.
This can happen if the Layer 3 switch has a misconfigured static route pointing to a next hop that is not directly connected, or a routing protocol is advertising incorrect information. A routing loop occurs when two switches point to each other as the next hop for a destination. This is often due to redundant paths without proper metric tuning.
Exam clue: Network+ and CCNA include troubleshooting routing loops using 'tracert' or 'traceroute'. The exam might show a loop scenario and ask for the cause: e.g., 'redistribution without administrative distance adjustments' or 'floating static route with wrong metric'.
Cannot ping switch management IP from remote subnet
Symptom: The Layer 3 switch management IP (e.g., SVI IP) is reachable from hosts within the same VLAN but not from other VLANs.
This is often due to a missing default route on the switch or an ACL applied to the SVI that blocks ICMP traffic. Also, the switch must have a route back to the remote subnet. If the switch receives a ping but cannot reply, check the routing table for a return route.
Exam clue: CCNA and Network+ exam questions about management access: a common scenario is that an admin cannot SSH to the switch from a remote network. The fix is either adding a default route or adjusting an ACL.
Memory Tip
Layer 3 switch = Layer 2 speed + Layer 3 routing. Think of the number 3: it can ‘route’ (Layer 3) like a router, but it ‘switches’ at the speed of Layer 2.
Learn This Topic Fully
This glossary page explains what Layer 3 switch means. For a complete lesson with labs and practice, see the topic guide.
Covered in These Exams
Current Exam Context
Current exam versions that test this topic — use these objectives when studying.
SY0-701CompTIA Security+ →200-301Cisco CCNA →N10-009CompTIA Network+ →AZ-104AZ-104 →ACEGoogle ACE →SAA-C03SAA-C03 →220-1101CompTIA A+ Core 1 →Related Glossary Terms
A/B testing is a controlled experiment that compares two versions of a single variable to determine which one performs better against a predefined metric.
An A record is a type of DNS resource record that maps a domain name to an IPv4 address.
AAA (Authentication, Authorization, and Accounting) is a security framework that controls who can access a network, what they are allowed to do, and tracks what they did.
An AAAA record is a DNS record that maps a domain name to an IPv6 address, allowing devices to find each other over the internet using the newer IP addressing system.
802.1Q is the networking standard that allows multiple virtual LANs (VLANs) to share a single physical network link by tagging Ethernet frames with VLAN identification information.
802.1X is a network access control standard that authenticates devices before they are allowed to connect to a wired or wireless network.
Quick Knowledge Check
1.A network administrator needs to enable inter-VLAN routing on a Layer 3 switch. Which command must be entered in global configuration mode?
2.What is a primary reason a Layer 3 switch is faster at routing than a traditional router?
3.After configuring an extended ACL on a Layer 3 switch to permit HTTP traffic, all other traffic is blocked. What is the most likely reason?
4.An SVI on a Layer 3 switch is showing 'down/down' in the output of 'show ip interface brief'. Which condition could cause this?
5.Hosts in VLAN 10 cannot obtain DHCP IP addresses from a DHCP server in VLAN 20. Both VLANs are routed by a single Layer 3 switch. What configuration is missing on the switch?