This article is about installing and configuring network interfaces of pfSense firewall and gateway on Hyper-V virtual machine.
Table of contents
Download pfSense iso file.
Navigate to https://www.pfsense.org/download/ and download the latest version of iso image using the below specifications.
![download pfSense firewall iso image](https://aashu.co.in/wp-content/uploads/2024/04/download-pfSense-firewall-iso-image.jpg)
Once the file is downloaded, please extract the .iso file from .gz file in another folder. You will get the file named pfSense-CE-#.#.#-RELEASE-amd64.iso.
Create a pfSense Virtual Machine.
Open the Hyper-V Manager and Click New > Virtual Machine from the Actions list.
![New Virtual Machine Option](https://aashu.co.in/wp-content/uploads/2024/04/new-VM-option-for-pfsense-1024x238.jpg)
In Specify Name and Location step, Enter a Name for the virtual machine as pfSense.
Select another location on disk to store the VM data (Optional).
![New VM Options](https://aashu.co.in/wp-content/uploads/2024/04/new-VM-wizard1.png)
In the Specify Generation step, Select the appropriate virtual machine generation: Generation 2.
![VM generation Selection Process](https://aashu.co.in/wp-content/uploads/2024/04/VM-Generation-Selection1.png)
In the Assign Memory step, Please add enough RAM to meet the requirements of this environment. 2GB RAM or more is better. Make sure you select “use dynamic memory for this virtual machine“.
![Ram Selection Process](https://aashu.co.in/wp-content/uploads/2024/04/Ram-Selection.png)
In the Configure Networking step, Select WAN from Connection drop-down menu.
![Network Connection Selection](https://aashu.co.in/wp-content/uploads/2024/04/Network-Connection-selection.png)
for the Connect Virtual Hard Disk step, Select Create a virtual hard disk and assign 20 to 40 GB for the VM disk.
![Virtual Disk Selection](https://aashu.co.in/wp-content/uploads/2024/04/Virtaul-Disk-Option.png)
In the Installation Options step, Select Install an operating system from a bootable image file and Browse to the pfSense software installer ISO image.
![OS Image Selection](https://aashu.co.in/wp-content/uploads/2024/04/OS-image-selection.png)
Click Finish if all of the information is correct.
Change settings of the pfSense Virtual Machine.
Add Network adapters to pfSense Firewall.
After the pfSense VM is created, we have to install new network adapters in the machine to add new subnets.
Select the VM in the Virtual Machines list in the Hyper-V Manager > Click Settings on the Actions panel for this VM > Select Add Hardware under Hardware in the left side panel > Select Network Adapter.
![VM Settings](https://aashu.co.in/wp-content/uploads/2024/04/VM-Settings-1024x380.png)
![Adding Network Adapter](https://aashu.co.in/wp-content/uploads/2024/04/Add-Network-Adapter1.png)
once you add the new network adapter, make sure it is connected to the virtual switch named LAN.
![LAN virtual switch](https://aashu.co.in/wp-content/uploads/2024/04/LAN-virtual-switch.png)
We have to create new virtual network adapter to connect to the virtual switch named Monitoring, AD Lab and Vulnerable Machines.
![Monitoring network adapter](https://aashu.co.in/wp-content/uploads/2024/04/Monitoring-virtual-switch1.png)
![AD Lab Network Adapter](https://aashu.co.in/wp-content/uploads/2024/04/AD-Lab-virtual-switch1.png)
![Vulnerable Machines Network Adapter](https://aashu.co.in/wp-content/uploads/2024/04/Vulnerable-Machines-Network-Adapter1.png)
Change Boot order.
Select Firmware under Hardware in the left side panel > Select the Hard Drive entry in the Boot Order list > Click Move Up until the Hard Drive entry is at the top of the list.
![Boot Order](https://aashu.co.in/wp-content/uploads/2024/04/Boot-Order.png)
Disable Secure Boot.
Select Security under Hardware in the left side panel > Uncheck Enable Secure Boot.
![Disable Secure Boot](https://aashu.co.in/wp-content/uploads/2024/04/Disable-Secure-Boot1.png)
Final Settings Check for pfSense.
The changed settings of pfSense VM should look like below.
![Final Setting of VM](https://aashu.co.in/wp-content/uploads/2024/04/Final-Setting-of-VM.png)
Installing pfSense on virtual machine.
Open Hyper-V manager, select the virtaul machine named pfSense and select start.
Accept the copyright and distribution notice
![copyright and distribution notice](https://aashu.co.in/wp-content/uploads/2024/04/Copyright-and-Distribution-Notice-1024x842.png)
Choose Install pfsense
![Installing pfsense](https://aashu.co.in/wp-content/uploads/2024/04/Install-pfSense-option-1-1024x842.png)
Choose Auto (ZFS)
![disk partition option](https://aashu.co.in/wp-content/uploads/2024/04/partition-disk-option-1024x843.png)
For ZFS Configuration settings, select Proceed with Installation
![ZFS Configuration option](https://aashu.co.in/wp-content/uploads/2024/04/ZFS-Configuration-option-1024x843.png)
Select Stripe – No Redundancy
![Stripe - No Redundancy](https://aashu.co.in/wp-content/uploads/2024/04/ZFS-Configuration-option_2-1024x843.png)
Use Space Bar to select the virtual disk
![virtual disk option](https://aashu.co.in/wp-content/uploads/2024/04/ZFS-Configuration-option_3-1024x843.png)
Press Yes to start the installation and wait for the installation to be completed.
![Start Installation](https://aashu.co.in/wp-content/uploads/2024/04/ZFS-Configuration-option_4-1024x843.png)
Reboot after the installation is completed
![Reboot after installation](https://aashu.co.in/wp-content/uploads/2024/04/Reboot-after-installation-1024x843.png)
pfSense Configuration.
Once the machine is rebooted, we have to change few configurations.
When asked Should VLANs be set up now [y|n]? –> choose n
![setup vlan now](https://aashu.co.in/wp-content/uploads/2024/04/setup-vlan-now-1024x843.png)
Now we will manually setup the network interfaces.
- Enter the WAN interface name: hn0
- Enter the LAN interface name: hn1
- Enter the Optional 1 interface name: hn2
- Enter the Optional 2 interface name: hn3
- Enter the Optional 3 interface name: hn4
Do you want to proceed?: y
![Manually setup network interfaces](https://aashu.co.in/wp-content/uploads/2024/04/Manually-setup-network-interfaces-1024x843.png)
Configuring Interfaces.
You should see something like this in your lab setup.
![Configuring interfaces](https://aashu.co.in/wp-content/uploads/2024/04/configuring-interfaces-updated-1024x843.png)
The WAN (hn0) interface got the IP address from my home router network.
The Default LAN (hn1) IP address is 192.168.1.1/24
The Monitoring (hn2), AD Lab (hn3) and Vulnerable Machines (hn4) network interfaces are not yet configured.
Configuring LAN (hn1).
Enter num 2 to select “Set interface(s) IP address” and then Enter num 2 to select the LAN interface.
- Configure IPv4 address LAN interface via DHCP?: n
- Enter the new LAN IPv4 address: 10.0.1.1
- Enter the new LAN IPv4 subnet bit count: 24
![Lan interface configuration](https://aashu.co.in/wp-content/uploads/2024/04/Lan-Interface-configuration-1024x843.png)
Press Enter as we do not want any upstream gateway for LAN interface.
- Configure IPv6 address LAN interface via DHCP6: n
- For the new LAN IPv6 address question press Enter
- Do you want to enable the DHCP server on LAN?: y
- Enter the start address of the IPv4 client address range: 10.0.1.100
- Enter the end address of the IPv4 client address range: 10.0.1.243
- Do you want to revert to HTTP as the webConfigurator protocol?: n
![Lan Configuration Option](https://aashu.co.in/wp-content/uploads/2024/04/Lan-Interface-configuration2-1024x843.png)
Press Enter to complete the LAN interface configuration.
![Lan Configuration](https://aashu.co.in/wp-content/uploads/2024/04/Lan-Interface-configuration3.png)
Once we hit Enter key, the LAN interface will be set to the IP address 10.0.1.1/24
Configuring Monitoring (hn2).
Enter num 2 to select “Set interface(s) IP address” and then Enter num 3 to select the Monitoring interface.
- Configure IPv4 address OPT1 interface via DHCP?: n
- Enter the new OPT1 IPv4 address: 10.0.2.1
- Enter the new OPT1 IPv4 subnet bit count: 24
![Configuring Monitoring Interface](https://aashu.co.in/wp-content/uploads/2024/04/Configuring-Monitoring-Interface.png)
Press Enter as we do not want any upstream gateway for Monitoring interface.
- Configure IPv6 address OPT1 interface via DHCP6: n
- For the new OPT1 IPv6 address question press Enter
- Do you want to enable the DHCP server on OPT1?: y
- Enter the start address of the IPv4 client address range: 10.0.2.100
- Enter the end address of the IPv4 client address range: 10.0.2.253
- Do you want to revert to HTTP as the webConfigurator protocol?: n and hit Enter.
![Configuring Monitoring Interface](https://aashu.co.in/wp-content/uploads/2024/04/Configuring-Monitoring-Interface2.png)
Configuring AD Lab (hn3).
Enter num 2 to select “Set interface(s) IP address” and then Enter num 4 to select the AD Lab interface.
- Configure IPv4 address OPT2 interface via DHCP?: n
- Enter the new OPT2 IPv4 address: 10.0.3.1
- Enter the new OPT2 IPv4 subnet bit count: 24
![Configuring AD Lab Interface](https://aashu.co.in/wp-content/uploads/2024/04/Configuring-AD-LAb-Interface-1024x843.png)
Press Enter as we do not want any upstream gateway for AD Lab interface.
- Configure IPv6 address OPT2 interface via DHCP6: n
- For the new OPT2 IPv6 address question press Enter
- Do you want to enable the DHCP server on OPT2?: n
* This interface will be connected to Active Directory network, so we will not enabled DHCP service. The Active Directory Domain controller will be responsible to assign IP address to the machine in the AD Lab network. *
- Do you want to revert to HTTP as the webConfigurator protocol?: n
![Configuring AD Lab Interface 2](https://aashu.co.in/wp-content/uploads/2024/04/Configuring-AD-LAb-Interface2.png)
Configuring Vulnerable Machines (hn4).
Enter num 2 to select “Set interface(s) IP address” and then Enter num 5 to select the Vulnerable Machines interface.
- Configure IPv4 address OPT2 interface via DHCP?: n
- Enter the new OPT3 IPv4 address: 10.0.4.1
- Enter the new OPT3 IPv4 subnet bit count: 24
![Vulnerable Machines Interface](https://aashu.co.in/wp-content/uploads/2024/04/Vulnerable-Machines-interface-1024x843.png)
Press Enter as we do not want any upstream gateway for Vulnerable Machines interface.
- Configure IPv6 address OPT3 interface via DHCP6: n
- For the new OPT3 IPv6 address question press Enter
- Do you want to enable the DHCP server on OPT3?: y
- Enter the start address of the IPv4 client address range: 10.0.4.100
- Enter the end address of the IPv4 client address range: 10.0.4.253
- Do you want to revert to HTTP as the webConfigurator protocol?: n
![Vulnerable Machines interface](https://aashu.co.in/wp-content/uploads/2024/04/Vulnerable-Machines-interface-2.png)
Final Interface Check.
Below would be the interface IP addresses look like.
![Final Interface IP check](https://aashu.co.in/wp-content/uploads/2024/04/Final-Check.png)
In this module, we have installed pfSense Firewall on Virtual Machine. In the next module, we will setup Kali Linux on virtual machine.