# IPSec VPN

## <mark style="color:green;">**Tổng quan**</mark> <a href="#overview" id="overview"></a>

IPsec VPN cung cấp kết nối site-to-site giữa HI GIO và các site từ xa với các bộ định tuyến phần cứng bên thứ ba hoặc các VPN Gateway hỗ trợ IPsec.

Trên HI GIO, bạn có thể tạo các tunnel VPN giữa:

* Organization virtual data center networks trong cùng một organization
* Organization virtual data center networks trong các organization khác nhau.
* Giữa organization's virtual data center network và external network

## <mark style="color:green;">Quy trình</mark> <a href="#id-2.-guidance" id="id-2.-guidance"></a>

{% tabs %}
{% tab title="I. Chuẩn bị các tham số VPN" %}
Hoàn tất các tham số [IPSec parameters](https://docs.higiocloud.vn/hi-gio-user-guide-vn/network/2.-vpn/ipsec-parameters).
{% endtab %}

{% tab title="II. Tạo IPsec VPN" %}
**Bước 1**: Trên thanh điều hướng trên cùng, nhấp vào **Networking** và chọn tab **Edge Gateways**.

**Bước 2**: Nhấp vào **edge gateway**.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/a6AuV5BFPLLz7EwnpUZb/image.png" alt=""><figcaption></figcaption></figure>

**Bước 3**: Trong mục **Services**, nhấp vào **IPSec VPN**.

**Bước 4**: Để cấu hình một tunnel IPSec VPN, nhấp vào **New**.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/FBJPBeLvZs6RysiEcrVN/image.png" alt=""><figcaption></figcaption></figure>

**Bước 5**: Nhập **Name** và mô tả (tùy chọn) cho tunnel IPSec VPN.

**Bước 6**: Để kích hoạt tunnel ngay khi tạo, bật tùy chọn **Status**.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/u0M2NPoSN6rKvutAFNFH/image.png" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Đối với **Security Profile** – giữ nguyên mặc định và cấu hình sau khi tunnel VPN được tạo.
{% endhint %}

**Bước 7**: Nhấp **NEXT** để chọn chế độ xác thực.

**Bước 8**: Chọn chế độ xác thực đối tác (peer authentication) và nhấp **NEXT**.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/ftzwGJuGg467WjRMjImb/image.png" alt=""><figcaption></figcaption></figure>

HI GIO hỗ trợ 02 tùy chọn cho **Authentication Mode:**

| **Lựa chọn**       | **Mô tả**                                                                                  |
| ------------------ | ------------------------------------------------------------------------------------------ |
| **Pre-Shared Key** | Chọn pre-shared key để nhập. Pre-shared key phải giống nhau trên cả 2 đầu PSec VPN tunnel. |
| **Certificate**    | Lựa chọn site và chứng chỉ CA để xác thực                                                  |

**Bước 9**: Trong cửa sổ **Endpoint Configuration**, nhập một số tham số (theo các tham số [IPSec parameters](https://higio-support.atlassian.net/wiki/spaces/v2/pages/40206337) đã chuẩn bị):

*<mark style="color:green;">**IP address \[Local Endpoint]:**</mark>*<mark style="color:green;">Nhập địa chỉ IP công khai (public IP) của HI GIO.</mark>

*<mark style="color:green;">**Networks \[Local Endpoint]:**</mark>* <mark style="color:green;"></mark><mark style="color:green;">Nhập ít nhất một địa chỉ IP subnet mạng nội bộ của HI GIO cho tunnel IPSec VPN.</mark>

*<mark style="color:green;">**IP address \[Remote Endpoint]:**</mark>* <mark style="color:green;">Nhập địa chỉ IP công khai (public IP) của site từ xa, ví dụ: IP công khai của văn phòng.</mark>

*<mark style="color:green;">**Networks \[Remote Endpoint]:**</mark>* <mark style="color:green;"></mark><mark style="color:green;">Nhập ít nhất một địa chỉ IP subnet mạng từ xa, ví dụ: mạng của văn phòng cho tunnel IPSec VPN.</mark>

**Bước 10**: Nhập **remote ID** (tùy chọn) cho site đối tác.

{% hint style="warning" %}
Trong trường hợp sử dụng **Certificate** cho Authentication mode
{% endhint %}

Remote ID phải khớp với SAN (Subject Alternative Name) của chứng chỉ endpoint từ xa (nếu có). Nếu chứng chỉ từ xa không chứa SAN, remote ID phải khớp với tên phân biệt (distinguished name) của chứng chỉ được sử dụng để bảo mật endpoint từ xa, ví dụ: `C=US, ST=Massachusetts, O=VMware, OU=VCD, CN=Edge1`.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/Yx9i7VDJWBXZeb5on0jc/image.png" alt=""><figcaption></figcaption></figure>

**Bước 11**: Nhấp **Next**.

**Bước 12**: Xem lại cài đặt và nhấp **Finish**.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/BytXBpD3leFXzw4hDRa6/image.png" alt=""><figcaption></figcaption></figure>

Tunnel IPSec VPN vừa tạo sẽ được liệt kê trong giao diện **IPSec VPN** view. Tunnel IPSec VPN được tạo với cấu hình bảo mật mặc định.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/6V37PwdEwhIREiugPWml/image.png" alt=""><figcaption></figcaption></figure>

**Bước 13**: Để kiểm tra xem tunnel có hoạt động hay không, chọn tunnel và nhấp **View Statistics**.<br>

Nếu tunnel hoạt động, **Tunnel Status** và **IKE Service Status** sẽ hiển thị trạng thái **Up**.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/vOs1bmeOzB0MiXlArEVH/image.png" alt=""><figcaption></figcaption></figure>

&#x20;
{% endtab %}

{% tab title="III. Cấu hình Security Profile cho tunnel IPSec VPN" %}
Sau khi tunnel IPSec VPN đã được tạo, bạn có thể thay đổi cấu hình IPSec VPN bằng Security Profile, đảm bảo rằng cấu hình phải phù hợp với site từ xa (remote)

**Bước 1**: Trên thanh điều hướng trên cùng, nhấp vào **Networking** và chọn tab **Edge Gateways**.

**Bước 2**: Nhấp vào **Edge Gateways**.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/LZQXKExPtw4BecuKBmbA/image.png" alt=""><figcaption></figcaption></figure>

**Bước 3**: Trong mục **Services**, nhấp vào **IPSec VPN**.

**Bước 4**: Chọn tunnel IPSec VPN và nhấp vào **Security Profile Customization**.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/aDxdtbVAX47ou70Y1vSJ/image.png" alt=""><figcaption></figcaption></figure>

**Bước 5**: Thay đổi các cấu hình của tunnel VPN theo các tham số ([IPSec parameters](https://higio-support.atlassian.net/wiki/spaces/v2/pages/40206337))  mà bạn đã chuẩn bị.&#x20;

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/roddOKFAQhkVjXJIUgH1/image.png" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Rem**Lưu ý**: Các thiết lập bảo mật phải khớp với các thiết lập bảo mật của site từ xa (remote).
{% endhint %}
{% endtab %}

{% tab title="IV. Cấu hình firewall rule cho tunnel VPN" %}
**Bước 1**: Chuẩn bị IP set cho firewall rule (có thể sử dụng nhóm dynamic/static). [Thông tin chi tiết](https://docs.higiocloud.vn/hi-gio-user-guide-vn/network/1.-lam-viec-voi-mang-network/su-dung-edge-gateway-firewall).

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/y73K6caL4VsmV7HNfQJr/image.png" alt=""><figcaption></figcaption></figure>

**Chi tiết IP set**:

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/Rls3NADWEkRWboQltj21/image.png" alt=""><figcaption><p>IPsec-Higio</p></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/2l3eZQRTbwWzsPQnUgjC/image.png" alt=""><figcaption><p>IPsec-Local-Subnet</p></figcaption></figure>

**Bước 2**: Tạo 02 firewall rules (Edge gateway firewall) cho tunnel IPSec:

\+ HI GIO to Local (remote site)

\+ And Local (remote site) to HI GIO

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/ouXRwjGjTizFxyRmBdAx/image.png" alt=""><figcaption></figcaption></figure>

Nếu bạn sử dụng **Distributed firewall**, bạn cũng cần tạo firewall rules để cho phép lưu lượng VPN (từ site từ xa đến HI GIO).

\*\*\* ***Lưu ý:*** Hãy cấu hình firewall rules cho lưu lượng VPN trên các router từ xa.

**XÁC NHẬN**: Kiểm tra trạng thái của tunnel là **UP** và có **Traffic**.

<figure><img src="https://content.gitbook.com/content/dOZ82gj0wvhbAUlxBHpj/blobs/BI6OsuQuKPg5Yb7FcuDi/image.png" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}


---

# 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://docs.higiocloud.vn/hi-gio-user-guide-vn/network/2.-vpn/ipsec-vpn.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.
