How to configure VLAN on DIR-882 (there is vlan support bot no switch)


I am a little bit lost how to configure a VLAN on DIR-882 (there is vlan support bot no switch).
I think i need to create driver-level VLANs.

Found the following in the documentation:

Switch Ports (for VLANs)

Numbers 0-3 are Ports 1-4 as labeled on the unit, number 4 is the Internet (WAN) on the unit. Don't be fooled: Port 1 on the unit is number 3 when configuring VLANs. vlan0 = eth0.0, vlan1 = eth0.1 and so on.

Port Switch port
Internet (WAN) 4
LAN 1 3
LAN 2 2
LAN 3 1
LAN 4 0

I wonder for example how can i able to put LAN1 and LAN2 to VLAN10

  • Lan1 is tagged
  • Lan2 is untagged

Also if somebody has some example configuration would be appreciated.

Thank you

1 Like

Each port on MT7621-based routers has its own interface, so, although they support VLANs, the configuration currently can't be done from LuCI as far as I know...

I'm having the same issue.
Although I'm somewhat (not extremely) experienced configuring networks, I'm brand new to OpenWRT and still unfamiliar with UCI. I'm improving little by little but still can't find a way to set this up.

My ISP requires the WAN PPPoE connection to be tagged with VLAN 100. Since it's currently not, they drop my connection every 20min or so.

My router is a DIR-878 that also has the same note regarding the switch ports as @ebalcsk 's does.

Should I open a new topic or may I post here as it's a very related issue?

I've tried to append ".100" to the wan ifname, but that didn't work - it wouldn't connect with pppoe and my SQM config would stop recognising the wan interface.

I've also tried creating a "config device" section per the documentation, associating the wan ifname to a 8021q device. That also didn't connect.

I feel I'm missing something here.
Again, sorry if I'm not posting at the correct place - I think OP is facing the same issue on very similar hardware and this will benefit him as well.

This is /sys/class/net and swconfig list:

This is /etc/config/network:

Yup, my ISP uses "guest"/"guest" for all customers.

The 5.4 kernel uses DSA which takes over the switch hardware and makes it invisible to the user configuration.

The notation wan.100 is supposed to work but last I know, that functionality is still not implemented or broken on the MT7621 chip.

You could work around by using an external managed switch to apply tags. Or look into the modem configuration if the ISP allows access to the modem usually they can be set up to tag internally.


Thank you! I've done some testing and it seems that I managed to get the upstream modem - connected to the router's WAN port - to handle the VLAN tagging.

Should we file a bug report on this issue or is this being handled by someone? I had no idea support for this device isn't complete yet.

My PPPoE still keeps disconnecting. I've done some more digging and it appears to be a common issue. I'm currently testing out the "option keepalive" fix and will report if my interface uptime is fixed. Not sure if OP is trying to set up his ISP connection or if he needs VLANs for something else?

No love, still disconnecting all the time.
I'll open a new topic to troubleshoot this.

Edit for further reference: PPPoE disconnects all the time

I'm using VLAN tag in the PPPoE connection with DIR-882 (VLAN ID 10), all I've done is to set my WAN Interface to wan.10

My connection problem has been confirmed to happen upstream, adding the VLAN id suffix to the ifname works as expect.

Please correct me if i wrong i am just guessing

  1. the switch is configured to put all of the interface to separate lan except 6. which is trunked.
  2. those vlan is exposed to us as LAN1, LAN2, LAN3, LAN4 and WAN
  3. and than from sw we are doing the bridging for Lan[1..4]

I wonder why it was done ?????????????
Losing both the HW switching speed
Losing the vlan capability

I really need this.

This future in dd-rwt implemented in a sensible way but unfortunately my IOT devices cannot connect

DSA is supposed to be smart in combining hardware switching with software bridging. Two ports that are in the same bridge with the same VLAN should end up hardware switched. Packets would only be sent through the CPU if necessary, for example connecting lan1.6 to lan2.10 would require the CPU to rewrite the VLAN number.

That is the idea anyway. I don't know if actually has been achieved, have not tried it. My MT7621 devices are in 19.07.3 so I use that with its conventional separate switch configuration.

Thank you for your answer.
I wonder how i can configure this?
Need to edit from commandline (ssh) /etc/config/network file?

what do i need to add if i want to configure vlan10 for lan1?

config interface 'lan1.1'
option proto 'static'
option netmask ''
option ipaddr ''

thank you

option ifname 'lan1.10'

This should emit / receive packets tagged with VLAN10 from the lan1 port.

When doing that don't have a plain 'lan1' anywhere else in your config. You can use multiple VLANs on one port as long as they are all tagged.

The name you give the interface on the config interface line doesn't matter much but I'd use something like vlan10 to avoid confusion.

Thank you for your help it is working :slight_smile:

Here is the config for reference:

root@OpenWrt:/etc/config# cat network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr ''
        option netmask ''

config globals 'globals'
        option packet_steering '1'
        option ula_prefix 'fdea:cdbd:4fb4::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'lan1.1 lan2 lan3 lan4'
        option proto 'static'
        option ipaddr ''
        option netmask ''
        option ip6assign '60'

config interface 'wan'
        option ifname 'wan'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'wan'
        option proto 'dhcpv6'

config interface 'VLAN_10'
        option type 'bridge'
        option ifname 'lan1.10'
        option proto 'static'
        option ipaddr ''
        option netmask ''

Unfortunately i just realized the bridging is not working :frowning:

config interface 'lan'
        option type 'bridge'
        option ifname 'lan1.1 lan2 lan3 lan4'
        option proto 'static'
        option ipaddr ''

i can able to ping between host's in lan2 lan3 lan4 also can ping the router. this is working properly
the host in lan1.1 can able to ping the router but cannot able to ping anybody in [lan1 lan2 lan3] and vice versa