How to Create a VLAN - Updated Guide // OpenWrt Router (21.02 +), DSA, Managed Switch, RPi 4

Поделиться
HTML-код
  • Опубликовано: 5 авг 2024
  • Get a 5% off Ekster Products
    shop.ekster.com/devodyssey or discount code "DEV" at checkout!
    (PAID Link)
    Follow me
    Twitter - / dev_odyssey
    Facebook - / dev0dyssey
    Support me (includes paid affiliate links)
    Humble Software Bundle | All-in-One Python by Packt - bit.ly/3sNRDMI
    Welcome back to Dev Odyssey Home Networking! In this episode, I show you how to make an OpenWrt Raspberry Pi into a managed switch, using Distributed Switch Architecture (DSA) VLANS in OpenWrt 21.02.
    Legacy VLAN configuration was done using swconfig, and still is for devices that do not have DSA capable drivers. For those that have DSA drivers, creating VLANs over bridged interfaces is the best way to create VLANs. DSA has been around for quite some time in the linux kernel, and recently has been adopted in OpenWrt as it provides superior capabilities for VLAN configuration. Once you know how to create VLANs using DSA, using them to create a managed switch set up is a breeze.
    I also cover the generic way to create VLANs for those who can't use DSA bridges. Lastly you'll learn how to apply these VLANs for WiFi networks.
    During my testing, I did experience a caveat when attempting to use DSA VLANs over WiFi, specific to Raspberry Pi. My wireless devices simply could not connect to WiFi. This is apparently a known issue, and you can find my OpenWrt forum post in the links below. To overcome this, I created a configuration that does not use DSA bridges, so you can use VLANs over WiFi, which was recommended by the community.
    Links
    OpenWrt DSA Start Guide
    openwrt.org/docs/guide-user/n...
    OpenWrt Forum Post VLANs on WiFi Raspberry Pi
    forum.openwrt.org/t/raspberry...
    Configuration Files
    DSA Router
    gist.github.com/odevodyssey/5...
    DSA Switch
    gist.github.com/odevodyssey/5...
    Non DSA Switch
    gist.github.com/odevodyssey/b...
    Chapters
    00:00 Intro
    00:36 VLAN Changes in OpenWrt
    01:00 SWConfig vs. DSA
    01:41 Hardware Overview
    02:20 DSA VLAN Config
    07:15 Regular VLAN Config
    07:52 Managed Switch Config
    13:52 DSA VLANs WiFi
    14:14 Caveat RPi 4 VLAN WiFi
    14:59 Outro
    Attributions
    Rainforest by Spiring / user-57630131
    Creative Commons - Attribution 3.0 Unported - CC BY 3.0
    Free Download / Stream: bit.ly/3s5yiGk
    #RaspberryPi #VLAN #Router #OpenWrt #HomeNetwork
  • НаукаНаука

