VLAN configuration on a "smart" switch for a guest WiFi network


Recommended Posts

So I finally got round to buying a proper access point (Unifi nanoHD), which is capable of having multiple SSIDs, mapped to VLANs.  I have a "smart" switch (TP-Link TL-SG2008), and a PFSense based firewall (SG2220).

 

Assuming that:

1) The AP is connected to the switch on port 1

2) The firewall is connected to port 8

3) There a bunch of other "trusted" devices on the other 6 ports.

4) I want my "trusted" network to run on VLAN 11.

5) I want my "untrusted" network to run on VLAN 99.

 

Is it right that I?

Set up a "trusted" SSID on the AP, which is on VLAN 11.

Set up an "untrusted" SSID on the AP, which is on VLAN 99.

Set up port 1 on my switch to preserve VLANs

Set up port 8 on my switch to preserve VLANs

Set up ports 2 through 6 to tag packets on entry with VLAN 11 and strip VLANs on the way out

 

Does anyone know how to achieve the configuration on my particular switch?

Also what changes do I need to make to pfSense to treat the VLANs as logical interfaces, each with their own subnet, DHCP ranges, internet access and prevent any routing between them?

 

Is there a specific sequence I need to do this all in so I don't lose connectivity to the various components whilst I make the changes?

In your pfsense config, you will want to create your vlans.  What you will do is create a rule to block traffic coming from your guest vlan to your private vlan, it will be able to communicate with all other networks.  

 

You will trunk your vlans on a port (usually you just have to enable trunking, but you can tell it to include those vlans on that trunk port) to the switch.  You will probably have to configure the switch port that is coming from pfsense to trunk.  You will have to configure the switch with the vlan id's that are coming from the pfsense router.  Then you can assign those vlans to ports.  

 

If you have a AP that is vlan capable (**cough** ubiquiti **cough**), you would trunk all of the vlans to that and make your AP default to the private vlan or a management vlan of some sort (so add another vlan for management of devices that can only have source traffic come from your private vlan, another pfsense access control list) to manage networking devices.  Then you can have your AP host both the Guest VLan via a Guest SSID and your Private vlan via Private SSID.

 

 

