• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Unifi Access Point, Unfi Swifth & pfsense - Looking for a VLAN tutorial

Scheduled Pinned Locked Moved L2/Switching/VLANs
7 Posts 4 Posters 1.4k Views 5 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    pulsartiger
    last edited by Mar 14, 2022, 5:13 PM

    My current network is rather simple, diagram below.

    Modem <--> pfSense box <---> UniFi Switch <---> Many devices including a UniFi AP

    I would like to create a VLAN on my UniFi AP for all IoT devices. I am looking for a tutorial on this - I am new to VLANs.

    I found the tutorial below but it doesn't explain how to prevent the VLAN from accessing devices on my main LAN.
    https://blog.barclayhowe.com/setting-up-a-vlan-in-pfsense-and-unifi/

    Does anyone have a forum post or tutorial that explains this?

    J A D 3 Replies Last reply Mar 14, 2022, 5:24 PM Reply Quote 0
    • J Offline
      JKnott @pulsartiger
      last edited by Mar 14, 2022, 5:24 PM

      @pulsartiger

      My network is similar, but I have a Cisco switch and the VLAN is used for guest WiFi.

      Essentially, you have to use the same VLAN ID everywhere it has to go. In my case, that's pfsense, the switch and access point.

      Do you have a 2nd switch for the IoT, so that you can use a single port to connect it and another to the access point? If so, you'd also enable that VLAN to that switch. Depending on what you're doing, there are a couple of ways to do that. For example, if that 2nd switch has only IoT devices, then the port of the 1st switch is configured as an access port attached to the VLAN. If you want both IoT and main LAN to the 2nd switch, then you configure a trunk port to the 2nd switch and then sort things out further on it.

      PfSense running on Qotom mini PC
      i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel 1 Gb Ethernet ports.
      UniFi AC-Lite access point

      I haven't lost my mind. It's around here...somewhere...

      1 Reply Last reply Reply Quote 0
      • A Offline
        akuma1x @pulsartiger
        last edited by Mar 14, 2022, 5:32 PM

        @pulsartiger Have you found this video yet? The blocking of one network (IOT) from talking to another network (LAN) looks to be right about at the 7:30 minute mark...

        https://www.youtube.com/watch?v=b2w1Ywt081o

        Don't forget, after you do the blocking rule(s), you then need an "allow to any" rule to get the IOT network out to the internet.

        J P 2 Replies Last reply Mar 14, 2022, 7:06 PM Reply Quote 0
        • J Offline
          JKnott @akuma1x
          last edited by Mar 14, 2022, 7:06 PM

          @akuma1x

          Here are the rules I use to allow access only to the Internet and pinging the interface:

          2999bea5-fbf6-43b9-bc88-6df149246444-image.png

          PfSense running on Qotom mini PC
          i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel 1 Gb Ethernet ports.
          UniFi AC-Lite access point

          I haven't lost my mind. It's around here...somewhere...

          1 Reply Last reply Reply Quote 0
          • P Offline
            pulsartiger @akuma1x
            last edited by Mar 15, 2022, 12:34 AM

            @akuma1x said in Unifi Access Point, Unfi Swifth & pfsense - Looking for a VLAN tutorial:

            @pulsartiger Have you found this video yet? The blocking of one network (IOT) from talking to another network (LAN) looks to be right about at the 7:30 minute mark...

            https://www.youtube.com/watch?v=b2w1Ywt081o

            Don't forget, after you do the blocking rule(s), you then need an "allow to any" rule to get the IOT network out to the internet.

            Thanks for the YT video link, I will take a look.

            @jknott said in Unifi Access Point, Unfi Swifth & pfsense - Looking for a VLAN tutorial:

            @pulsartiger

            My network is similar, but I have a Cisco switch and the VLAN is used for guest WiFi.

            Essentially, you have to use the same VLAN ID everywhere it has to go. In my case, that's pfsense, the switch and access point.

            Do you have a 2nd switch for the IoT, so that you can use a single port to connect it and another to the access point? If so, you'd also enable that VLAN to that switch. Depending on what you're doing, there are a couple of ways to do that. For example, if that 2nd switch has only IoT devices, then the port of the 1st switch is configured as an access port attached to the VLAN. If you want both IoT and main LAN to the 2nd switch, then you configure a trunk port to the 2nd switch and then sort things out further on it.

            I only have (1) switch and (1) AP. Both support VLANs. My pfsense box is connected to the switch using a single port and the AP is connected to the same switch. Unless I misread while doing my research, it should be possible to have multiple VLANs on my AP without having separate ports, correct?

            J 1 Reply Last reply Mar 15, 2022, 1:30 AM Reply Quote 0
            • J Offline
              JKnott @pulsartiger
              last edited by Mar 15, 2022, 1:30 AM

              @pulsartiger

              You can have as VLANs to the AP as you have available SSIDs. I asked about a 2nd switch, assuming you might have some wired IoT devices.

              PfSense running on Qotom mini PC
              i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel 1 Gb Ethernet ports.
              UniFi AC-Lite access point

              I haven't lost my mind. It's around here...somewhere...

              1 Reply Last reply Reply Quote 0
              • D Offline
                danievr @pulsartiger
                last edited by Mar 18, 2022, 3:05 PM

                @pulsartiger In the Unifi Controller, for the network you set the subnet for the VLAN as follows
                ec3a21b9-caed-4009-9f8b-ebfa971ba3d8-image.png

                And the VLAN ID as follows
                93e7c28d-65b5-4333-81de-41bf93ffb2e7-image.png

                Then in pfSense you create a VLAN for the same ID
                f2725e9c-4b97-4836-9247-2c344c04c4c0-image.png

                And firewall rules as appropriate. For example I allow my phone/ipad access to certain applications on the LAN (through a HA proxy). Printers are also allowed. I block everything else on VLAN100 to LAN and VLAN200. The last rule is to allow everything, everywhere.
                f16a2da8-876e-4ab7-858b-93753be316c2-image.png

                1 Reply Last reply Reply Quote 0
                7 out of 7
                • First post
                  7/7
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                  This community forum collects and processes your personal information.
                  consent.not_received