How a Layer 3 switch and a router differ
A Layer 3 switch is an Ethernet switch that can also route IP traffic between VLANs and subnets, while a router is a device built to connect separate networks, above all a site to the outside world. Both work at Layer 3 of the OSI model, reading IP addresses to decide where a packet goes. Where they differ is how they route, how fast, and what else they do.
A Layer 3 switch routes in its switching hardware, using the same application-specific chips (ASICs) that switch Ethernet frames. That lets it move traffic between VLANs at close to wire speed on every port. A router routes mainly in software or network processors, so its raw throughput is lower, but it handles far more protocols and services: WAN links, network address translation, firewalling, VPNs and internet routing.
In short, use a Layer 3 switch for fast routing between segments inside a site, and a router at the boundary to everything beyond it. Many networks use both.
What a Layer 3 switch does
A plain Layer 2 switch forwards frames by MAC address within one network. Once a site is split into VLANs, say one for cameras, one for controllers and one for office PCs, something has to route between them. A Layer 3 switch does this internally: each VLAN gets a virtual interface with its own IP address, and the switch routes between those interfaces in hardware. It typically supports static routes and, on larger models, dynamic routing such as RIP or OSPF, plus access control lists to filter what may cross between VLANs. Our explainer on VLANs covers how the segments are set up, and our guide to Layer 2 vs Layer 3 switches explains when a site needs Layer 3 at all.
What a router does that a switch does not
A router’s job is the edge of the network. Our guide to what a router does covers this in full; the features that matter when comparing it with a Layer 3 switch are below.
-
//
WAN interfaces. Routers connect to fibre, DSL, cellular and other wide-area links, not just Ethernet.
-
//
NAT. Network address translation lets many private addresses share one public address. Most Layer 3 switches do not offer it.
-
//
Firewall and VPN. Stateful firewalling, IPsec and other VPN tunnels protect traffic leaving the site and link remote sites securely.
-
//
Internet routing protocols. Routers run BGP and handle large routing tables; Layer 3 switches usually stop at static routes, RIP or OSPF.
-
//
Traffic shaping on slow links. Routers buffer and shape traffic to fit a WAN link that is much slower than the LAN behind it.
Layer 3 switch vs router compared
| Feature | Layer 3 switch | Router |
|---|---|---|
| Main role | Routing between VLANs inside a site | Connecting a site to other networks |
| How it routes | Hardware ASIC, close to wire speed | Software or network processor |
| Port count | High, typically 8 to 48 or more | Low, often 2 to 8 |
| Interfaces | Ethernet copper and fibre | Ethernet plus fibre, DSL or cellular WAN |
| NAT, firewall, VPN | Rarely; basic ACLs only | Yes |
| Routing protocols | Static, RIP, OSPF on some | Static, OSPF, BGP and more |
| Typical place | Core or distribution of a site network | Internet or WAN edge |
How to choose between them
Start from where the traffic goes, not from the device names.
-
//
Mostly local traffic between VLANs. Cameras to a recorder, PLCs to a SCADA server, or vision systems to an inspection PC on another segment. A Layer 3 switch keeps this fast and off the router.
-
//
Traffic leaving the site. Anything going to the internet, a cloud service, head office or a remote depot needs a router or firewall with NAT and a security policy.
-
//
One small network with one uplink. A Layer 2 switch plus a router is often enough. The router can handle the little routing there is between a couple of VLANs.
-
//
Vehicles and mobile systems. A compact Layer 3 switch board links the on-board subsystems, while a cellular router or gateway handles the link back to base.
Using both in an industrial network
A common design puts a Layer 3 switch at the core of a plant or vehicle network and a router or firewall at its edge. The switch handles busy local traffic, such as cameras streaming to a recorder on another VLAN, without that traffic ever touching the router. The router handles the slower link to the corporate network, the cloud or a cellular backhaul, and applies the security policy at that boundary.
Rugged systems often build this in at board level. Our Ethernet switch boards include Layer 3 managed models that sit inside a vehicle or enclosure, and our managed industrial switches include 16-port Layer 3 models with 10G SFP+ uplinks, some with PoE++ ports. At the edge, an industrial IoT gateway can take the router role, with cellular WAN, VPN and firewalling.
Quick answers on Layer 3 switches vs routers
Layer 3 switches and routers: common questions
What is a Layer 3 switch?
A switch that can also route. It forwards Ethernet frames like any switch and routes IP traffic between VLANs and subnets in hardware.
Is a Layer 3 switch a router?
Partly. It routes IP, but it lacks the WAN interfaces, NAT, firewall and VPN features that define a router at the network edge.
Can a Layer 3 switch replace a router?
Inside a site, often yes; at the internet edge, usually no. Without NAT, a firewall and a WAN interface it cannot safely connect a site to the internet.
Does a Layer 3 switch do NAT?
Usually not. A few high-end models offer limited NAT, but most leave it to the router or firewall.
When do I need a Layer 3 switch?
When a site has several VLANs that exchange a lot of traffic. Routing between them in the switch is faster than sending everything through a router.
We supply Layer 2 and Layer 3 industrial switches and edge gateways, configured to the site’s VLAN and routing plan as standard. Send us your network layout, and we will specify where switching and routing should sit.