Draw it out on paper first on how you want things to work.  It will then become clear to you what you have to do and if you will or will not experience an outage.  Understand that you will probably have 1 lan  for internet traffic to go across, 1 lan for house, 1 lan for guest, if any guest or house will need to share devices like printers, another for printers/shared devices, and maybe for the hell of it one for IoT devices.  (fyi, I don't see a way to not have an outage of some sort...you can create the networks and test, but when you move devices over to the new LANs they may have to reboot).

 

On 5/24/2019 at 2:33 PM, sc302 said:

Draw it out on paper first on how you want things to work.

This is very good advice... This will allow you to understand exactly what has to be done, and where.

1 minute ago, sc302 said:

And vlan 2 (or whatever vlan....could be vlan1 but that is just lazy) going between modem and router. Internet traffic isolated on its own vlan to not mix secured from unsecured devices

Can you explain that?  Given that the modem is ISP provided, with no control whatsoever in terms of VLANs, how would I achieve this?

The isp goes into the router. Whatever that is it is a Vlan or untrusted network.  This would be an untagged port. If we are treating this as an outside/untrusted network on a firewall/router nothing else is needed to be done.  

31 minutes ago, BudMan said:

So both of those vlans are tagged or is one native (untagged) and the other tagged? 

Is one of these choices better than the other? If I choose to leave one untagged, would it be the trusted or guest one?

 

32 minutes ago, BudMan said:

At the switch and router? 

Don't understand this question.

 

The picture is meant to be of what I want to end up with, not what I have right now (single SSID, no tagging at all anywhere)

16 minutes ago, Fahim S. said:

The picture is meant to be of what I want to end up with, not what I have right now (single SSID, no tagging at all anywhere)

tagging/untagging is how switches work.  an untagged port is an access port.  An access port is an endpoint port where a device on the other end is essentially dumb and doesn't know the difference between tagged and untagged traffic.

 

Tagged is how a trunk works, this allows the port to encapsulate all of the vlans you choose on a single port.  You can have a native vlan (untagged) and several encapsulated vlans (tagged) on a single port that connects to a switch that can decipher this type of traffic (known also as 802.1Q).  

 

For your ap to work, it will have one port.  That one port can support all of the vlans you want to send over to the AP.  You can have the AP on both a tagged and untagged port...the tagged vlan will be the guest vlan and the tagged/untagged vlan will be your secured vlan.  just like in your picture.  

 

You need to understand the terminology, that is all.  If you don't know ask, don't assume that you aren't tagging anywhere, you have to tag for vlans to function across a single port.

 

edit: so you don't get confused, and being that budman has more time with helping, I will let him work with you.  If you get stuck or need simpler explanation please ask.

As to tagged or untagged doesn't matter which... Its just how you set it up.. Its normally more intuitive on say your router where the actual physical interface network is left untagged.  Vs not putting any network on the physical interface, and only enabling vlans that run on that phy interface.

 

As to switch and router, this is where native or untagged vlan will come in to play. For example out of the box on a switch the vlan 1 is untagged. 

 

On your AP if you do not set a vlan for an SSID, then it would be native untagged... And that would be need to be set on the switch port the AP is connected too.  If you tag both SSIDs on AP with vlan IDs then you would have to set them as tagged on the switch port the AP is connected too.

 

On the interface to the router same thing - if you set both as tagged vlans on your router, then they would both have to be tagged on the switch port that connected to your router.

 

On a port that carries more than 1 vlan, only 1 could be untagged (native) all other vlans would have to be TAGGED... Or all of them could be TAGGED... All depends on the device your connecting to that switch port and how its configured for native or all tagged, etc.

 

To be honest I think tag and untagged is what confuses the most new users to vlans.

11 minutes ago, sc302 said:

edit: so you don't get confused, and being that budman has more time with helping, I will let him work with you.  If you get stuck or need simpler explanation please ask.

Thanks for the offer (I genuinely am grateful), but with the very greatest respect I never find your explanations very "simple".

 

4 minutes ago, Fahim S. said:

Thanks for the offer (I genuinely am grateful), but with the very greatest respect I never find your explanations very "simple".

 

Interesting, but ok.  I do take great pride to simplify things, but completely understandable.  Everyone has different understanding levels, some people require many different approaches until they finally understand (or think they do). 

21 minutes ago, BudMan said:

As to tagged or untagged doesn't matter which... Its just how you set it up.. Its normally more intuitive on say your router where the actual physical interface network is left untagged.  Vs not putting any network on the physical interface, and only enabling vlans that run on that phy interface.

 

As to switch and router, this is where native or untagged vlan will come in to play. For example out of the box on a switch the vlan 1 is untagged. 

 

On your AP if you do not set a vlan for an SSID, then it would be native untagged... And that would be need to be set on the switch port the AP is connected too.  If you tag both SSIDs on AP with vlan IDs then you would have to set them as tagged on the switch port the AP is connected too.

 

On the interface to the router same thing - if you set both as tagged vlans on your router, then they would both have to be tagged on the switch port that connected to your router.

 

On a port that carries more than 1 vlan, only 1 could be untagged (native) all other vlans would have to be TAGGED... Or all of them could be TAGGED... All depends on the device your connecting to that switch port and how its configured for native or all tagged, etc.

 

To be honest I think tag and untagged is what confuses the most new users to vlans.

OK... but in my switch I can set a port (on a per VLAN basis) as Untagged, Tagged, or Not Member. I can also give a port a PVID.  The switch doesn't have an option to set a port as an access port or trunk as such. 

 

I am pretty sure that for VLAN 99 I want to set port 1 and 8 as tagged and the others as Not Member. 

 

But what do I do for VLAN 11? Set them all to Tagged? What PVID should they have?

 

 

So if you put a port in vlan 11, and your going to connect a computer to it then that would be untagged 11 with pvid set to 11... This tells the switch when it sees untagged traffic coming into that port that its vlan 11.

 

When you connect say your router that is using untagged (native interface on the router) and you want that as 11, then same thing untagged 11, pvid 11

 

For the vlan 99 which you run on top of that physical interface, on the switch port it would add tagged 99.

 

For your access point same sort of thing.. if you do not put a vlan ID on one of your SSID that would be the untagged and pvid setting, with the other vlan set to tagged.

 

Your running pfsense as your router?  I can show you some screenshots of what I mean by native and vlan on pfsense.

got it.. thank you!

I decided to keep my trusted network untagged and decided that VLAN 100 would be a better choice for guest.

 

OK.. now the pfSense set up...

I set up a VLAN for 100, and then a (sub)-interface for this VLAN

I then set the interface with a static IP (I used 192.168.100.1 /32).  Kept everything else as default.

When I go to add a DHCP server, I don't even see the tab for my Guest network. 

 

Have I done something wrong?

 

2 minutes ago, Fahim S. said:

/32).