Комментарии • 35

  • @DevOdyssey
    @DevOdyssey  2 года назад +1

    Would you set up a managed switch in OpenWrt, or would you buy one?

  • @HeinserTorres
    @HeinserTorres Год назад

    Great video keep it up!

  • @looper6120
    @looper6120 Год назад +1

    Very interesting topic! Thanks for the effort. I have a nanopi r4s, it has two ports, I assume I can make this happen on it. However, I'm wondering about the router, does the router have to support vlan? For example, I have a consumer router that doesn't support Vlan by itself, I'm trying to build or buy a managed switch, and connect it to one of the LAN port, then add one more AP to my managed switch to have an isolated VLAN just for that AP? Is this doable? Or the router itself have to support vlan first?
    I'm not so sure if I can just buy a managed switch and use it combined with my consumer router, can completely do the Vlan config on my managed switch, then throw in a couple of dumb APs just for the Wifi, thanks again!

    • @DevOdyssey
      @DevOdyssey  Год назад

      Thanks for watching LOOPER and you're welcome!
      With the NanoPi R4S, I think you should no problems there on the VLAN side of things, using DSA and OpenWrt. Yes the router does have to support VLANs both from a hardware perspective and software. Chances are, from a hardware side of things, you should be fine. You're scenario should work, on the condition that VLANs are supported via software. You can flash a consumer grade router with OpenWrt and get VLAN capabilities, so long as its supported by OpenWrt. But it needs to support VLAN functionality so you can tag it. On the AP side, if you just want one network associated with that isolated AP, you can connect it to an untagged port and you should be good to go, it wouldnt need to support VLANs. However, if you want to broadcast multiple WiFi networks with different networks via multiple VLANs, then your AP will also need to support VLANs.
      You can buy a managed switch as that will support VLANs, but the router is what would create the VLANs so that needs to support it. You can use your NanoPi R4S for this. Then you can manage the VLANs via the managed switch to tag / untag the VLANs on the managed switch ports. Then you can add Dumb APs as you see fit (only on untagged VLAN ports since they are dumb APs) to broadcast your one WiFi network.

  • @ipstacks11
    @ipstacks11 Год назад

    Hi Orest. You did a great job Sir. After watching a couple of your videos, I think I have a much better understanding of how to configure trunks and interfaces. I am wanting to setup VLANs per SSID and you really covered that well. I don't know how much teaching you've done but you are good at it. I like how you put everything together and showed what you are doing with the hardware and in the software. You even covered the Switch "screen" which I was hoping to learn more about. Honestly I can't think of anything you didn't cover to get a well configured setup, you even explained the ingress setting for the (PVID) for VLAN interfaces! I have a Banana Pi R3 on the way and I am hoping openwrt will support it beyond snapshots soon. Thank you for the excellent video. If you are looking for ideas I would be super interested in video covering mesh and fast roaming with VLAN/SSID pairing. Thank you again!

    • @DevOdyssey
      @DevOdyssey  Год назад

      Hi Jeff,
      Thanks for watching! I’m flattered with how much detail you went into from my videos, let alone all the videos of you watched. I’m glad my videos could help you get a better understanding of how to achieve the router setup you want. I haven’t ever taught in a formal capacity, other than teaching colleagues at work. I just like to go into detail as I assume whatever is on screen, and if I haven’t covered it in a prior video, that I should talk about it, at least at a high level, if it’s not too important for the setup I’m doing per video. Showing the hardware bridges the gap between understanding both parts of the setup, so I find that important to show. As for the switch setup, I’m happy you found value in that. You may not need it depending on what the Banana Pi R3 supports in terms of VLANs (DSA or not). So I’d try DSA first and then switch config if that doesn’t work. PVID I covered as I didn’t understand at first what it was for. So I researched it a bit so I could understand and explain it, albeit not being an option used very often. We can only hope the devs will support the Banana Pi R3 beyond snapshots, but if not, you can always create your own custom image, as I’m sure you watched my building OpenWrt video. There’s even an easier way to do builds that I did cover, using the firmware selector (website), so if you don’t need custom configs, I’d try that first. You’re welcome! Thanks for being such a big fan, I really enjoy hearing what my viewers learn from my videos.
      As for future video ideas, I have too many and too little time. It’s funny you say that as that’s a video idea I explored awhile ago, but havent gotten around to it. I would use batman-adv package to achieve it, part of the Open Mesh Project. That should cover your use cases too with fast roaming. Depending on your hardware, you’d want to use devices with good wireless radios (usb wireless radios or ones built into an SBC, with good antennas too). A basic Raspberry Pi wouldn’t do well, given its antennas, as it’s meant more for acting as a wireless client, rather than an access point. My idea was to use Raspberry Pis with wireless usb devices that use atheros chips, as those have the most OpenWrt support. Nonetheless, thanks again, and check out the link below for some mesh information with OpenWrt.
      www.open-mesh.org/projects/batman-adv/wiki/Batman-adv-openwrt-config

  • @MatthewN8OHU
    @MatthewN8OHU Год назад +1

    Would this work for a Raspberry Pi 4 B and something like a Linksys E2500 set up as a switch, since that model of router doesn't have Wi-Fi support in OpenWRT? If so, do you have a video on how to set that up?

    • @DevOdyssey
      @DevOdyssey  Год назад

      Thanks for watching Blade's Toy Shop!
      First, are you speaking about v3 of the hardware? It seems like you are since that version does not have wireless support.
      openwrt.org/toh/linksys/e2500_v3
      As long as Linksys E2500 has VLAN support (which it looks like it does), which it likely does, then setting it up as a managed switch should work. I don't have a video on how to set that up, but the set up should be the same as in this video, if DSA VLANs are supported.
      If not, and swconfig is the supported VLAN software, then my prior video on VLANs would then do the trick.
      ruclips.net/video/5TtlAXeaGUM/видео.html
      I can't seem to find which VLAN software is supported, but one of those should work.

    • @MatthewN8OHU
      @MatthewN8OHU Год назад +1

      @@DevOdyssey I don't think any of the E2500 models have Wi-Fi support because the one I have doesn't show the Wi-Fi radio. I also believe I have a v1 because it doesn't have any version number on it (I actually have three of them, but I fried one the other day). Thanks for the response; I'll see if I can get the router properly configured so I have an actual switch instead of an ancient 10BaseT Five port hub.

    • @DevOdyssey
      @DevOdyssey  Год назад

      @@MatthewN8OHU Looks like you are right according to their table of hardware, none of the Linksys E2500 supports WiFi, likely due to issues with Broadcom WLAN drivers.
      You're welcome! Glad I can help. I hope you can get it configured and working properly, instead of being a slow dinosaur at this point haha.
      I have an old Linksys WRT54G that I'm not sure what to do with. Given how old it is, it really won't function that well in any modern network, which is the only reason why I'll find somewhere to recycle it. Otherwise, I'd keep it. Used to be a very well loved router back in the day, but as with any tech, time gets the better of it.

  • @deonliberator8953
    @deonliberator8953 Год назад

    Thank you for your tutorial ,it was very helpfull

    • @DevOdyssey
      @DevOdyssey  Год назад

      You're Welcome Deon! Thanks for the compliment and for wawtching 😊

  • @manik5824
    @manik5824 Год назад

    hello,
    i am having tplink router with dhcp eabled and cisco switch sg350 with openwrt router 22.03 can you please tell how can i enable vlan in this setup

    • @DevOdyssey
      @DevOdyssey  Год назад

      Thanks for watching Mani!
      Does the TP Link have OpenWrt on it? If not, I'm not sure how to set up VLANs on TP Link routers, or if they have that feature. I think some of them can, but it depends on the model and the software. As for the Cisco switch, I don't think there is any switching hardware that can actually run OpenWrt, simply given the nature of switching hardware and their MCUs. I don't see it in their list of hardware, so I assume you may be mistaken here.
      If its your TP Link router running OpenWrt, then you should be able to get this working with your Cisco switch. Simply set up the TP Link router with VLANs as in this video, such as at 2:20, and then on the Cisco switch side, make sure you create a corresponding VLAN(s) with the same numbers. Then make the ethernet port you connect on the Cisco switch, the trunk port, and the port on the TP Link router, a trunk port (aka carrying all your VLANS), and now your Cisco switch can carry all your VLANs, and you can assign your VLANs out to different ports on your Cisco switch.

  • @mihalcimihalci4768
    @mihalcimihalci4768 Год назад +1

    HELLO, tank you for tech ass, do you familiar whit Fritz Box?
    Special 7530.

    • @DevOdyssey
      @DevOdyssey  Год назад

      Thanks for watching Mihalci!
      I am not familiar with Fritz Box, other than the name, and knowing they make routers. If you want to run OpenWrt on this router, I'd refer you to the table of hardware on OpenWrt's forum. I searched it for you and was able to find the FritzBox 7530.
      openwrt.org/toh/hwdata/avm/avm_fritz_box_7530
      This should provide you the information you need to install OpenWrt onto your router.

  • @XSTAYUPX
    @XSTAYUPX Год назад +1

    22.03 please, great vid

    • @DevOdyssey
      @DevOdyssey  Год назад

      Thanks for watching Geoff!
      Appreciate the compliment. The major architectural change to DSA (from swconfig) occurred in version 21.02, using an updated Linux kernel (5.4). There have been no changes since then on how VLANs are configured, and chances are won't be any future changes for awhile, if not at all. So the same concept should apply to OpenWrt 22.03, granted making sure your hardware supports DSA VLANs.

  • @mansurbhamani3905
    @mansurbhamani3905 Год назад +2

    Good explanation but a topology diagram would help to understand exactly what you are trying to do and achieve.

    • @DevOdyssey
      @DevOdyssey  Год назад +2

      Thanks for watching Mansur!
      I appreciate the compliment. You are definitely right in that aspect, a picture is worth 1000 words. A topology diagram would indeed be helpful.
      While in this video it's simple, some other videos have more complicated network topologies. I recently found a great software to help me create those topologies for visual purposes, and in an upcoming video I'll be using it.
      Anyway for a quick explanation on this video, the topology is effectively this:
      Router (VLAN 1,2) -> Switch
      Here the router creates VLANs 1 and 2, and passes them to the network switch via a trunk port. Then the switch can pass the VLANs to an end device, such as a laptop.
      Switch (VLAN 1) -> Laptop
      This is what you see at 11:54, where my laptop is on VLAN 1 network
      After that, I try out VLAN 2, by making some changes in the managed switch, and it looks like this.
      Switch (VLAN 2) -> Laptop
      Here, my laptop is on VLAN 2 network.
      While this isn't as good as a topology diagram, I hope this is simple enough to visualize the networks, and how they are passed from router, to switch, to laptop.

  • @coppenhall
    @coppenhall 3 месяца назад

    skinwalker walk through next please 🙏

    • @DevOdyssey
      @DevOdyssey  3 месяца назад

      Thanks for watching @coppenhall! I’ll be honest I’m not sure what you mean by ski skinwalker, do you mean a new skin / theme for OpenWrt? You can find some if you do some searching and just upload it, or if you want to get your hands dirty with some html and css, you can probably make you’re own without too much difficulty.

  • @markf13579
    @markf13579 2 года назад

    Thanks for the video. However, compared to other YT videos the sound is very low and you are hard to understand.

    • @DevOdyssey
      @DevOdyssey  2 года назад

      Thanks for watching Mark!
      When I was making this video, I did get some new audio and video equipment and was having trouble with getting the audio just right. I did some post editing to increase the volume to make it more audible. I was able to improve it for my videos after this one.
      Sorry about that!

  • @_mult
    @_mult 7 месяцев назад

    Update guide, openwrt 23

    • @DevOdyssey
      @DevOdyssey  7 месяцев назад +1

      Thanks for watching @_mult! To my knowledge, all versions of OpenWrt 23 use DSA for VLANs (so long as the hardware supports it) and I don't believe the LuCI GUI has changed either. With that, this guide should equally apply. Unless I am incorrect, then please let me know. Or if you have any particular questions setting up DSA VLANs, feel free to ask.

  • @jeancharlesc.6290
    @jeancharlesc.6290 2 года назад

    noob here , like all video i have error ,
    sudo apt install build-essential ccache ecj fastjar file g++ gawk \
    gettext git java-propose-classpath libelf-dev libncurses5-dev \
    libncursesw5-dev libssl-dev python python2.7-dev python3 unzip wget \
    python-distutils-extra python3-setuptools python3-dev rsync subversion \
    swig time xsltproc zlib1g-dev
    E: Package 'python-distutils-extra' has no installation candidate
    .... one more how to i cant made ,
    your one is fresh ....
    disappointing not being able to make the tutorials on youtube ..,
    newbie here, and looking to secure my network a little more...

    • @DevOdyssey
      @DevOdyssey  2 года назад

      Thanks for watching Jean Charles C!
      In regards to your error, I'm not sure where you are encountering this error in this video. OpenWrt doesn't use apt for the package manager, so you shouldn't be encountering the error here.
      From what I see, it looks like you're trying to set up a build environment for OpenWrt, and your comment likely references that video. Is that correct? If so, then are you using Debian 11.2? Try running your sudo apt command again, and remove the "python-distutils-extra" package, as you many not actually need it to build OpenWrt. In 02:44 in the Building OpenWrt video, I don't see this package in there. So try proceeding without that.
      ruclips.net/video/m9uWM6QUnpM/видео.html
      In addition, if you have further questions regarding that video, make a new comment in that video so others can view the relevant information for that video. Thanks!

  • @EmilePolka
    @EmilePolka Год назад

    Wtf is this.... Im expecting something like repurposing a old router to use it as managed switch, but here me watching a stupid setup like this, getting a vlan aware switch is not that hard to find now a days.

    • @DevOdyssey
      @DevOdyssey  Год назад

      This video demonstrates how to use OpenWrt as a managed switch using DSA based VLANs with hardware that happens to be a RaspberryPi.
      This configuration is not tied to Raspberry Pi and will work on other routers that support DSA VLANs. The concepts can even be extended to routers that still use swconfig.