Disclaimer: I am by no mean a professional. I am just doing this for fun and enjoy learning along the way (I probably still don’t know anything 🤣). These are not meant as a guide and should not be treated as such. What I am showing you here is what I did, and it worked for me and my situation but might not apply to you. Your result could be very different from mine. Heck, I could be doing or saying something entirely wrong since I’m still considering myself a newbie (Hence the name of my site “noob to networking” 😉). Please don’t take a random person’s words on the internet too seriously, and again, ALWAYS and I mean always do your own research (Well, take this one seriously, though).
Hello there, it has been another week, and you probably have guessed it, time for another post. This week, I will be talking about VLAN and how I configure my VLAN network for my setup using my Pfsense firewall/router. Here is the breakdown:
Why VLAN?
Before we start, I would like to explain what VLAN is and what is the intended purposes I hope to achieve with this VLAN setup for my home.
What is VLAN?
As you should have already noticed by now, most things in networking are already quite literal as the words mean what it is. So if you heard something that you aren’t too sure about, by taking the words as their face value, chances are you probably get it right 😂. It is not too complicated as you might have thought. We know LAN stands for Local Area Network, which describes your home private network that is separate from the Wide Area Network (WAN) or the internet. Every device in your private network has its private IP address to be part of the network (usually 192.168.x.x). Devices on your private network are connected using wired connections or wireless (Wi-Fi), but they need to be physically connected. Therefore, LAN is what we usually refer to as the physical connection network.
What is VLAN, then? If you guessed V stands for Virtual, you are correct. VLAN stands for Virtual Local Area Network. See, it is not that hard to understand, right? LAN is an actual physical connection, while VLAN is not quite so, just like my imaginary girlfriend 🥲 .
What is the point of VLAN? There is quite a lot of advantage for VLAN. The most significant advantage, I think, is the ability to manage and organize separately from your primary network. We can do a lot of customization as we have complete control of this network by creating the rules for how we want this network to behave, thus increasing the security and making it easier to manage. Of course, there are many other great things about VLAN, but well, different people have different opinions and purposes.
VLAN is handy in networking, and you can usually find it on mid to high-end routers and firewalls. For lower-end commercial routers, it was not that VLAN does not exist. Still, since the target users usually are not tech-savvy (no offense), I think the manufacturer felt there was no need to include the full feature set in their product, and thus they simplified that to 1 simple function. That is Guest Network, and yes, Guest Network is just a strip-down version of VLAN. There is no customization, and it was just whether you want to turn it on or off though for some, that is more than sufficient. Why do I bring this up, you ask? I want to give you additional information to see that VLAN is prevalent in most everyday networking but just in a different shape or form. As for Mid to high-end users, VLAN makes their life so much easier since having to manage hundreds or even thousands of devices. It would be a nightmare to have to manage individual devices without VLAN.
What do I hope to achieve with VLAN in my home network set up?
Suppose you have read my last post about how I configure my home network. You might already have some idea of what my network’s layout looks like, but if you have not, here is the diagram to refresh your memory.
I have in mind that I will have 3 separate networks for my home set up, which are LAN, VLAN 10, and VLAN 20. Here is a fun fact about the VLAN, VLANs separate their networks by having their identifier so that traffic coming from their network will be able to sort correctly. We can then configure which ports on our network switch we would like what VLAN traffics to come through or blocked. Pretty cool, is it not? We called it tag 🏷 . So each VLAN has its unique tag. In my case, I have Tag 10 and Tag 20. LAN network by default is VLAN 1, meaning LAN is technically a VLAN with Tag #1. Is this information relevant? Of course not, but it is pretty cool to know 😉.
Back to the topic, I picked tags 10 and 20 as well. There isn’t any reason; it is all user preference. I can do VLAN 2 VLAN 3 as well, but I picked 10 and 20 to remind me of the subnet separation 🤷♂️ which we will talk about it later.
I planned to have LAN as my primary network where I have all my devices such as a workstation, PC, servers, and NAS. They can all freely access the WAN and talk to each other. There won’t be a lot of restrictions for my LAN.
VLAN 10 is my Internet of Things or IoT network. I have told you before that I wish to convert my home into a smart home, and that will require a lot of smart devices to be integrated into my home network. As you might have guessed, most smart home devices are required an internet connection to be able to communicate to their respective manufacturers’ cloud servers for them to work. Therefore I have to give them access to the internet, but I also do not want them to be able to see my other network devices and traffics; who knows if one of these smart devices actually got hacked and started to spy on you or steal your information… It is also a good security practice to segregate smart devices from normal devices hence why I create this virtual network to put all my smart devices there. That way, they can talk to each other and have an internet connection, but they do not have access to my primary LAN network and cannot talk to my servers and NAS that reside there.
Last but not least is VLAN 20, which is my Guest network. With Pfsense, I can do quite a lot of things with this. I can have a filter to ensure that my guests won’t be able to go to any shady website or do anything stupid using the home network that will give me trouble. I can also limit the bandwidth on how much they can use. I can also set a timer for when I want this network to stop working…The possibility is endless, and when you have that much power, you feel like you are on top of the world 😈 all the peasants…I mean, guests 😅 are at your mercy 😜. Unless they have unlimited cellphone data and do not need your network 😂.
VLAN setup with Pfsense
Now on to the good part, shall we? Let’s get the VLAN setup started. It is a very simply 3 steps process: 1. Creating the VLAN interfaces; 2. Enable DHCP services for the said interfaces and, lastly, create firewall rules for the interfaces.
1. Creating interfaces
As I have mentioned above, the idea is to create 2 VLAN interfaces, and we will be using Tag 10 and 20 respectively.
There we go. We are now finished creating and enabling the 2 VLANs interface. Still with me? Good, it’s not as scary as you think 😉.
2. Enable DHCP servers
VLAN is just like any other network; we need to set up a DHCP server for all the devices connecting to it to be able to acquire an IP address. Otherwise, the devices won’t be able to connect to the network. What is a DHCP server, you ask? DHCP stands for Dynamic Host Configuration Protocol. You can say it is a hotel receptionist that assigns you a room number and keep the record. In this case, this is an IP address in you failed to realize what I mean 😬. So yea, we need to enable the DHCP server on all our VLAN interfaces (default by Pfsense usually enables LAN interface, so we don’t need to worry about it).
3. Creating Firewall rules
Alright, so we created the interfaces and enabled them. We also enable DHCP servers for each interface. The last thing we need to do is create firewall rules for the network to work. What are firewall rules? As the name suggests, they are some rules you create to make sure that the network function as you have designed. One particular thing about Pfsense firewall rules is that any rules that aren’t defined will be ignored, so keep that in mind. For example, if you create a rule such as “we don’t talk about Bruno,” then all the talk about Bruno won’t pass this wall 😜.
Conclusion
Well, congratulations 🎉, if you managed to get this far, I hope you already have yourself a nice VLANs set up. Now you are official, join the cool kid clubs, and take a step forward with basic networking 😎. Now you can proudly be telling people you understand VLANs firewall rules…at least you know a little bit more than before. If you understand the concept, I’m sure you will be able to figure out how to do VLAN with other equipment because you understood the fundamentals. Best of luck to everyone. Thank you for your time, and have a great week. Until next time
-Laz.
4 responses to “How I set up VLAN for my home network with Pfsense.”
I am really loving the theme/design of your site. Do you ever run into any browser compatibility problems? A number of my blog visitors have complained about my website not working correctly in Explorer but looks great in Firefox. Do you have any tips to help fix this problem?
Heya this is kind of of off topic but I was wanting to know if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding know-how so I wanted to get advice from someone with experience. Any help would be enormously appreciated!
Very helpful article. For those not technically inclined, how does one move the IoT devices from LAN to VLAN 10, for example?
Hi Clark,
Thank you for the feedback. To answer your question, you need to connect the devices to the correct network, be it LAN or VLAN. Suppose you wish to move IoT devices from LAN to VLAN 10. Let’s first say is the device is connected via Wires or wireless. For example, I configured port 10 of my switch to have a VLAN tag 10 so that every device I plug into ethernet port 10 will be assigned an IP address belonging to VLAN 10. For wireless, I have a designated Wi-Fi network called “Ai-O-Tea” which I set up to tag vlan 10 to all the connected devices. Of course, you can force the device IP addresses, but that will be different case by case, depending on your setup and network equipment, and it also requires you to know what you are doing. If you have any questions or require assistance, feel free to ask. I’m happy to help.
-Laz