that is wrong!  You prob want /24 which would be 192.168.100.1-254 would be valid IPs on that network.

 

/32 is all 32 bits.. so 192.168.100.1 is the ONLY address.  So can not run a dhcp server on that ;)

Just now, BudMan said:

that is wrong!  You prob want /24 which would be 192.168.100.1-254 would be valid IPs on that network.

this is because /32 is a single IP Address and /24 would be a block of IP addresses? I don't understand how that works..

 

OK.. so now I have a DHCP server, giving out addresses 192.168.100.10 through 192.168.100.100.

Now no matter which WiFi network I get on, I can get out to the internet, which is good, but both networks can see devices in the trusted network.

 

How do I stop this?

Ooops...Completely forgot the firewall rules.

 

I added 2 rules.. an allow all, and a deny access to the trusted network, both to the Guest interface.

Do I need to add a similar deny rule to stop the trusted network being able to access the Guest network?

I can reach the pfSense administrative interface through both networks.  192.168.0.1 on the trusted network and 192.168.100.1 on the guest network.

Is there a way to stop access to this UI from the guest network?

Yeah put in a firewall rule to block it ;)

 

Normally on a guest network it would be pretty locked down..

 

Rules are evaluated top down, first rule to trigger wins, no other rules are evaluated... Post up our rules on our guest vlan interface and we can discuss

 

So what do you want to allow and what do you want to block?  If you just don't want clients to access gui.. Then put a rule above the any rule that says block dest lan address port XYZ, where xyz is the ports (or ports) via an alias that your gui is listening on.

 

example, if your gui just running on 80 (http)

example.thumb.png.7803110dc3e73282ac1f4b02f3583b23.png

 

Keep in mind that such rules would allow guest to actually hit your gui via your wan IP..

 

You could do something like this

otherblocks.thumb.png.51b83a10b4f6cb4e0fc82f1f32c02b86.png

 

So you allow guest to "ping" pfsense guest address. So client can validate they have connectivity to the gateway.

 

But then any other access to firewall is blocked - all IPs, lan, guest, optX, wan, etc.. "this firewall" is a drop down option for dest.

 

This would require clients to be using some outside dns - which is what you normally hand "guest" clients anyway - say 8.8.8.8 for example.

 

Or you could allow clients to use pfsense guest IP for dns and ping - but block all other access

icmpdnswlabels.thumb.png.1ae6bbf33a892c38c2084204340339a9.png

 

Given that when I show "test" on my screenshots you would use your "guest" ;)

 

Since this is local network and not public internet you might want to use "reject" vs just block.. This will tell the client F Off!! Vs letting the client keep trying with retrans, waiting and retrans again.. Client will get told instantly sorry blocked!

