A separate lab network, so my attacks can't touch my home
I turned one port on my switch into its own VLAN. Anything plugged into it can reach my honeypot and nothing else: not my home network, not the internet, not SSH.
- Goal
- Somewhere to attack from that can't reach my real network
- Result
- Lab reaches the honeypot and nothing else
- Tools
- TP-Link TL-SG105E, 802.1Q VLANs, NetworkManager, UFW, nmap
Why I needed it
In my SIEM write-up I attacked my Pi from my main PC, my own defences banned it, and my internet went down with it. Attacks should come from somewhere separate. Businesses do this with VLANs: one switch, split into networks that can't see each other.
The plan
- VLAN 1 is my home network, on ports 1 to 4 like before.
- VLAN 20 is the lab, on port 5 only.
- The Pi's port carries both, tagged, so the Pi can be on the lab too.
- On the Pi, the firewall lets the lab reach only the honeypot.
My EE router doesn't understand VLANs, so the lab gets no internet at all. For an attack lab, that's what I want.
The switch
First I had to find it. The only TP-Link in my scan was my Wi-Fi extender, and the switch wasn't on its factory address. TP-Link's own tool found it straight away. I changed its login password first, so nobody else on my network can change it, then turned on 802.1Q VLANs and added VLAN 20, tagged on port 2 and untagged on port 5:

Port 5 also needed its PVID set to 20, so anything plugged in without a tag lands in the lab:

The Pi
# join VLAN 20, never use it as the way to the internet $ sudo nmcli con add type vlan con-name lab \ ifname eth0.20 dev eth0 id 20 \ ipv4.method manual ipv4.addresses 10.20.0.1/24 \ ipv4.never-default yes ipv6.method disabled $ ip -br addr show eth0.20 eth0.20@eth0 UP 10.20.0.1/24 # the lab can only reach the honeypot $ sudo ufw allow in on eth0.20 from 10.20.0.0/24 to any port 2222,3389,8081 proto tcp
My firewall already blocks everything else coming in and refuses to route between networks, so the Pi can't be used as a way through to my home network.
Testing it
I plugged my Mac into port 5 with Wi-Fi off and gave it a lab address.
$ ping -c 3 [pi, lab side] 3 packets transmitted, 3 packets received $ nc -vz [pi] 2222 # honeypot succeeded! $ nc -vz [pi] 22 # real SSH Operation timed out $ sudo nmap -Pn [pi] Not shown: 997 filtered tcp ports (no-response) 2222/tcp open 3389/tcp open 8081/tcp open
From the lab, my Pi looks like a box with three services, and all three are fake. Then I pretended to be on my home network by giving the Mac a home address and pinging my router:
$ ping -c 3 [router]
No route to host
The switch keeps port 5 apart from everything else, so there was nobody there to answer.
Easy to get wrong: the switch kept port 5 in VLAN 1 until I filled in the whole VLAN 1 row, name and every port, before saving. Left like that, the lab would still have heard my home network's traffic.
What I learned
- Tagged means the port carries several VLANs and the device sorts them out. Untagged means the device doesn't know VLANs exist.
- A VLAN stops traffic at the switch, but the firewall decides what's allowed on the device that sits in both.
- Test the thing you're trying to stop, not just the thing you want to work.
How I used AI: Claude explained VLANs, planned the setup and gave me each step and command, and wrote this page. I set up the switch and the Pi, ran every test from my Mac and checked the results. The full, unedited notes are in my build log.