Use a vlan for wifi

Hi everyone!

I have a TP-Link TL-WR1043ND v1 installed with OpenWRT 22.03.0. I flushed all the firewall configuration and stopped the firewall, dhcp and dns servers.

My main router is a PfSense box with vlan 10, 100, 200, 300 and the OpenWRT device connected to it with a trunk on the wan port.

So I configured the switch of the device like this:
eth0.10: cpu tagged, all lan ports off, wan tagged
eth0.100: cpu off, lan port 1, 2 untagged, wan tagged
eth0.200: cpu tagged, all lan ports off, wan tagged
eth0.300: cpu off, lan port 3, 4 untagged, wan tagged

Then I set up two interfaces one on eth0.10 with static ip for management purposes and one unmannaged on eth0.200 and set it as the interface for the wifi.

Everything works fine I can acces the device on its managent ip and the lan ports works too.
Only the laptop connected to wifi can't get an ip address and if I set it manually it can't ping the gw so this is my problem.

I tested the trunk with the lan port 1 set to untagged on eth0.200 and it worked correctly.

WiFi is usually bridged to LAN via the interface br-lan. You need to change this bridge to contain eth0.200 instead of the default eth0.1 or whatever it is on your device. Keep in mind that br-lan usually has your device IP assigned, so if you change that, your device might be reachable via a different VLAN.

I have a very similar setup on my AP with a trunk upstream and two WiFi networks bridged to different VLANs via separate bridges. You can also create an additional bridge instead of changing the default one.

What do you mean with "...and set it as the interface for the wifi"?

Okay I will try to create a bridge fo it.

I mean I selected the created interface on the wireless configuration screen at "Network" option.

Let's take a look at your configuration:

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

Others have answered with concrete suggestions, and I would also suggest following psherman's advice and post your configuration.

I would also suggest describing carefully what you are trying to achieve, because we don't have insight into your mental model of your goal, even though it may be obvious to you.

I'll ask three questions:

  1. When you talk about IP addresses, are you using IPv4, IPv6 or both?
  2. What are you expecting to happen when you set an interface to 'unmanaged', especially with respect to IP addressing (both IPv4 and IPv6, and DHCP, for example).
  3. The standard configuration OpenWrt ships with has the WiFi bridged (br-lan) with Ethernet interfaces, you have not mentioned that. Possibly some of the functionality you expect is provided by this bridging.

Yes, the bridge solved the problem. Thanks.

2 Likes