# pfSense Network Gateway

Redundant Configuration (HA) Setup Procedure

This article will introduce how to build a highly available (HA) network gateway using pfSense. This FreeBSD-based open source software will help you achieve a stable network environment.

## What is pfSense? <a href="#pfsensenetworkgateway-whatispfsense" id="pfsensenetworkgateway-whatispfsense"></a>

pfSense is an open source router/firewall software based on FreeBSD that can implement various network functions such as router, firewall, VPN, and proxy.\
The configuration of the virtual network gateway when building ExpressRoute/Site-to-Site VPN is also described in the official documentation, so it can be used safely in many corporate environments.

## File preparation <a href="#pfsensenetworkgateway-filepreparation" id="pfsensenetworkgateway-filepreparation"></a>

{% stepper %}
{% step %}

### Download pfSense ISO file

Go to the official pfSense website (<https://www.pfsense.org/download/>) and download the latest ISO image.
{% endstep %}

{% step %}

### Login to FPT Cloud Console

Go to <https://console.fptcloud.jp/> and log in with the provided credentials.
{% endstep %}

{% step %}

### Uploading an ISO file

Select the downloaded pfSense ISO file and upload it to the portal. You will receive a confirmation message once the upload is complete.
{% endstep %}
{% endstepper %}

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/edited-images/SnoxqdThnx4A-HwKBcXc9.png" alt=""><figcaption></figcaption></figure>

![](https://cdn.gamma.app/k5s5lvl0didtjnd/uploaded-images/dbNDLfuRmvFeBv0Tcb5UF.png)![](https://cdn.gamma.app/k5s5lvl0didtjnd/eda7260fa1864e5ebb7e373d935e9640/original/image.png)

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/96f4a51b4be342989f7e3a729674a689/original/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/985cd1fb40f1421792247799f4e954d4/original/image.png" alt=""><figcaption></figcaption></figure>

## Network environment preparation <a href="#pfsensenetworkgateway-networkenvironmentpreparation" id="pfsensenetworkgateway-networkenvironmentpreparation"></a>

{% stepper %}
{% step %}

### Create a new subnet

In the FPT Cloud Console, create a new subnet according to your requirements, which will allow you to assign the necessary IP addresses to the network interfaces of pfSense.

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/uploaded-images/pHBnhQtHH-ms7dUkAOgle.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/c50569fd3da64c9c92fb9c07d18c112f/original/image.png" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Creating a security group

Define security rules for your environment and create appropriate security groups to control communication and network traffic between pfSense virtual machines.

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/uploaded-images/9ioXPZP7MmEutedCBu1ol.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/1a60ddbfaf14498d84678ffc6038393a/original/image.png" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

## Creating a pfSense Virtual Machine <a href="#pfsensenetworkgateway-creatingapfsensevirtualmachine" id="pfsensenetworkgateway-creatingapfsensevirtualmachine"></a>

{% stepper %}
{% step %}

### Compute Engine

Go to the Compute menu in the FPT Cloud console and click "Create Instance".
{% endstep %}

{% step %}

### Basic information settings

Set up an instance name (e.g. pfsense-master or pfsense-slave) and select the pfSense ISO you uploaded earlier in the **ISO image** option.

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/240a5471f1b140ef94edb680ae4cb909/original/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/b522a5ce82294e3cad5af098640f6ed9/original/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/65c8441c7e9c4f5f815e298a479930d3/original/image.png" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Resource and network configuration

Select the appropriate resource size (CPU/RAM) for your needs and connect the necessary networks.

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/ca33023e4de84da18a890bfc5ab6dcd6/original/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/1a5051d7af8948cc988c08e00334ef78/original/image.png" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Attaching a security group

Attach the security group you just created and create a virtual machine.

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/f4bf0356b0164ba7a0c2236edf73a28b/original/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/cc02ee04c90f4ca592241c1873dca95d/original/image.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/f5e094cb5519456bbc8a371907aadd52/original/image.png" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

## HA (High Availability) Requirements <a href="#pfsensenetworkgateway-ha-highavailability-requirements" id="pfsensenetworkgateway-ha-highavailability-requirements"></a>

Minimum Requirements for High Availability (HA) Implementation

* At least three IPs per subnet on the pfSense network interface (one for the master, one for the slave, and a virtual IP for external communication)
* Layer 2 devices must support multicast
* The upstream/ISP/router involved must have access to the virtual IP used by CARP

## Configuring the pfSense Interface <a href="#pfsensenetworkgateway-configuringthepfsenseinterface" id="pfsensenetworkgateway-configuringthepfsenseinterface"></a>

<figure><img src="https://imgproxy.gamma.app/resize/quality:80/resizing_type:fit/width:1200/https://cdn.gamma.app/k5s5lvl0didtjnd/uploaded-images/ZuY3lkbDwMc1-nTSYlcsV.png" alt=""><figcaption></figcaption></figure>

### New Network: Adding a card <a href="#pfsensenetworkgateway-newnetwork-addingacard" id="pfsensenetworkgateway-newnetwork-addingacard"></a>

* Select "Assignment" from the "Interface" menu and click "Add" to add a new interface.
* Double-click the OPT1 interface and enter the required information.
* After setting, click "Save" and then "Apply Changes".

### Firewall: Creating rules <a href="#pfsensenetworkgateway-firewall-creatingrules" id="pfsensenetworkgateway-firewall-creatingrules"></a>

* Select "Rules" from the "Firewall" menu and switch to the "Sync" tab
* Click "Add" to create a new rule, and enter the required information.
* Once you are done with the configuration, click "Save and Apply Changes".
* Do the same configuration on both pfSense servers.

## Configuring CARP (High Availability Protocol) <a href="#pfsensenetworkgateway-configuringcarp-highavailabilityprotocol" id="pfsensenetworkgateway-configuringcarp-highavailabilityprotocol"></a>

### Configuring CARP on the Master <a href="#pfsensenetworkgateway-configuringcarponthemaster" id="pfsensenetworkgateway-configuringcarponthemaster"></a>

* Select "High Availability Synchronization" from the "System" menu and enter the required information.
* The username and password for the remote system specify the credentials of a high-privileged user on the pfSense slave virtual machine.<br>

  <figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/uploaded-images/qCA9-fD6VEK9hvSK-rfLi.png" alt=""><figcaption></figcaption></figure>

### Configuring CARP on the Slave <a href="#pfsensenetworkgateway-configuringcarpontheslave" id="pfsensenetworkgateway-configuringcarpontheslave"></a>

* Similarly, select "High Availability Synchronization" from the "System" menu and enter the required information.
* The settings will be different from those of the master, so please follow the instructions to set them appropriately.<br>

  <figure><img src="https://cdn.gamma.app/k5s5lvl0didtjnd/uploaded-images/5DR3YXrJZ3NLmdlHz0_8o.png" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ai-docs.fptcloud.com/fpt-gpu-cloud/gpu-virtual-machine/on-fpt-cloud-console/tutorials/pfsense-network-gateway.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
