# pfSense ネットワークゲートウェイ

冗長構成（HA）設定手順

この記事では、pfSense を使用して高可用性 (HA) ネットワークゲートウェイを構築する方法について紹介します。この FreeBSD ベースのオープンソースソフトウェアは、安定したネットワーク環境の実現に役立ちます。

## pfSenseとは？ <a href="#pfsensenetworkgateway-whatispfsense" id="pfsensenetworkgateway-whatispfsense"></a>

pfSense は、ルーター、ファイアウォール、VPN、プロキシなど、さまざまなネットワーク機能を実装できる FreeBSD ベースのオープンソースのルーター/ファイアウォールソフトウェアです。&#x20;

ExpressRoute/サイト間VPN構築時の仮想ネットワークゲートウェイの設定も公式ドキュメントに記載されているため、多くの企業環境で安心して利用できます。

## ファイルの準備 <a href="#pfsensenetworkgateway-filepreparation" id="pfsensenetworkgateway-filepreparation"></a>

{% stepper %}
{% step %}

### pfSense ISOファイルのダウンロード

pfSense 公式ウェブサイト (<https://www.pfsense.org/download/>) にアクセスし、最新の ISO イメージをダウンロードします。
{% endstep %}

{% step %}

### &#x20;FPT CLOUD コンソールにログイン

[https://console.fptcloud.jp/ ](https://console.fptcloud.jp/)にアクセスし、提供された認証情報でログインします。
{% endstep %}

{% step %}

### ISOファイルのアップロード

ダウンロードした pfSense ISO ファイルを選択し、ポータルにアップロードします。アップロードが完了すると確認メッセージが表示されます。

<figure><img src="/files/EmCwZrd5JKcjQMQqJL87" 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>
{% endstep %}
{% endstepper %}

## ネットワーク環境の準備 <a href="#pfsensenetworkgateway-networkenvironmentpreparation" id="pfsensenetworkgateway-networkenvironmentpreparation"></a>

{% stepper %}
{% step %}

### t新しいサブネットの作成

FPT CLOUD Console で、要件に応じて新しいサブネットを作成します。これにより、pfSense のネットワークインターフェースに必要な IP アドレスを割り当てることができます。

<figure><img src="/files/bnZFqmpql8zK8rnDVyUJ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/1haqwxdLrfjJoaWoJX4P" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### セキュリティグループの作成

環境のセキュリティルールを定義し、pfSense仮想マシン間の通信とネットワークトラフィックを制御するための適切なセキュリティグループを作成します。

<figure><img src="/files/0gdGBygVnK0dj8S4EUAu" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/nsdbpELsVZSiIxGo3LDx" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

## pfSense仮想マシンの作成 <a href="#pfsensenetworkgateway-creatingapfsensevirtualmachine" id="pfsensenetworkgateway-creatingapfsensevirtualmachine"></a>

{% stepper %}
{% step %}

### Compute Engine

FPT CLOUD コンソールの「Compute」メニューに移動し、**「インスタンスの作成」**&#x3092;クリックします。

<figure><img src="/files/74znNiMAOOjD4wGpWK92" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 基本情報の設定

インスタンス名（例：pfsense-master または pfsense-slave）を設定し、**ISO** イメージオプションで先にアップロードした pfSense ISO を選択します。

<figure><img src="/files/z2TaTN7QiLRRrKB34SZF" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/T9DI7jvD30HkassTS3vx" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/WIXtqVu91e1go4EHGaSB" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### リソースとネットワークの設定

必要なリソースサイズ（CPU/RAM）を選択し、必要なネットワークを接続します。

<figure><img src="/files/EDirVwWjMiwJODvT90pm" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/P2qx0dZHzxBijjWhgNhl" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### セキュリティグループの接続

作成したセキュリティグループをアタッチし、仮想マシンを作成します。

<figure><img src="/files/WTBmnqiBhGv9tcqP0goP" alt=""><figcaption></figcaption></figure>

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

## HA（高可用性）要件 <a href="#pfsensenetworkgateway-ha-highavailability-requirements" id="pfsensenetworkgateway-ha-highavailability-requirements"></a>

高可用性（HA）実装の最低要件

* pfSense ネットワークインターフェース上のサブネットごとに最低3つのIPアドレス（マスター用1つ、スレーブ用1つ、外部通信用仮想IP）
* レイヤー2デバイスはマルチキャストをサポートしている必要がある
* CARPで使用される仮想IPアドレスにアクセス可能な上流/ISP/ルーター

## pfSenseインターフェースの設定 <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>

### 新しいネットワーク：カードの追加 <a href="#pfsensenetworkgateway-newnetwork-addingacard" id="pfsensenetworkgateway-newnetwork-addingacard"></a>

* **「インターフェース」**&#x30E1;ニューから「割り当て」を選択し、**「追加」**&#x3092;クリックして新しいインターフェースを追加します。
* OPT1 インターフェースをダブルクリックし、必要な情報を入力します。
* 設定後、**「保存」**&#x3092;クリックし、**「変更を適用」**&#x3092;クリックします。

### ファイアウォール: ルール作成 <a href="#pfsensenetworkgateway-firewall-creatingrules" id="pfsensenetworkgateway-firewall-creatingrules"></a>

* **「ファイアウォール」**&#x30E1;ニューか&#x3089;**「ルール」**&#x3092;選択し、**「同期」**&#x30BF;ブに切り替えます。
* **「追加」**&#x3092;クリックして新規ルールを作成し、必要な情報を入力します。
* 設定が完了したら、**「保存して変更を適用」**&#x3092;クリックします。
* 両方のpfSenseサーバーで同じ設定を行います。

## CARP（高可用性プロトコル）の設定 <a href="#pfsensenetworkgateway-configuringcarp-highavailabilityprotocol" id="pfsensenetworkgateway-configuringcarp-highavailabilityprotocol"></a>

### マスターでの CARP 設定 <a href="#pfsensenetworkgateway-configuringcarponthemaster" id="pfsensenetworkgateway-configuringcarponthemaster"></a>

* **「システム」**&#x30E1;ニューから「高可用性同期」を選択し、必要な情報を入力します。
* リモートシステムのユーザー名とパスワードは、pfSense スレーブ仮想マシン上の高権限ユーザーの認証情報を指定します。<br>

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

### スレーブでの CARP 設定 <a href="#pfsensenetworkgateway-configuringcarpontheslave" id="pfsensenetworkgateway-configuringcarpontheslave"></a>

* 同様に、「システム」メニューから「高可用性同期」を選択し、必要な情報を入力します。
* 設定はマスターとは異なりますので、指示に従って適切に設定してください。

  <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/ai-factory-guideline-jp/fpt-gpu-cloud/gpumashin/chtoriaru/pfsense-nettowkugtowei.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.
