OPNsense Forum

English Forums => General Discussion => Topic started by: puffinburger on November 28, 2026, 05:56:53 PM

Title: Would anyone mind verifying Gemini's instructions for creating a VLAN?
Post by: puffinburger on November 28, 2026, 05:56:53 PM

I'm quite the noob with networking beyond setting up regular commercial home routers (ASUS, Tp-link etc) and I only recently setup my DIY Opnsense router that i've mated to a TP-Link TL-SG105PE Switch and TP-Link EAP653 Access Point. I'm not intending do anything especially advanced with it but I did want to create a separate VLAN for my IoT devices and so not really knowing where to start I turned to AI but I dont know better than to trust it point blank. I'm going to paste the instructions it gave me below and I was hoping someone might be kind enough to tell me they seem OK or if anything is wrong with them?

### Goal & Hardware Overview

* **Router / Firewall:** OPNsense 26.7 (using Dnsmasq for DHCP/DNS)
* **Managed Switch:** TP-Link TL-SG105PE (Easy Smart)
* **Access Point:** TP-Link EAP653 (standalone mode)
* **DNS Filtering:** Two local AdGuard Home instances on the main LAN (`10.10.20.180` and `10.10.20.85`)
* **IoT Clients:** Brother laser printer, Amazon Echo speaker, TP-Link Tapo smart plugs
---
### 1. Network Layout
* **Trusted LAN (Untagged / VLAN 1):** `10.10.20.0/24` (Gateway: `10.10.20.1`)
* **IoT Network (Tagged / VLAN 30):** `10.10.30.0/24` (Gateway: `10.10.30.1`)
---
### 2. OPNsense 26.7 Interface & Dnsmasq Setup
* **VLAN Device (`Interfaces → Devices → VLAN`):**
* Parent: Physical LAN NIC (`igb1`)
* VLAN Tag: `30` (`IoT`)
* **Interface Assignment (`Interfaces → Assignments`):**
* Enabled `IoT` with Static IPv4 `10.10.30.1/24`
* **Dnsmasq (`Services → Dnsmasq DNS & DHCP`):**
* **General:** Added `IoT` alongside `LAN` under Interfaces; `DHCP register firewall rules` checked.
* **DHCP Range:** `10.10.30.100` – `10.10.30.200` (`255.255.255.0`) on `IoT`.
* **DHCP Option:** Set Option `dns-server [6]` on `IoT` to `10.10.20.180,10.10.20.85`.
* **Cross-VLAN Printing:**
* Installed `os-mdns-repeater` and bridged `LAN` and `IoT` only (with a static DHCP reservation on `10.10.30.0/24` for the Brother printer).
---
### 3. OPNsense Firewall Rules (`IoT` Interface — Top-to-Bottom)
Created an `RFC1918_Networks` alias containing `10.0.0.0/8`, `172.16.0.0/12`, and `192.168.0.0/16`.
*(Auto-generated Dnsmasq DHCP UDP 67 rule sits at the top)*
| # | Action | Protocol | Source | Destination | Port | Description |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| **1** | Pass | IPv4 TCP/UDP | `IoT net` | `10.10.20.180` | `53` | Allow IoT to Primary AdGuard Home |
| **2** | Pass | IPv4 TCP/UDP | `IoT net` | `10.10.20.85` | `53` | Allow IoT to Secondary AdGuard Home |
| **3** | Pass | IPv4 UDP | `IoT net` | `This Firewall` | `123` | Allow IoT NTP time sync |
| **4** | Block | Any | `IoT net` | `RFC1918_Networks` | `any` | Block IoT from LAN, firewall GUI/SSH, and private subnets |
| **5** | Pass | IPv4 Any | `IoT net` | `any` | `any` | Allow IoT internet access |
---
### 4. TP-Link TL-SG105PE & EAP653 Configuration
* **802.1Q VLAN (`TL-SG105PE`):**
* **Port 1 (EAP653):** VLAN 1 Untagged, VLAN 30 Tagged (PVID `1`)
* **Ports 2–4 (Trusted wired devices):** VLAN 1 Untagged, VLAN 30 Not Member (PVID `1`)
* **Port 5 (OPNsense LAN uplink):** VLAN 1 Untagged, VLAN 30 Tagged (PVID `1`)
* Saved configuration to flash (`Save Config`).
* **EAP653 SSIDs:**
* `Home` (Trusted): No VLAN ID (stays on untagged VLAN 1)
* `Home-IoT` (IoT): VLAN ID `30` (2.4 GHz)

Many thanks.
Title: Re: Would anyone mind verifying Gemini's instructions for creating a VLAN?
Post by: pfry on November 28, 2026, 06:35:05 PM
VLAN and LAGG Setup (https://docs.opnsense.org/manual/how-tos/vlan_and_lagg.html) didn't work for you?

Quote from: puffinburger on <strong>Today</strong> at 05:56:53 PM[...]
### 1. Network Layout
* **Trusted LAN (Untagged / VLAN 1):** `10.10.20.0/24` (Gateway: `10.10.20.1`)
* **IoT Network (Tagged / VLAN 30):** `10.10.30.0/24` (Gateway: `10.10.30.1`) [...]

...And AI didn't tell you not to mix tagged and untagged VLANs on an interface? It may work for you; my experience is with bridges, where it absolutely does not work (VLAN tags are not differentiated by pf, so traffic hits the filter for the untagged VLAN). See the "! Attention" sections from the page above.

Since you're working on the "lan" interface, I'd recommend using another to communicate with the firewall. Beyond that, give it a shot and see if it does what you want.
Title: Re: Would anyone mind verifying Gemini's instructions for creating a VLAN?
Post by: nero355 on November 28, 2026, 07:23:09 PM
Quote from: puffinburger on <strong>Today</strong> at 05:56:53 PMI'm quite the noob with networking beyond setting up regular commercial home routers (ASUS, Tp-link etc) and I only recently setup my DIY Opnsense router that i've mated to a TP-Link TL-SG105PE Switch and TP-Link EAP653 Access Point. I'm not intending do anything especially advanced with it but I did want to create a separate VLAN for my IoT devices and so not really knowing where to start
TIP :

Grab the Forum Search on top of the page and fill in the following details =>
Search for: tagged
Match: Match all words
By user: nero355
Search order: Oldest topics first
Options: Show results as messages
Message age: 0 - 1500 days

And have fun reading just 2 pages about pretty much everything you need to know about OPNsense+Switches+Accesspoints+WiFi SSID settings and concepts of which many apply to your situation :)


Good luck!