Hello,
I’m trying to setup a few devices as access points using VLANs.
However, the stations associate but they don’t get an IP. If I set up the interface as DHCP client it gets an IP, but the clients don’t. I'm using LUCI.
What I tried:
checked that the CPU is tagged
Tried putting the VLAN (eth0.x) into a bridge. Didn’t work.
Is this your main router, or is this just a bridged AP?
If there is there another device as the main router, does it already have VLANs configured?
And is the AP directly connected to the router, or are there any other devices (such as switches) between the main router and the AP?
What is the output of the following:
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
Do you mean VLAN 30 is the DHCP client? (you mention that VLAN 30 is the management interface, but then say that you have DHCP client on VLAN 20 which isn't described in the bullets above).
Assuming the port assignments are correct, the problem is with your definition of the bridges...
The bridge must be defined in its own device stanza.
So, add these:
config device
option name 'br-lana'
option type 'bridge'
list ports 'eth0.10'
config device
option name 'br-guest'
option type 'bridge'
list ports 'eth0.11'
config device
option name 'br-mgmt'
option type 'bridge'
list ports 'eth0.30'
config device
option name 'br-lanb'
option type 'bridge'
list ports 'eth0.31'
Now, edit the network stanzas:
config interface 'lan_a'
option proto 'none'
option device 'br-lana'
next:
config interface 'lan_b'
option proto 'none'
option device 'br-lanb'
then:
config interface 'guest'
option proto 'none'
option device 'br-guest'
and finally:
config interface 'lan'
option proto 'dhcp'
option device 'br-mgmt'
Wait, I tried something similar from LUCI but it didn't work (I created a bridge under Devices, then I added the VLAN there, but no luck).
Nonetheless, I'll test this tomorrow.
Edit: can I try your config only for lan_b?
I'll have to wait to have physical access since I have broken the configuration. I think I'll reconfigure from scratch (so no failsafe) to see if the issue is still there.
If you're going to reset to defaults (probably a good idea), please post the default /etc/config/network file so that I can review that file to make sure that the port assignment is correct for the VLANs.
Ok... so you'll create new switch and bridge entries like this:
config switch_vlan
option device 'switch0'
option vlan '10'
option ports '0t 6t'
config switch_vlan
option device 'switch0'
option vlan '11'
option ports '0t 6t'
config switch_vlan
option device 'switch0'
option vlan '30'
option ports '0t 6t'
config switch_vlan
option device 'switch0'
option vlan '31'
option ports '0t 6t'
config device
option name 'br-lana'
option type 'bridge'
list ports 'eth0.10'
config device
option name 'br-guest'
option type 'bridge'
list ports 'eth0.11'
config device
option name 'br-mgmt'
option type 'bridge'
list ports 'eth0.30'
config device
option name 'br-lanb'
option type 'bridge'
list ports 'eth0.31'
Then create your network interfaces:
config interface 'lan_a'
option proto 'none'
option device 'br-lana'
config interface 'lan_b'
option proto 'none'
option device 'br-lanb'
config interface 'guest'
option proto 'none'
option device 'br-guest'
config interface 'mgmt'
option proto 'dhcp'
option device 'br-mgmt'
Add the mgmt network to the lan firewall zone:
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
list network 'mgmt'
And that should do it... just make your SSIDs and connect them with the respective networks.
Note two things:
I've made the assumption that all 4 VLANs are tagged. Make sure that is true on the upstream connection
I've left the lan network interface intact... that's fine for now. But if your management network uses the same subnet (192.168.1.0/24), this will conflict, so be sure to change the lan subnet if there is an overlap.