Rp4 to rt3200 vlan trunk to carry rt3200 wlan traffic

Referring to this thread

It looks like the rpi4 has no built in switch so requires special non-DSA config, I think?

As per the title, I've used this links in the thread above to build an rpi config, for a router with 2 phy i/f's each trunking VLAN 10. See attached image for detail.


I'll add another VLAN for guest later when the first one works. As follows, is this config correct? I'm not sure if the devices need to be explicitly tagged @dev_odyssey

config interface 'lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option device ‘br-lan’
        option ipaddr '192.168.1.1'

config device
        option type '8021q'
        option ifname 'eth1'
        option vid '10'
        option name 'eth1.10'
        
config device
        option type '8021q'
        option ifname 'eth2'
        option vid '10'
        option name 'eth2.10'

config device
        option type 'bridge'
        option name 'br-lan'
        list ports 'eth1.10'
        list ports 'eth2.10'

Why 3 NICs? Recommend a cheap managed switch for working with VLANs. You can drop down to just 1 external NIC and the onboard one.

Hi @realreform,

I made a video that might help you with this, feel free to watch it. The description includes working configs that you can use as examples.

Anyway, it seems like your config is for your RPi 4 OpenWrt router, but if not, please clarify what that config is for.

As of now, you have one VLAN per ethernet interface, VLAN 10 on eth1 and eth2. You also seem to be doing this in the non DSA configuration, so be sure to check out that specific link in the video (or below)

From the looks of it, after doing a couple passes, it seems to make sense, and I think it would work, though I'm not 100% sure. Have you tried it out yet? As for the AP endpoints, be sure that you untag that traffic on the interface, making them VLAN aware.

Curious to see how this works as I personally haven't tried creating a bridge between two VLAN interfaces, that reside on two different physical ports, at least with OpenWrt.

If this doesn't work, it may be easier to just get an inexpensive managed switch as @darksky recommended, put that in between your APs, and untag the right ports and send that traffic over to the APs. Given the limited number of native ports on an RPi 4, it would probably make the most sense to get a managed switch, especially when you want to add more ethernet devices to your network.

3 Likes

Thanks for the hints. I've been using your guides from day one already. I got the Rpi going in the end. Its not complete yet, while I resolve a wlan problem on the rt3200 dumb ap. But traffic from an untagged lan port on the rt3200 crosses the vlan through the router to the internet and back fine.

1 Like

@realreform Awesome! I'm glad my content has been helping you out :slightly_smiling_face:

Also great to hear you got the RPi end working as expected, with the untagged traffic moving via the VLAN and lan port from your rt3200 through the Pi, and the internet.

What's the issue with the wlan? Is it related to the VLAN you've created? Maybe I have 2 cents I can offer here.

Thank you! Any help most welcome.

For the WLAN problem on the RT3200 dumb AP:

  • I've attached the WLAN devices to the same 'lan' interface I'm using for the working untagged lan port

  • But I see no traffic and cannot get a DHCP response and DNS etc on connected wlan clients

  • I suspect its because simply attaching the wlan device to the lan interface does not make an untagged vlan port for the wlan device

  • I cannot find a way to add the WLAN device to the DSA dialogue so that I can make it vlan untagged

Any help or suggestions I can try most welcome.

In the DSA device (RT3200) you should have set up bridge-vlans inside a single master bridge. Each interface (layer 3 network, e.g. config interface 'lan') is attached to one of the bridge-vlans with option device br-lan.X with X being the VLAN number. When a wifi AP wifi-iface is added with Network matching one of the interface names, it will become part of that bridge-vlan.

Thank you for this. I believe I've configured it as you suggest as below. But its still not working. Please is it possible to suggest how I modify the UCI config to get it running as you suggest?

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 'fd34:514c:bc94::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'

config interface 'lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.1.2'
	option device 'br-lan.10'

config interface 'guest'
	option proto 'static'
	option device 'guest'
	option ipaddr '192.168.3.2'
	option netmask '255.255.255.0'

config device
	option type 'bridge'
	option name 'guest'
	list ports 'lan3'
	list ports 'lan4'

config bridge-vlan
	option device 'br-lan'
	option vlan '10'
	list ports 'lan1:t'
	list ports 'lan2:u*'

Use one bridge with all the Ethernet ports. Everything Ethernet related will be a bridge-vlan within that single bridge. I usually name it br-eth instead of br-lan to emphasize that functionality.

This seems to be the only way that DSA will get hardware switching to work properly.

I moved all lan ports onto the br-lan bridge and deleted the guest one. No joy.

Would you be able to show me correct the UCI config please?

Dear All,

It seems this setup has not been tried successfully yet, or might not actually work. I've tried everything, tanks to your help.

Would anyone be able to make suggestions as to how to make it work please? And if I succeed, I'll promise to publish everything I find.

It seems like a deployment that will be great for many.

Looking forward to your comments.
Robin.

Is it possible on the RT3200 to do vlans without DSA? i.e. the old way.

Old way = switch interface = no

Thanks. Thought so. I have found an error in my firewall config I'll try out later. Not sure why this would affect only the wlan ports and not the lan ports using the same network interface. Though I know they are structurally different.

Are you sure that SW does not still make it possible?

SW? Just use DSA.

The whole point is that DSA does not work with wlan and vlans

Since when? There are tons of examples of working configurations with DSA operating with multiple VLANs and SSIDs.

Post the latest configuration (network and wireless files) for us to review.

See below for configs.

Also if you can send me a known working config I'll try to figure it out this end too?

I have checked traffic is passing from lan ports on the dumb ap, over vlan 10, to the router, using tcp dump

But from a wlan client I only get as far as seeing the client coming up on the dumbap - status - wireless, but no DHCP request, so all stops there.


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 'fdf5:86a2:b035::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'
	list ports 'lan4'

config interface 'lan'
	option proto 'static'
	option ipaddr '192.168.1.2'
	option netmask '255.255.255.0'
	option gateway '192.168.1.1'
	list dns '192.168.1.1'
	option device 'br-lan.10'

config bridge-vlan
	option device 'br-lan'
	option vlan '10'
	list ports 'lan1:t'
	list ports 'lan2'
	list ports 'lan3:u*'


config wifi-device 'radio0'
	option type 'mac80211'
	option path 'platform/18000000.wmac'
	option channel '1'
	option band '2g'
	option htmode 'HT20'

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 '1a143000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
	option channel '36'
	option band '5g'
	option htmode 'HE80'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'none'



You should explicitly state the tagged/untagged status of port lan2. Right now, it is presumably untagged, but set it as lan2:u* to make it explicit.

Then, once that is done, plug a device into port 2 or port 3 and see if it gets a DHCP address. Report back on the status there, and also please post your /etc/config/dhcp file.