Help with Vlan on raspberry pi 4

Hi Guys, i'm a pretty new on openwrt and networking.

The devices i have are: RaspberryPI4 on OpenWRT, Edgerouter-X on EdgeOS, and ONT from ISP.

i want to use SQM Cake on the Pi and make the devices on the ER-X connect to the internet through the PI.The Pi only has one NIC , so i have to create VLans.

I would really appreciate if someone can point me the direction to do this, i am trying to learn and grasp the concept of vlan and trunk but can't do it on my own it seems.

I was able to create a vlan eth0.10 on the Pi and a DHCP server for it on the ER-X but when i create the vlans on the ER-X it just doesn't work.

Thank you all.

  • gui or command line?
  • are you double natting?
  • or use one internal vlan between edgerouter that holds the external ip and single internal vlan / pi for a single 'sqm' hop? )
  • or is the edgerouter routing natting for multiple vlans ( edit: guess it's this one seeings as you mention dhcp on the edgerouter )... ( are you sending all your subnets the pi as the gateway or something? so no double-nat... just 'internal' sqm hop? / secondary gateway? so the edgerouter nats/dhcps for the for vlans... and that's it... ? )

diagrams help alot with these kinds of things...

1 Like

i have installed luci, but on the moment i'm using ssh with putty

i think i am double nat because the ONT modem is not on bridge mode(can't put it)

well about the diagram:

there is one ethernet cable going from the ONT to the edge router to port eth0

one cable from porth eth1on edgerouter-X to raspberry pi

one cable from porth eth2 to my pc.

i have not created succesfuly any vlan that works the way i want.

it is a terrible drawing but i hope it helps

edgerouter at the moment is on standard dhcp mode.imagem

1 Like

nope... helps alot ( 999 words ) thankyou...

just need to see vlan names on each port / ip ranges... but they can come later ... ( or in text form )...

we do however need to clarify how core routing is occurring here... the modem is also routing? so the edgerouter is pretty much functioning as a L2.5(dhcp) switch? sending the clients dhcp via the rpi via dhcp relay?

1 Like

On the ER-X:

  • VLAN1 should be untagged on eth0, tagged on eth1, and off on the rest.
  • VLAN2 should be tagged on eth1, untagged on eth2,3,4, and off on eth0.

On the RPi:

  • WAN is on eth0.1
  • LAN is on eth0.2

The Vlan1 and Vlan 2 on the drawing are fictional , they are only what i imagine i should do to make it work.

Im trying to figure it out how to made this:
it is somenthing like this ?

For edgerouter-x:

Why do you have two networks? I think you only need one, with a static IP address and a DHCP server, on eth0.2. You should not have any network on eth0.

I cannot see how have you configured the VLANs on the switch.

1 Like

Like this ?

Yes, also delete the gateway from lan interface.


Overview now looks like this:

Now i need to learn how to create proper vlan on the edgerouter-x, i think i need to mark the Vlan-aware box on the switch0 interface and put the correct pvid and vid on each port, i'm trying to learn how to do it reading this:

will post organized screenshots soon.

i'm happy for all the help you guys are giving, thank you.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.