Activity) Setting up a Firewall Flashcards
Setting up a Firewall
For this activity, we’ll be creating a brand new virtual machine that will act as a firewall. Firstly, head over to the pfSense website and download the ISO install file shown in the below screenshot. If you’re unsure what version to download for your host system, read the information at the bottom of this page.
Now that we have the .iso.gz file we need to unzip it, so we can access the .iso file. If you don’t already have 7Zip installed, you’ll need to download it, install it, and use it to extract the files. You should now have the .iso file!
Next, open VirtualBox and click on New in the top middle of the VirtualBox Manager windows. Name the virtual machine anything, we’ve gone with “BTL1 Firewall Exercise”, set the type as BSD, and the version as FreeBSD. If your host system is 64-bit, then download FreeBSD (64-bit).
The RAM minimum is 512 MB, but as we are just experimenting with pfSense it doesn’t need to have high resources to deal with traffic and operations. We suggest you set the memory size to 1024 MB. When creating a new virtual hard drive, select the VirtualBox Disk Image (VDI) file type.
Next we need to ensure that the virtual machine is in Bridged networking mode, so that the system has it’s own IP address instead of sharing the IP of our host system. Select your new virtual machine by left-clicking on it once in the VirtualBox Manager, then click the Settings cog at the top of the window. Go to the Network tab and change from NAT to Bridged Adapter.
Go back to the VirtualBox Manager window, and double-click your firewall virtual machine to run it. You will be prompted with the below window, asking you to import an optical disk – this is our .iso file for pfSense! Select it, and click Choose.
Follow the pfSense installer to get pfSense initialized correctly.
Once the installation is complete, manually shut down the virtual machine. If you don’t it will attempt to run the installer again. To stop this, we need to open the virtual machine settings from the VirtualBox Manager and remove the .iso file we used for installation.
Now that you can boot into your pfSense virtual machine properly, select option 1 and when asked “Should VLANs be set up now?” type “n”.
When asked to enter a WAN interface name, enter “em0”, and when asked to enter the LAN interface name, don’t enter anything and press Enter. When asked to remove the LAN IP address, type “y”.
In the below screenshot we can see that the em0 interface is enabled, and in our case we see the IP address 192.168.1.249. If you enter this IP into your browser on your host system, you will see the pfSense login portal.
Use the username:admin and the password:pfsense to log into the management console. On the first page we are presented with the configuration wizard, which we will be following to get everything set up correctly. Click Next to begin.
Configure the setting as shown below.
Leave the following settings as they are by default.
Below, we have changed the SelectedType from DHCP to Static. Under the Static IP Configuration section we have set the IP address to match the IP we’re currently using to access this web console (look at your address bar!). Make sure to change the subnet mask to 24, and the gateway as 192.168.1.1.