It's about 2 hours, and it doesn't work. And I can't understand why.
Please someone help me.
I'd like to configure a guest wireless lan on tagged vlan 20. I have a working main wlan configured, with untagged traffic, that is bridged with eth0.
the clients connect to the ap on MiPiaceLaPizza:
Feb 24 20:36:38 ap hostapd: wlan0: STA 34:02:86:cf:75:8d IEEE 802.11: authenticated
Feb 24 20:36:38 ap hostapd: wlan0: STA 34:02:86:cf:75:8d IEEE 802.11: associated (aid 3)
Feb 24 20:36:38 ap hostapd: wlan0: AP-STA-CONNECTED 34:02:86:cf:75:8d
Feb 24 20:36:38 ap hostapd: wlan0: STA 34:02:86:cf:75:8d WPA: pairwise key handshake completed (RSN)
but the dhcp requests seem to never get to the dhcp server on the router.
I know the router is configured correctly, because all this worked fine with the ap I used before the new openwrt ap.
I don't know what happens when you declare an OpenWrt abstracted network named eth0 (which will become br-eth0). It seems best to use a name such as lan or vlan1 that wouldn't conflict with the hardware named eth0.
Tagged and untagged packets on the same Ethernet cable is something that really really really should be avoided unless you must interoperate with some device on the other end of the cable that must operate that way and you can't control it. It doesn't always work with consumer grade hardware and OpenWrt. Either tag everything or have one untagged network and nothing tagged.
type bridge is correct if you have an AP and and Ethernet port in the same network. proto should be dhcp to obtain a DHCP address. option hostname is useful in conjunction with dhcp so that your main router knows your AP by name, with an OpenWrt main router and many others that work according to standards you can then access the AP as itshostname.lan.
Thanks for the reply. I renamed the eth0 interface to lan, but lan works fine, no problems on the untagged traffic. I tried to remove lan altogether to see if tagged and untagged traffic was a problem, but no change.
What I would like is for clients connected to wlan1 to get on vlan20 and get an ip address from the dhcp server on the router connected to the ap.
My config now looks like this:
/etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd37:987f:31a2::/48'
config device 'lan_eth0_dev'
option name 'eth0'
option macaddr '10:62:eb:a7:c0:90'
config interface 'vlan_20'
option ifname 'eth0.20'
option proto 'none'
option type 'bridge'
config interface 'lan'
option ifname 'eth0'
option proto 'dhcp'
option type 'bridge'
does the vlan_20 interface need an ip address? I need an ip on lan to access the web interface of the ap, but I don't think I need one on vlan_20, right? It should just be a bridge between wlan0 and eth0.20.
Anyway, a tcpdump in eth0 on the ap shows dhcprequests are correctly tagged with vlan id 20, but dumping packets on the connected switch with a port mirror, the vlan id is missing, so it seems the vlan id 20 gets lost before being put on the cable somehow?
Any clues?
You are correct that something like vlan20 doesn't need an IP address when it's just converting packets from wifi to wired. Use proto none (Unmanaged in LuCI) to make such a bridge.
I think if you have anything attached to plain eth0, it will end up receiving all incoming packets regardless of the tag. So tagged and untagged mixed isn't going to work.
the vlan20 interface is not able to obtain an ip from the dhcp.
I started a tcpdump on the ap, and I can see vlan20 tagged dhcprequest packets on eth0.
Then I connected the ap to a switch, activated a port mirror, and tcpdumped what exited the wire of the ap, but there where no dhcprequests with vlan id 20.
This is my ap: https://openwrt.org/toh/hwdata/d-link/d-link_dap-2610
Any hints on why vlan tagged packets don't seem to exit the wire?
It's an IPQ4018. VLANs on those are not straightforward. I don't have any direct experience with one but it is written up somewhere.
I'm searching the forum and reading, and there is a lot of examples with switches, but my device has a single ethernet port. I'm confused and a bit lost.
You're making it even more complicated by trying to run tagged and untagged on the same port. You'll be a lot happier not doing that.
doing a tcpdump -i eth0 -pvne port 67 and port 68 I can see the tagged dhcp traffic on eth0 on the ap, but it does not exit the interface: the packets never show outside the ap on the connected router.