Hello.
I'm trying the approach described here: Individual per-passphrase Wifi VLANs using wpa_psk_file (no RADIUS required) - #4 by takimata
The goal is to have one SSID that would dynamically assign a connected device to a VLAN based on the secret that device connects with.
Right now I have VLAN assignment implemented via multiple SSIDs like shown below (router: R4S
, 23.05, AP: Zyxel NWA50AX
, 23.05.05) and everything works just fine.
Router:
/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 'fded:535b:e766::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth1'
config device
option name 'eth1'
option macaddr '<REDACTED>'
config interface 'lan'
option device 'br-lan.2'
option proto 'static'
option ipaddr '192.168.2.1'
option netmask '255.255.255.0'
option ip6assign '60'
config device
option name 'eth0'
option macaddr '<REDACTED>'
config interface 'wan'
option device 'eth0'
option proto 'dhcp'
config interface 'wan6'
option device 'eth0'
option proto 'dhcpv6'
config interface 'iot'
option proto 'static'
option device 'br-lan.44'
option ipaddr '192.168.44.1'
option netmask '255.255.255.0'
AP:
/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 'fd12:c027:ddae::/48'
option packet_steering '1'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan.2'
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'
config device
option type 'bridge'
option name 'br-iot'
list ports 'lan.44'
config interface 'iot'
option proto 'dhcp'
option device 'br-iot'
/etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0'
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'
option disabled '1'
config wifi-device 'radio1'
option type 'mac80211'
option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0+1'
option channel '36'
option band '5g'
option htmode 'HE80'
option cell_density '0'
config wifi-iface 'wifinet1'
option device 'radio1'
option mode 'ap'
option ssid 'OpenWrt-l'
option encryption 'psk2'
option key '11111111'
option network 'lan'
config wifi-iface 'wifinet2'
option device 'radio1'
option mode 'ap'
option ssid 'OpenWrt-44'
option encryption 'psk2'
option key '11111111'
option network 'iot'
Following the steps from the topic above, I've replaced the stock wpad package with wpad-wolfssl
. But the moment I start adding the options to the /etc/config/wireless
:
option wpa_psk_file '/etc/hostapd.wpa_psk'
option vlan_file '/etc/hostapd.vlan'
option vlan_tagged_interface 'eth0'
option vlan_bridge 'br-vlan'
option dynamic_vlan '1'
Everything stops working - the AP stops broadcasting the configured SSIDs until I roll these changes back.
I'd appreciate if someone knowledgeable helped me implement the wpa_psk_file solution for the setup I gave my current (working) config for above..