pfSense in VMware Workstation
Introduction
My lab is completely nested in VMware Workstation v14 and I use pfSense to isolate the various labs I run. In this blog post I am going to run through how to set it up as a VM in Workstation and then set it up to isolate some nested VM’s.
pfSense acts a virtual router/firewall that lets me run whatever I want such as AD, DHCP, vCenter, etc. behind it without affecting my home network. The list of features that pfSense can provide are extensive. In this blog post I am using v2.4.3 of pfSense.
Download pfSense
pfSense is available for free with paid support options available. Download the Community Edition picking the following options from the drop downs:
- Version: 2.4.3
- Architecture: AMD64 (64-bit)
- Installer: CD Image (ISO) Installer
Then choose the Mirror closest to you. The download is a gz archive file so you need to use something like 7-Zip to extract it to get the ISO.
Create VM in Workstation
Next up is to create the pfSense VM in Workstation:
- Go to
File...New Virtual Machine - Choose
Custom (advanced) - Select the Virtual machine hardware compatibility that is right for your version of Workstation
- Pick
I will install the operating system later - Guest operating system is
Otherthen in the drop down selectFreeBSD 11 64-bit - Enter the VM name and select the location
- 1 CPU and 1 core per processor is fine
- 265MB of memory is fine
- Choose either
BridgedorNATnetwork type depending on your preference - Use a
LSI LogicSCSI Controller - Use an
IDEvirtual disk type - Create a new virtual disk
- Maximum size of
5GBand chooseStore virtual disk as a single file - Leave the disk name as default
- Click
Finish
Now Edit the virtual machine settings. Make the following changed to the Hardware:
- Remove
USB Controller - Remove
Sound Card CD/DVD (IDE)connect to the pfSense ISO image file that you downloaded. EnsureConnect at power onis checked
Now this is something I do for all my VM’s. By default you have legacy hardware such as Serial and Parallel Ports so I like to get rid of them:
- Right click your pfSense VM and select
Power...Power On to Firmware - Move to
Advancedand selectI/O Device Configuration - For
Serial port A,Serial port B,Parallel portandFloppy disk controllerpress Space until each shows asDisabled - Press
F10to Save and Exit
Initial Installation of pfSense
The VM will now boot. We can go ahead and start the initial install of pfSense.
- Press
Enterto Accept the copyright notice - Choose
Installand chooseOK - Select the keymap that matches your keyboard
- In the Partitioning options choose
Auto (UFS) - pfSense will now install
- At the end it will ask if you want to do any Manual Configuration. Choose
No Rebootto complete the installation
Initial Configuration
Once the VM reboots, pfSense will start and will start an initial configuration:
Should VLANS be set up now [y¦n]?choosen- Enter
em0as the WAN interface - For the LAN interface just press
Enter - A summary of the config is displayed:
WAN -> em0. Choosey
pfSense will start and present the main menu. You can test connectivity to the outside world by selecting option 7 and entering a host name such as www.google.com or IP 8.8.8.8. A ping response should be displayed.
LAN interface
Ok so far we have a basic config. pfSense has a WAN interface and can communicate with the outside world. Now we need to setup the LAN interface. This is the interface your lab will use as the default gateway to communicate out.
I use a LAN segments to isolate each lab environment. So I connect the second NIC on the VM to the LAN segment setup for the lab. This is the LAN interface in pfSense.
- Select option
6) Halt Systemand pressyto proceed - Once the VM is shutdown edit the VM settings
- Remove the
CD/DVD (IDE)as we don’t need it any more - Add an
Ethernet Adapterand connect it to the LAN segment your lab will use - Power on the VM
- Once booted select option
1) Assign Interfaces Should VLANS be set up now [y¦n]?choosen- Enter
em0as the WAN interface - Enter
em1as the LAN interface - Confirm
WAN -> em0andLAN -> em1. Pressyto proceed
Now to set the IP address of the LAN interface. This will be your default gateway for the lab:
- Select option
2) Assign interface(s) IP addressand pressyto proceed - Select option
2for2 - LAN (em1) - Enter the LAN IPv4 Address
- Type in the subnet mask
- Press
Enterfor none - Press
Enterfor none as I don’t use IPv6 in the LAN - Type
nif you don’t want pfSense to be a DHCP server. I typically use AD DHCP - Type
yto revert to HTTP as the webConfigurator protocol - Press
Enterto complete
That is pfSense setup enough to act as a router for your nested lab. However some further setup is needed using the web console.
Final Configuration
Come final configuration is needed such as setting hostname, DNS, etc. More importantly we should install Open-VM-Tool that is the correct set of VMware Tools,
To access the web console you need to connect a VM to the LAN Segment used for the LAN interface and set an appropriate IP address on the subnet. Make sure you can ping the pfSense LAN IP address and start a web browser.
- Login to the web console using the default username and password of
adminandpfsense - You can follow the configuration wizard but I typically skip it by clicking on the pfSense logon at the top left
- Go to
System...General Setup - Enter suitable values for
Hostname,Domain,DNS ServersandTimezone. ClickSavewhen done - Go to
System...Package Manager - Click on
Available Packagesand in the search box findOpen-VM-Tools - Click
Installnext to theOpen-VM-Toolspackage - Go to
System...Updateand ensure you are running the latest version of pfSense. If required update - Go to
System...User Managerand click the Edit icon next to the useradmin. Change thePasswordfrom the default - Finally go to
Diagnostics...Rebootand clickReboot
Wrap up
A lengthy set of instructions but once you have done it a couple of times pfSense is very quick to setup for your needs. You can do further things such as setting up a DMZ, firewall rules, multiple LAN interfaces to segment traffic, etc.
pfSense is a valuable tool in your home lab setup.