Turn your PC into a ROUTER - pfSense Virtualization/VLANs on your Home Server - Setup Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
quite a few of you out there have home servers that you're using for virtualization mass media encoding and whatever else your heart desires what if i told you you can also run it as a router and what if i also told you that you could take pretty much any pc and turn that into a router well you can with pf sense so that's essentially what we're gonna do today take any pc and turn it into a router for your home network let's check it out [Music] if you're watching this video you already have an internet connection which means you obviously have a router so why are we doing this so pfsense is an open source router operating system you can put it pretty much on any device and run it as your router now you can take this and use it as your main router and plug it directly into your isp modem or you can add it to your existing network and give yourself a lot more power user features within your home network such as vpn vlans more firewall security and just more control over your home network in general so the prerequisites are essentially that you need a minimum of two network ports so the machine i'm using was featured in a previous video of mine where i built a home server on a budget um if you want to check out that video i will leave a link up above somewhere i can never get that right i feel like i've done it so many times and it would be this side i think anyway uh this machine right here only has a single network uh port so what i did was i went on ebay and you can find these all over the place this is just a network interface card or a nic this one is four ports you don't need four ports you can get one with just a single port but the more ports you have basically gives you more flexibility on physical hardware you can add later on down the line so this was only i think like 20 bucks and the single port ones are probably around 15 so for five dollars more you get three more ports uh i'd suggest going with something like this okay i'm gonna move this on the ground because we're gonna have to boot it up and it's literally sitting right next to my microphone so let me do that oh wait i should probably install this too do that then move it okay here you go okay so like i mentioned before you can add this as your main router and connect it directly to your modem or you can put it within your existing network setup and that's what we're doing so i did a video recently about my entire home network setup so i'm not going to go through all of that again if you want to watch that video i'm going to link it up in one of these corners but here's a diagram that i mocked up of my home network setup and essentially you can see here that i currently have two vlans on my system and that is managed by my current pf sense netgate box so we won't be touching any of that but what we will be doing is adding the server that we are doing this installation with to our main vlan and then using a virtual instance of pf sense on that to essentially create a new vlan for our network and i'm doing this on my server that's running proxmox you don't have to do that you can install pfsense directly onto a computer and if you want to do that that's great go ahead and if you do that you can skip all of this part that we're about to jump into where we configure pfsense on a virtual machine in proxmox so if you're not doing that and you've installed it directly to your server then just jump ahead to that part for the rest of us that are virtualizing our pf sense install in proxmox let's jump into it okay so we can see here that this is a as plain install of proxmox as you can get this is proxmox 7.0 uh this won't be any different if you're using proxmox 6.4 or whatever version you can see the only thing we have here is an ubuntu virtual machine setup and i set this up before because we're going to be using that later in terms of networking the first thing you're going to want to do is go ahead and look at your network setup so go into your server go down to network and you should see first of all your main interface so here is ours enp7s0 and then our main network bridge so vmbr0 so this is what you'll see if you just install proxmox with no additional network interface card but here you can see the four additional ports that we installed using our nic card so the first thing you're going to want to do is depending on how many lands you want to set up we're just going to do one for today but if you want to set up multiple you'll essentially just follow the same tutorial except with multiple ports so the first thing you're going to want to do is go into here and pick a port if you have a single nic then it's easy it's just the only one there but we're going to pick our enp4s0f0 and set that to autostart and then close it but you may have to reboot after you do that to get the port active so once that's active you're good to go to the next step the next step is going to be creating a new linux bridge network for our pfsense router to use so the way i'm configuring it is i am assigning the wan port of the pfsense install as the network that's coming into the server so the server is tied to my 10.0.0.1 network so that my pfsense virtual machine will use that network as its wan and see that as its overarching internet connection from there it will then create its own vlan under the network that we specify so what we're going to do is create a new network bridge so go to create linux bridge vmbr1 that's fine and the bridge ports that is going to match what you created as your active port in the step before so we did enp or s0f0 i can't type create so it's going to tell you pending changes you're going to go up here and click apply configuration it's going to do this if it doesn't it might give you an error you might have to reinstall or reinstall you might have to reboot but just make sure that everything looks good here we have our main linux bridge coming into the server and then we have a new one that we will use for our lan so the next step is to install pfsense to a virtual machine it's going to be like any virtual machine install go to create vm we're just going to leave it as vmid100 we're going to name it pf sense iso image we've already uploaded the pf sense iso system graphics card i've heard that spice works you can leave it as default it doesn't matter i use spice so hard disk you really don't need a lot of space 30 gigs should be fine cpu depending on your network size and how much traffic you are going to put through this thing you'll be fine honestly with two threads if you want to up it to four threads that should be perfectly fine for even advanced home users we'll do we'll do two just to show you that it can even work with two memory same thing two gigs should be fine for smaller home networks if you want to up that to four gigs you can but we are going to leave it at two gigs of ram network it should by default set to our main network coming into our server which is vmbr0 leave that we are going to add the second one in right after this so everything looks good don't start it just yet click finish there is so the first thing we want to do before installing or turning it on and actually running the installs go to hardware go to add network device we are going to check our vm br1 this is the new network interface that we added before so just add that and now you can see there are two network devices added one will be our wan coming in that will provide us with internet access the second will be the lan output so things that we can plug into it if we want to plug in a switch or an access point we can do that using that port that we specified here we are good so next you just are going to start the vm she'll let it do its thing okay here we go we are actually in the install now so we're going to accept because we totally just read that uh we want to install pf sense continue with default key map auto zfs that's perfectly fine install stripe with zero disks so this is going to ask you what type of install you want to do now we only passed a single hard disk to it so we don't really have the ability to mirror or do any raid configuration so just stay with stripe because we just have a single disk and here's where you select it press the space bar to select that disk click ok are you sure you want to destroy there's nothing on it so yeah i'm fine with it and it will install so this probably takes about honestly a minute or two it's really fast and the next time we are asked anything will be for our wan and land configuration so let's give it about a minute installation is now finished uh would you like to open the shell and perform any manual modifications no we don't need to do that it's going to reboot all right now it's going to boot from the hard disk okay so on the first time you boot it up it's going to ask you if you want to set up vlans right now uh select no we don't want to do any of that right now we can always add vlans later okay so the first thing it's going to say enter the win interface name or a for auto detection so when is going to be what is coming in so we know that vnet 0 or the first network interface that we gave to the pf sense vm was the network interface that was coming into our server so that's what we want to use as the wan so we're going to type in vt net zero and then similarly for lan it's asking us what we want to use for lan now lan is going to be the vtnet one which is the port on the nik that i assigned to it it's going to say does this look good yes it does and it's going to run through its thing and boot up pf sense for the first time okay it is up and running so you can see here that our wan is on the 10.0.0.1 network so we've been assigned the local ip address of 10.0.0.157 so that's what it's going to see is our wan or internet access port and you can see that our lan is now on a completely different subnet or network we are now on the 192.168.1.1 network let's utilize that ubuntu vm that i was talking about earlier so the cool thing about hosting pfsense virtually is that on the same machine you can spin up a vm and assign it to either of your networks i can assign it to my 10.0.0.1 network or i can assign it to the new pf sense vlan on the 192 network so if i go into this ubuntu vm and this is just a standard ubuntu 20.0.4 install i believe if we go in here you can see the network device added is this vmbr0 so the same network that's coming in so when i run this vm we're going to be in that 10.0.0.1 network or i can now go in add a network interface and add that vmbr1 network because remember that is now running in pfsense as its own lan now you'll see when i start up this vm whoops i was doing that under the template so on the actual vm so same thing add network device zero one add so now when we spin up this ubuntu vm if we go to our networks you will see we are connected to two networks now which most cases you don't really want so we're gonna go into settings and this being our first one i will show you let's turn this one off and if we go into here you can see we have been assigned a 10.0.0.153 ip address so we are on our main vlan home network however if i change that to use our pf sense lan that we passed through you can see now we are on the 192.168.1 network with an ip address of 192.168.1.100. so now that we are on that network we can open up a browser we can go to 192.168.1.1 which is the host port of our lan port host address of our lan and here you can see our pfsense screen so by default um your user is admin and your password is pfsense and when you log in it's going to make you change it essentially so we are now on the 192.168. we have full access to the internet as you can see here yay youtube and it's essentially its own vlan kind of so there is another step you need to take if you want this vlan to act as a separate network from your main home vlan for example we are on the 192.168 network but if i go to ping my truenass server which is on my main vlan you can see we still have access to it and we don't want that we don't want anything on this new vlan to communicate with our main vlan so let's fix that so to do that we go back into our pf sense gui and you're going to want to go to firewall and rules then go to lan and by default your lan is open to everything and that's what you can see here these two rules ipv4 ipv6 and we don't want that we are essentially going to make sure it has access to everything except our main 10.0.0.1 network so to do that go to add and you want it to pass and this will make sense later but the interface is lan the address family is ipv4 the protocol is any and the source is our lan net and our destination is a specific network of 10.0.0.1.24 and you want to invert that so what that means is that we're going to pass everything through as long as the source is our 192.168.1 lan and the destination is everything except since we're inverting 10.0.0.1 so let's save and now that we have that we can remove this old rule because if that takes priority everything's still going to go through so remove that let's just remove the ipv6 one you can do the same thing with ipv6 if you want to handle ipv6 networking so we're going to apply changes and now you can see we still have access to the internet perfect but now when we go to ping that server again nothing so we have essentially closed off access from this new vlan to our main vlan so now they are completely separated and you are free to do whatever you want with this you can plug in its own access point and have this be the guest access point that all your friends or guests that come over use if you don't want them having access to your home network and like i said before the nic card that you buy if you have one port you essentially have one device you can hook up so you can do an access point or you can do a switch to an access point and get creative but if you have more ports that will make it extremely easy to set up even more vlans with dedicated ports assigned to them so we have four we could essentially spin up three more vlans and throw on three access points and have extremely easy four vlan setup with their own dedicated access points so that's all i have for you today i hope this was informative and helped you kind of take a look at that pc you have sitting in the corner collecting dust and maybe breathe some new life into it or give you a reason to tinker and learn a little bit more about network configuration so if you go ahead and do this let me know down in the comments how it goes if you're already running pf sense let me know how you're using it be interested to know how you guys have it set up in your home setups but that's it for today i have some more network videos coming soon so if that's interesting to you please subscribe and thanks for watching and i will see you in the next one [Music] you
Info
Channel: Raid Owl
Views: 41,383
Rating: undefined out of 5
Keywords:
Id: 9GPtEIi_zeQ
Channel Id: undefined
Length: 18min 59sec (1139 seconds)
Published: Wed Jul 21 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.