Most home networks put every device on one flat network. Your laptop, phone, smart bulb, guest phone, and home server all share the same space and can talk to each other by default. That is simple to set up, and it is also why one weak device can cause trouble for everything else. If you want to segment home network with VLANs, you do not need enterprise gear. You need a managed switch, a router that supports VLANs, and a clear plan for which devices belong together.
A VLAN is a virtual LAN. It splits one physical switch into separate logical networks. Devices on different VLANs cannot reach each other unless your router or firewall allows it. That keeps trusted devices, smart home gear, guests, and servers apart.
What VLAN Segmentation Actually Does
A VLAN does not make a device secure on its own. It limits what a device can reach. If a smart camera has a weak password, it can still be attacked from the internet. But if it sits on an isolated IoT VLAN, it cannot scan your laptop, read files from your server, or open your router admin page. The damage stays in one small area.
Segmentation also makes the network easier to fix. When a device stops working, you know which VLAN it belongs to and which rules apply to it.
Plan Your VLANs Before You Touch a Switch
Start with four or five groups that match how your home works. Most home network vlans follow the same pattern, and you can add more later.
- Trusted (VLAN 10): laptop, desktop, and phone. Full internet and server access. The only VLAN that reaches the router and switch admin pages.
- Servers (VLAN 20): home server, NAS, and Raspberry Pi. Other VLANs reach only the ports they need.
- IoT (VLAN 30): bulbs, cameras, plugs, TVs, and speakers. Internet if needed, but no new connections to trusted or server VLANs.
- Guest (VLAN 40): visitors. Internet only. No access to other VLANs, printers, or router settings.
- Management (VLAN 99): switch and access point admin pages. Only trusted can reach it.
Write the plan down: VLAN ID, subnet, and purpose for each one. A simple scheme is 192.168.10.0/24 for trusted, 192.168.20.0/24 for servers, 192.168.30.0/24 for IoT, and 192.168.40.0/24 for guests. Keep the third number the same as the VLAN ID so an IP address tells you where a device lives.
What You Need
- A managed switch. An unmanaged switch cannot tag ports with VLANs. A basic 8-port managed switch is enough for most homes. Look for 802.1Q VLAN support in the spec sheet.
- A router or firewall that supports VLANs. It must create a virtual interface for each VLAN and route between them with rules.
- An access point with multiple SSIDs and VLAN tags. One access point can broadcast a trusted SSID, an IoT SSID, and a guest SSID, each tagged differently.
If you already run a home server, this vlan segmentation guide still applies: put the server on its own VLAN and control which ports other VLANs can reach. If you are still choosing hardware, read this homelab starter build guide first so you do not buy gear you will not use.
How to Segment Home Network With VLANs Step by Step
Work on one VLAN at a time. Change one thing, test it, then move on. If you change everything at once and the network breaks, you will not know which change caused it.
Step 1: Create the VLANs
Create the same VLAN IDs on the switch and the router: 10, 20, 30, 40, and 99. Give each VLAN a subnet and a gateway, for example 192.168.30.1 for IoT. Set the router to hand out DHCP on each VLAN, and reserve static addresses below .100 for devices that need a fixed IP, such as your server and printer.
Step 2: Set Access Ports
An access port belongs to one VLAN only and sends traffic without a tag, so the device plugged into it does not need to know about VLANs. Plug your desktop into VLAN 10, your server into VLAN 20, and a smart TV or wired camera into VLAN 30. Label the ports so you do not forget which is which.
Step 3: Set a Trunk Port to the Router
A trunk port carries more than one VLAN over one cable, with each packet tagged so the other end knows which VLAN it belongs to. The cable between switch and router should be a trunk that carries all your VLANs. The same applies to the cable to your access point if it serves more than one SSID. Create a matching sub-interface for each VLAN on the router. If the IDs do not match on both ends, traffic will not pass.
Step 4: Write Firewall Rules
Start with a default deny between VLANs, then add only the rules you need. Without rules, a router will route traffic between VLANs and your isolation is only on paper. A practical set is: trusted can reach servers on the ports those services need; servers can reply to trusted but cannot start new connections to it; IoT cannot start connections to trusted or servers; guest can reach the internet only; and only trusted can reach the admin pages.
Order matters. Firewalls read rules top to bottom and stop at the first match, so put specific allow rules first and broad deny rules last. If you run Ubuntu Server as your firewall host, this guide to setting up UFW on Ubuntu Server 24.04 shows how to write and test simple allow and deny rules.
Step 5: Set DNS Per VLAN
Each VLAN needs DNS. A common setup is to run a network-wide ad blocker on the server VLAN and point trusted and IoT devices at it, while guests use a public DNS server. Follow this guide to installing Pi-hole on a Raspberry Pi, put it on the server VLAN, and allow only DNS traffic to it on port 53. If you are still choosing a blocker, this Pi-hole vs AdGuard Home comparison covers the practical differences.
A Worked Example: A Small House Layout
- Port 1: trunk to the router, tagged 10, 20, 30, 40.
- Port 2: trunk to the access point, tagged 10, 30, 40.
- Port 3: access, VLAN 10, desktop PC.
- Port 4: access, VLAN 20, home server.
- Port 5: access, VLAN 20, NAS.
- Port 6: access, VLAN 30, smart TV.
- Port 7: access, VLAN 30, wired camera.
- Port 8: access, VLAN 99, switch admin only.
On Wi-Fi, broadcast three networks: Home (VLAN 10), IoT (VLAN 30), and Guest (VLAN 40). Your phone joins Home, smart plugs join IoT, and visitors join Guest for internet only. On the server VLAN, services often run in containers. The network mode changes how a container is seen on your LAN, so read this explanation of Docker networking modes before you expose a container to another VLAN. Bridge mode sits behind the host, while macvlan gives the container its own address, and the firewall rules differ for each.
Test Before You Trust It
Do not assume the rules work because the switch saved them. Connect a laptop to guest Wi-Fi and try to ping your server and desktop. Both should fail. From the same connection, open a web page. It should load, which proves internet access still works. From IoT Wi-Fi, try to open the router admin page. It should fail. From your trusted laptop, open a service on your server. It should work.
If a test fails the wrong way, check three things first: the port VLAN assignment, the trunk tag list, and the firewall rule order. In most home setups the problem is one of those three.
Mistakes to Avoid
Do not leave the default VLAN 1 in use for real traffic. Many switches put every port on VLAN 1 by default. Move devices to your own VLANs and leave VLAN 1 empty, or use it only for management.
Do not forget the trunk. If the link to the router is an access port on one VLAN, only that VLAN reaches the router. The others will look connected but will have no gateway and no internet. Check the trunk tag list on both ends whenever a whole VLAN loses connectivity at once.
Do not write allow rules that are too wide. “IoT can reach servers” is a hole, not a rule. Write “IoT can reach the DNS server on port 53” instead. Allow one address and one port at a time, and add more only when a real device needs it.
Do not skip the guest network because nobody visits often. Guests still connect, and they bring phones you do not manage. Export the switch and router config before you start and after each step that works. This vlan beginner guide gives you a setup you can build in an evening: start with trusted, servers, IoT, and guest, test each path, and add rules only when a device needs them.