I will demo how to install a powerful router/firewall and much more for $0 dollars. Using Pfsense x64 version of FreeBSD we will install it in Hyper-V and configure and launch our virtual appliance’s web interface. We will place our production servers/containers behind the virtual appliances and test throughput. We will diagram our Hyper-V layout and diagram our network topology to help you understand this technology so you can use it at home. We will share many topologies you can build with Pfsense in your home lab.
"Everybody can be great... because anybody can serve. You don't have to have a college degree to serve. You don't have to make your subject and verb agree to serve. You only need a heart full of grace. A soul generated by love." Martin Luther King Jr.
Hello, my name is Lowell Vanderpool and this channel is dedicated to IT students,
IT professionals, and anyone who enjoys learning technical subjects.
Now when it comes to learning networking, it would be wonderful to have a device like this. This is
a typically a security appliance. Some vendors will call them firewall appliances. Some will
just call them a small medium business router. They're basically all the same. They include
routers, firewalls, VPN servers, and much, much more inside. They typically run Linux or FreeBSD.
The problem is they're around $600, $700 a piece plus a yearly license fee. I'm going to show you
how we can build one of these for free, put it in a virtual machine, and do exactly what they do in
the cloud. So if an enterprise wants to protect all their cloud servers, they actually take
something like this, put it in a virtual machine, and put all their production units behind it,
and everyone accesses the internet through a security appliance. And we'll do it in the cloud.
So let's install PFSense in a virtual machine. Now we're going to use NetGates, which is a company
that they have customized a product using FreeBSD. FreeBSD has a firewall called PF,
and NetGate has taken this FreeBSD PF firewall and created a customized web interface, packaged
it all together into a software-based multifunction router, firewall, and much, much more. And they
call the product PFSense. Now they allow us to download this for free. You get no support. It's
going to give us a router, a sophisticated firewall, a DHCP server, NAT devices, DNS,
lots and lots of cool stuff. So let's get started. Now when we're done, we're going to end up with a
virtual machine that is going to be this yellow dotted line. It's going to have this security
appliance, this router firewall, all inside a virtual machine. And then on this side,
on the LAN side, we're going to put our Windows 11, our servers, our databases, our web servers,
everything that's production behind it. We'll have our internet connection on our LAN side,
and everyone will go through our security appliance to get to the internet. That's what
we're going to do. Here I'm at PFSense download page. You can just type in PFSense, find their
download page. I'm going to use the mirror site in Austin, Texas, and hit the download. You choose
whatever one you want to. We'll click the download, and we'll want to get the latest release, AMD64
ISO.gz, and then we'll use 7-Zip or WinWAR to extract it into an ISO. Also download the
SHA-256 hash value so you can make sure you're getting a legitimate file. So you can click on
that and download that and bring that down to your local hard drive. Now here we've got our
files downloaded. I've got my .gz file that I downloaded from PFSense, and I've extracted it
into an ISO file here. So my first step in creating this virtual machine is I'm going to
go to my virtual switch manager, and I want to make sure I create a private switch. Notice I'm
going to create a virtual switch. I'm going to call it my LAN, and I'm going to make it a private
network. That's very important. So the local area network or LAN switch is going to be a private
network. I'm also going to create another switch, and this one's going to be the WAN, and this is
going to be the external, and it's going to include allow management operating system to
share this network adapter. So I have to create two virtual switches, one private, one external,
and that's my first step. Let's get started with creating our first virtual machine. So let's go
new, create a virtual machine. We'll get started here. I'm going to call this PFSense demo,
and you could add any name that makes sense for you. Now I'm going to store this always
in a location that I choose. So I'm going to store the virtual machine in a different location.
I'm going to browse to a hard drive that I want to put it on, and I'm going to put it in a new
folder, and I'm going to put everything in that folder regarding that virtual machine. So next,
we're going to choose generation two because this particular version of PFSense with FreeBSD
does support UEFI. So we're going to choose generation two, go next, and we're going to
put two gigs of memory. That's all we need for this appliance. We're going to leave the dynamic
memory and go next. Here we're going to choose the WAN connection first, our WAN switch. Remember,
this is our virtual switch. I'm going to choose my WAN virtual switch as my first network connection.
Go next, and we don't need 127 gigs for this appliance. We only need about 30 gigs. You can
even use 20 gigs if you want to. The reason I would throw 30 is if you decide to do proxy
in this appliance, you may need a little bit more space. So let's go next, and we're going to use
the ISO. So let's browse for our ISO. There's our PFSense AMD ISO, and we'll go next, and we'll go
finish. Now we're not done. Before we boot up, we're going to do a few things here. We're going
to go into settings, and I first want to disable secure boot because it won't boot from a DVD
unless you disable secure boot. So get rid of secure boot. Then we're going to go to add hardware,
and we're going to add an adapter, and here we've added a second adapter. We have one that's
connected to WAN. We have another one that's connected to nothing, and we're going to choose
that to our local area network virtual switch. So now we have a network card to our local area
network, and we have a network card connected to the wide area network, which is our internet.
I'm going to go checkpoints also, and I'm going to disable checkpoints, and in my case,
what do you do when this virtual machine, when if the physical computer starts, you can choose
whatever. I'm going to choose nothing. What happens when you shut down the virtual machine? I'm just
going to say shut down this guest operating system. That's going to be my choices. You can tweak this
however you want, but those are things we need to do before we boot. Now let's go ahead and boot.
Now we'll get an initial. We're going to be booting off the CD-ROM. You get a little quick
boot option. You can take a look at it. I'll have a snapshot of that, and here we'll begin
the installation. It's now booting off the CD-ROM or the ISO, and we'll accept the license,
and we're going to install PFSense on this virtual machine hard drive. We'll leave the
keyboard default, and we're going to choose guided disk setup using UEFI boot method because
we chose generation 2 virtual machine Hyper-V, and now it's going to begin the install process
on this hard drive, and it's going to put FreeBSD with all the customization that Netgate designed
in their PFSense firewall router version of FreeBSD. We'll use some video magic to
shorten this installation. Not a long installation even without the video magic.
Now the installation is finished. Before exiting the installer, would you like to open a shell
to make any manual? No. We're going to reboot. Now here when we reboot, we're going to let it reboot,
and then I'm going to turn off this virtual machine, and then I'm going to eject the DVD
so we don't reinstall it. So I'm going to reboot. Let it go ahead and reboot,
and it will start to boot again, and I'm just going to go ahead and turn off the virtual machine.
Now this is very important because we want to make some modifications here before we go any
further. So I'm going to come to file and to settings, and the first thing that I'm going to
do is get rid of the ISO file because I don't want it rebooting and reinstalling and rebooting and
reinstalling. So get rid of the ISO file. Second of all, I'm going to come into the BIOS, and I'm
going to say I want it always to boot to the hard drive. I don't want it to boot to anything else
but the hard drive, and then I'm going to apply. Now we're ready to start our virtual machine.
There's your little boot menu. Now it's going to ask us do we want to set up any VLANs, and we'll
say no, and notice here we have our two interfaces. We have HN0, and we have a MAC address, and we have
HN1, and another MAC address. Now PFSense is pausing the boot so that we can manually make
sure that the network card we want connected to the WAN is the correct one, and the network card
that we want to connect to the LAN is the correct one. This is an absolutely critical step in this
process. Now it displays both the network card and the MAC address of that network card, so we can go
and verify each NIC. Here I'm opening up the settings for the virtual machine and going to
the network adapter, and I'm expanding it to advanced features. Under advanced features, we can
see the MAC address, and we can compare with what we see in the, and we can confirm that LN0 is the
network card connected to the WAN. While I'm here, I'm going to go down to my second network card,
open it up, expand it to advanced features, and compare its MAC address with LN1, and it is the
correct network card. So back to my menu, it's saying enter the WAN interface, and so I'm going
to put HN0. That's my WAN interface. We're going to use enter the LAN interface name, or A for
auto detect. In this case, we're going to type it in HN1, and that is our LAN interface, and we can
see that the BSD has now assigned the WAN as HN0, the LAN as HN1. Do we want to proceed? Yes.
It's now configuring these interfaces. If you look here carefully, you can see I'm starting
OpenVPN, which is my VPN server, firewalls, gateways, firing up my router, DNS, resolver,
all kinds of additional services, an HTTP, a web server built in. Now you have a security appliance,
firewall, router, DHCP server, a web server, and that's going to allow us to configure this from
my web browser. Look at your text menu. We're looking at the virtual box with a VGA output,
and we can see we can do, we can log out, we can assign interfaces. So there are things you can do
within the interface of the virtual machine with this text-based menu. A couple things you want to
pay attention to is you can, number four, resets to factory defaults. That's really handy because
you're going to mess things up and you're going to need to force the firewall appliance back to
factory defaults. You can also reset the web password if you mess that up. This is what we
just did. In the yellow box, we've created an appliance that's going to be a router, a firewall,
intrusion detection, VPN server, DHCP server, and then all our virtual machines and servers and
production devices in Hyper-V are all going to connect to this appliance. The appliance will
allow it to pass through. Anything coming from the internet will go through the appliance. This is
exactly what they're doing in Azure or AWS or any other cloud provider. In my Hyper-V, I've got a
Windows 11, and if you'll notice in my settings, my network is connected to the LAN virtual switch.
So that will be the same switch that my appliance is connected to. So let me go ahead and start this
and we'll go ahead and log on. Now, this Windows 11 box has to go through
my appliance to get to the internet. It also gets an IP address from the DHCP server. So this gives
an IP address, and I know that this router interface is 192.168.1.1. So we're going to go
back to the Windows 11 box and take our browser to that IP address. Here I've launched my browser,
and you can see I'm going to 192.168.1.1, which is the router's interface on the appliance,
and it says, hmm, we're going to say go ahead and connect anyway, and there is my logon to
my web server on the appliance, just like you do to your home router. We're going to type in
admin and pfsense is the default, and voila, we're in the interface for our small medium business
router interface. You want to go ahead and finish the setup of your router based on your
documentation, and you'll eventually get to the dashboard that you're seeing, and it gives you a
comprehensive view as to the condition and what's going on with your router. Here we can see our
uptime from our dashboard. We can actually go to each interface, the LAN here, and you can configure
it if you so desire. Again, you can go back to the interface and open and configure the
LAN interface if you feel the need to do that. Now, this virtual appliance is no shabby device.
We're actually going through two virtual switches, going through two virtual machines.
How efficient is it really when I send my Windows 11 through this virtual appliance that acts just
like a small business router? How much loss do I have with all this virtualization? Let's take a
look. On my Windows 11 Edge browser, I'm going to open up a tab, and I'm going to type fast.com.
It tests your internet connection speed, so from my virtual machine, I'm going through two virtual
switches, two virtual machines, and I'm getting about 630 megabits per second. I have a one gig
connection to the internet, and considering all of that, that's not too bad. We now basically have
this $600, $700 small, medium business router firewall security appliance. Cost us about two
hours of hard work and troubleshooting and whatever other problems you face. We now have it virtualized
that mimics almost exactly what you're going to see in Azure or AWS or other cloud providers,
so that now you can replicate almost exactly what an enterprise would do in the same scenario,
and we're ready to get started with some serious networking. Feel free to make comments, suggestions,
ideas, share us your problems. Feel free to email us at any time. Remember, we have PowerPoints,
video notes on everything that we cover. Feel free to go to the video description and download
those. Those are available for almost every video that we create.