Course contents

Unit 2: Network DevicesLesson 2.10 (10 of 10 in this unit)15 of 104 in the Network Fundamentals course

Router vs Layer 3 Switch

Both devices can route, so why buy two? The answer is scale and features. This lesson shows what they share, where each is better, and where each belongs in a network.

Beginner · 9 min read · Before this: Routing vs switching, VLANs

Covers Inter-VLAN routing, SVIs and routed ports, Hardware vs software forwarding, WAN, NAT and VPN features and Where to place each.

Technical definition

A Layer 3 switch is a switch that can also route between networks and VLANs using IP addresses, with forwarding done in hardware. It combines the port density of a switch with basic router functions.

Router and Layer 3 switch: same routing, different job
Router and Layer 3 switch: same routing, different jobA router and a Layer 3 switch can both route between networks, learn routes, and do inter-VLAN routing. A router typically adds WAN interface types, NAT, VPN and deeper policy features. A Layer 3 switch adds many switch ports with hardware forwarding, so routing between VLANs on a campus runs at wire speed. Use a switch to route inside the campus and a router at the WAN edge.Both can doRouting between networksStatic and dynamic routingInter-VLAN routing (SVIs)Routed ports and subinterfacesACLs and basic filteringSeparate broadcast domainsRouterWAN links: serial, DSL, cellularNAT and PAT to the InternetVPN tunnels and encryptionFew ports, rich featuresBest at the WAN edgeLayer 3 switch24 to 48 ports in one boxHardware routing at wire speedVLANs and SVIs built inFew WAN featuresBest inside the campus

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The line between them has blurred: many routers have switch ports and many Layer 3 switches have routed ports. Pick by the job: dense LAN routing, or the WAN edge with its extra features.

What they share

Both devices make routing decisions with a routing table. They can learn routes statically or from routing protocols, route between networks and VLANs, apply access control lists and keep each routed interface in its own broadcast domain.

How a Layer 3 switch routes between VLANs

On a Layer 3 switch you create an SVI for each VLAN and give it an IP address, which becomes the default gateway for that VLAN. Traffic between VLANs is routed inside the switch, so it does not need to leave through a trunk to an external router. You can also turn a port into a routed port, a Layer 3 interface with an IP address, for links to other routers or switches.

Router and Layer 3 switch compared
Router and Layer 3 switch compared; Router; Layer 3 switch. Ports: A few, often modular Many, typically 24 or 48 Forwarding: Software and hardware, rich features Mostly hardware, very fast WAN interfaces: Yes: Ethernet, serial, cellular, others Rarely NAT and VPN: Common Limited or absent Typical place: WAN and Internet edge Campus distribution and coreRouterLayer 3 switchPortsA few, often modularMany, typically 24 or 48ForwardingSoftware and hardware, rich featuresMostly hardware, very fastWAN interfacesYes: Ethernet, serial, cellular,othersRarelyNAT and VPNCommonLimited or absentTypical placeWAN and Internet edgeCampus distribution and core

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Header row, topics and answers use different colours so each row reads across.

Where to place each

Use Layer 3 switches where many VLANs need fast routing between them, usually the distribution or core of a campus. Use a router, or a firewall that routes, where the network meets the outside world and needs NAT, VPN tunnels and WAN links. A small office often uses one device that does it all, but the roles are still distinct.

Test yourself

Predict · scenario 1

Hosts in VLAN 10 and VLAN 20 must talk at wire speed inside a campus. What fits best?

Predict · scenario 2

Which feature points to a router rather than a Layer 3 switch?

Predict · scenario 3

What is the IP address on an SVI used as?

FAQ

Can a Layer 3 switch replace a router?
Inside a campus, often yes: it can route between VLANs at wire speed. At the Internet or WAN edge you usually still want a router or firewall for NAT, VPN and WAN interface types.
What is an SVI?
A switched virtual interface is a logical Layer 3 interface for a VLAN. Its IP address acts as the default gateway for hosts in that VLAN.
Is a Layer 3 switch faster than a router?
For LAN routing between VLANs, usually yes, because forwarding runs in dedicated hardware. A router does more per packet, such as NAT and VPN, so it suits fewer, richer links.