Hey Forum.
Trying to configure my first network build, but keep getting stuck without really understanding why (98% confident I'm misunderstanding how VLANs should actually work).
Looked at documentation, bunch of videos and posts on this forum, but nothing seems to be working for me.
What I want to achieve is: having AP to transmit two SSIDs, one for LAN (for "trusted" devices) and another for VLAN (for "untrusted" devices).
I have OPNSense box as a router with 2 interfaces configured, LAN and VLAN (tag: 10) based on this LAN interface.
Directly into this LAN port connected AP (configured as "dumb" AP following OpenWRT documentation).
AP config is almost default, because sometimes I have to reset AP as it gets stuck trying to revert changes.
cat /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix '[redacted]'
option packet_steering '1'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan'
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'
Trying to add Bridge VLAN filtering, as lot's of comments suggest, to br-lan device doesn't work, OpenWRT reverts changes (doesn't matter adding Tagged or Not Tagged VLAN, but, from my understanding, VLAN should be Not Tagged as devices connected to the AP ((like smartphone etc.)) don't know about VLAN?).
What seems to kinda work is adding VLAN as 802.1q device and creating interface based on this device. In such case interface gets IP address from router.
Config:
cat /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix '[redacted]'
option packet_steering '1'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan'
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'
config device
option type '8021q'
option ifname 'br-lan'
option vid '110'
option name 'br-lan.110'
option mtu '1500'
option macaddr '[redacted]'
config interface 'UNTRUSTED'
option proto 'dhcp'
option device 'br-lan.110'
cat /etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option path '[don't understand what is it so redacted]'
option channel '1'
option band '2g'
option htmode 'HE20'
option disabled '1'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'
config wifi-device 'radio1'
option type 'mac80211'
option path '[don't understand what is it so redacted]'
option channel '36'
option band '5g'
option htmode 'HE80'
option cell_density '0'
config wifi-iface 'default_radio1'
option device 'radio1'
option network 'UNTRUSTED'
option mode 'ap'
option ssid 'OpenWrt.Test'
option encryption 'sae'
option key '[:)]'
But then the problem is that wirelessly connected devices can not get IP address from router. I can see my phone connecting to router in LuCI, but it fails to get IP address (disconnects after phone message "Obtaining IP address" ((android))).
When using lan interface for wireless - everything works fine.
Configuration for LAN and VLAN:10 on OPNSense side is basically the same, just different subnets 192.168.100.x vs 192.168.110.x.
Sorry for posting yet another question on this topic, but this is my last resort as I'm stuck on this for some time now without really understanding the problem.