To ensure the availability of your gateway, your DHCP server, as well as any other service configured on your pfSense machine or router, you can configure high availability on pfSense using the natively available options.
In this tutorial, we will use 2 pfSense virtual machines connected to the same networks.
However, it is important that they have different IP addresses so as not to create an IP address conflict.
Note: once high availability is activated and configured on pfSense, your clients will use the virtual IP addresses (VIP) shared by your 2 pfSense machines.
Our 1st pfSense machine, which will be defined as Master by default, is named "main-pfSense" and has these IP addresses:
Our 2nd pfSense machine, which will be defined as a slave machine (Backup) by default, is named "second-pfSense" and has these IP addresses:
For information purposes, here are the IP addresses used in this tutorial:
On our 1st pfSense machine, the DHCP server distributes IP addresses "10.0.0.11" to "10.0.0.19".
On our 2nd pfSense machine, the DHCP server distributes IP addresses "10.0.0.20" to "10.0.0.29".
Important : this prevents the 2 pfSense machines from distributing the same IP address to 2 different machines until high availability is enabled and configured.
Note: using 2 DHCP servers on the same network does not pose a problem as long as the distributed IP address ranges are different.
Indeed, the client PC will use the IP address offered by the DHCP server which responds first to its DHCP request.
Important : you must assign the logical interfaces (WAN, LAN, ...) to the physical interfaces (eg: vmxX, emX, ...) in the same order on the 2 machines so that high availability can correctly replicate the network configurations.
Note: the name of the network ports depends on the driver used by the network card in question.
On the console, it gives this in our case.
On the 1st pfSense machine.
On the 2nd pfSense machine.
To synchronize the settings of the master pfSense machine (Master) to the slave one (Backup), it is recommended to use a dedicated network card to prevent a hacker or a malicious person from being able to recover or modify the pfSync messages sent via the network by pfSense.
On your 2 pfSense machines, add a network card and connect it to a dedicated switch, a dedicated VLAN or connect them together with a crossover network cable.
In our case, we are virtualizing pfSense under VMware Workstation Pro for this tutorial, so we hot add a virtual network adapter to our pfSense virtual machines and we connect them to a virtual network named "pfSense Sync".
In the VMware Workstation Pro "Virtual Network Editor" program, we have indicated the subnet (Subnet) "172.16.1.0 / 255.255.255.0" which corresponds to the subnet that will be used by the pfSync interfaces in this tutorial.
In the case of a physical router or VMware ESXi hypervisor (vSphere), you do not need to specify the subnet in advance.
Warning : in the case of installing pfSense in a VMware virtual machine, pfSense recommends using a VMXNET3 virtual network adapter.
Which requires modifying the option below in the configuration file (.vmx) of the virtual machine concerned.
For more information, refer to step "3. Virtualize pfSense on VMware Workstation Pro" of our tutorial on installing pfSense on VMware Workstation Pro.
Note: in our case, "ethernet2" corresponds to our 3rd virtual network adapter which is connected to our "pfSense Sync" virtual network.
Plain Text
ethernet2.virtualDev = "vmxnet3"
Before you can configure the logical interfaces, it is necessary to restart your pfSense machines if the network cards were hot added (without turning off the machine).
To do this, in the pfSense web interface, go to the menu: Diagnostics -> Reboot.
Then, select the Reboot method "Normal reboot" and click: Submit.
Wait while pfSense restarts.
Plain Text
Rebooting. Page automatically reload in 90 seconds.
Once pfSense restarts, the pfSense login page will be displayed.
To begin, connect to the 1st pfSense machine (which will be master).
In our case, this 1st pfSense machine is called "main-pfSense" as you can see in the page name.
Go to: Interfaces -> Assignments.
An "Available network ports" option will appear with the name of the physical network adapter added to your pfSense machine.
Click on: Add.
By default, the added interface will appear under the name "OPT1".
Click on the name of this interface "OPT1" or go to "Interfaces -> OPT1" to modify it.
Note: if you have already added interfaces besides "WAN" and "LAN" before, pfSense will use another number, but the prefix used will always be "OPT".
On the "Interfaces / OPT1" page that appears, configure the first settings:
In the "Static IPv4 Configuration" section of this page, specify the IPv4 address to use and the associated subnet mask.
In our case, we indicated: 172.16.1.2 / 24.
Note: this means that the subnet used for pfSync interfaces will be "172.16.1.x".
At the bottom of the page, click Save.
At the top of the page, click: Apply Changes.
The PFSYNC interface of your 1st machine is enabled and configured.
Note that this is only the network configuration for this interface. No implementation of the HA at the moment.
On the 2nd pfSense machine, do the same thing.
So, go to "Interfaces -> Assignments" and assign the new network port (physical network adapter) to a new logical interface (OPT1 in this case).
Then, click on its name to modify this interface.
As before, activate this interface and rename it "PFSYNC".
Next, choose to set a static IPv4 address.
This time, we indicate "172.16.1.3" for the IPv4 address of this interface and we use the same subnet (/24) as on the 1st pfSense machine).
Then, at the bottom of the page, click Save. Then, on "Apply Changes" at the top of the page.
The PFSYNC interface of your 2nd pfSense machine is activated and configured.
Firewall 6/6/2025
Firewall 7/2/2025
Firewall 8/16/2025
Firewall 7/9/2025
Pinned content
Contact
® InformatiWeb-Pro.net - InformatiWeb.net 2008-2022 - © Lionel Eppe - All rights reserved.
Total or partial reproduction of this site is prohibited and constitutes an infringement punishable by articles L.335-2 and following of the intellectual property Code.
You must be logged in to post a comment