reject.thumb.png.37dfce04439b8e59d7d29d33953c019a.png

 

While reject is normally good for your local networks.. You would normally not want to reject any blocks you do from the internet.. Just block (drop) them.. Vs sending any sort of response.

 

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • How to Do More with Less: Future-Proofing Yourself in an AI-driven Economy —was $28 now FREE by Steven Parker Claim your complimentary copy (worth $28) of "How to Do More with Less: Future-Proofing Yourself in an AI-driven Economy" for free, before the offer ends on June 30. Description In today’s workplace, headlines about artificial intelligence can feel overwhelming. With headlines swinging between promises of utopia and warnings of mass unemployment, for most knowledge workers, the truth feels unclear. In this book, Sharon Gai cuts through the noise. Drawing from real-world examples and global insights, she explains how AI is reshaping the way we work—without hype or fearmongering. Instead of choosing between blind optimism or outright pessimism, she offers a practical, balanced perspective that helps readers make sense of the rapidly evolving AI landscape. You’ll learn how to: Reskill and future-proof your career in the face of AI disruption Identify which parts of your role can be automated, and which require human creativity and judgment Use proven frameworks to evaluate AI’s impact on your work and your organization Apply actionable tips and tools to boost productivity, make smarter decisions, and do more with less Gain clarity as a parent, leader, or professional navigating what this means for the next generation Whether you’re an employee anxious about your future, a parent concerned about your children’s opportunities, or a leader managing a lean team with tight budgets, this book provides the strategies and mindset you need to adapt so you can stop worrying and start preparing. How to download for free Please ensure you read the terms and conditions to claim this offer. Complete and verifiable information is required in order to receive this free offer. If you have previously made use of these offers, you will not need to re-register. Was $28, but is now FREE | Below free offer link expires on June 30. How to Do More with Less: Future-Proofing Yourself in an AI-driven Economy The below offers are also available for free in exchange for your (work) email: The Vibe Coding Playbook: Building Your Tech Business with AI ($35 Value) FREE - Expires 6/23 The Persuasion Engine: How Any Business Can Use AI-Powered Neuromarketing to Understand and Win Customers ($28 Value) FREE - Expires 6/24 How to Do More with Less: Future-Proofing Yourself in an AI-driven Economy ($28 Value) FREE - Expires 6/30 Cloud Security Fundamentals: Building the Foundations for Secure Cloud Platforms ($131.95 Value) FREE - Expires 7/1 The Complete Free AI Learning: Master ChatGPT, Claude, Gemini & More ($21 Value) FREE How to Build an AI Design Workflow with Gamma ($21 Value) FREE The Ultimate Linux Newbie Guide – Featured Free content Python Notes for Professionals – Featured Free content Learn Linux in 5 Days – Featured Free content Quick Reference Guide for Cybersecurity – Featured Free content We post these because we earn commission on each lead so as not to rely solely on advertising, which many of our readers block. It all helps toward paying staff reporters, servers and hosting costs. Other ways to support Neowin The above deal not doing it for you, but still want to help? Check out the links below. Check out our partner software in the Neowin Store Buy a T-shirt at Neowin's Threadsquad Subscribe to Neowin - for $14 a year, or $28 a year for an ad-free experience Disclosure: An account at Neowin Deals is required to participate in any deals powered by our affiliate, StackCommerce. For a full description of StackCommerce's privacy guidelines, go here. Neowin benefits from shared revenue of each sale made through the branded deals site.
    • Microsoft admits one of the most crucial Outlook features is currently broken by Sayan Sen Microsoft is making some decent progress when it comes to Windows 11. Recently we have confirmed reports of some rather useful improvements landing in the next version of the OS, 26H2, wherein GPU driver TDR crashes may finally be fixed, plus the company is also allowing users to disable web content on the Search. On the Outlook front though things have not been so rosy. Last month in May we reported several problems affecting basic functionalities on the app. These included a problem where documents would open blank or corrupt themselves. Following that, Quick Steps, a very useful feature, would no longer work correctly, and finally, Microsoft acknowledged a problem wherein images would fail to load up properly inside the email. Microsoft had resolved those bugs later and almost exactly a month after we reported on them, the company has now admitted a new similarly basic issue, this time on Macs. Users recently started noticing that Outlook would no longer display email threads properly as the original message itself was not displayed. An affected user Tsoumpas, C (ngmb) nicely described the problem in a forum post they made on Microsoft's site. They wrote: "Description of the issue: After updating Outlook for Mac [Version 16.110 (26061317)] on 18/6/2026, replying to any email no longer includes the original message in the reply window. Prior to the update, replies correctly contained the original email text below my response. Expected behavior: The original message should be included in the reply, as in previous Outlook versions and according to the configured reply settings. Actual behavior: The reply window contains only a blank composition area (or only my response), with none of the original email text included." Obviously this must be a highly frustrating for users as noted by several in that thread. The post, at the time of writing, has also been upvoted by more than 40 users indicating that is a fairly widespread bug. Thankfully Microsoft seems to have acknowledged the problem right around that time as it opened a new issue on its official website. In the support article, the company recommends switching to Outlook for Mac from the legacy app, where the problem appears to be happening.
    • PotPlayer 260622 by Razvan Serea PotPlayer is an extremely light-weight multimedia player for Windows. It feels like the KMPlayer, but is in active development. Supports almost every available video formats out there. PotPlayer contains internal codecs and there is no need to install codecs manually. Other key features include WebCam/Analog/Digital TV devices support, gapless video playback, DXVA, live broadcasting. Distinctive features of the player is a high quality playback, support for all modern video and audio formats and a built DXVA video codecs. A wide range of subtitles are supported and you are also able to capture audio, video, and screenshots. A comprehensive video and audio player, that also supports TV channels, subtitles and skins. Its been described on the Internet as The KMPlayer redux, and it pretty much is. Daum PotPlayer 260622 (1.7.22963) changelog: Removed Kakao TV Added pause function when navigating via the navigation bar Significantly improved internal stability Fixed an issue where colors appeared strange during RGB24 processing Improved playback for some HTTP streams Improved sync processing for the built-in audio renderer Fixed an issue where certain MP4 files behaved abnormally during playback Download: Daum PotPlayer (64-bit) | 54.7 MB (Freeware) Download: Daum PotPlayer (32-bit) | 61.1 MB View: Daum PotPlayer Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Tixati 3.44 is out.
    • Speccy 1.34.084 by Razvan Serea Speccy will give you detailed statistics on every piece of hardware in your computer. Including CPU, Motherboard, RAM, Graphics Cards, Hard Disks, Optical Drives, Audio support. Additionally Speccy adds the temperatures of your different components, so you can easily see if there's a problem! Processor brand and model Hard drive size and speed Amount of memory (RAM) Graphics card Operating system At first glance, Speccy may seem like an application for system administrators and power users. It certainly is, but Speccy can also help normal users, in everyday computing life. If you need to add more memory to your system, for example, you can check how many memory slots your computer has and what memory's already installed. Then you can go out and buy the right type of memory to add on or replace what you've already got. Download: Speccy 1.34.084 | 20.5 MB (Freeware) View: Speccy Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • Dedicated
      tuben earned a badge
      Dedicated
    • Week One Done
      mnsgroup earned a badge
      Week One Done
    • Conversation Starter
      sumytbe earned a badge
      Conversation Starter
    • One Year In
      B4dM1k3 earned a badge
      One Year In
    • One Year In
      DarkWun earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      522
    2. 2
      +Edouard
      199
    3. 3
      PsYcHoKiLLa
      94
    4. 4
      Michael Scrip
      82
    5. 5
      neufuse
      69
  • Tell a friend

    Love Neowin? Tell a friend!