# Using Distributed Firewall in a Data Center Group

## <mark style="color:green;">**Overview**</mark> <a href="#overview" id="overview"></a>

HI GIO supports a distributed firewall service for data center groups. You create a single default security policy applied to the data center group.

It can inspect every packet and frame coming to and leaving the VM regardless of the network topology. Packet inspection is done at the VM virtual NIC (vNIC) level, which enables access-control lists (ACLs) to be applied closest to the source.

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FkfgZHPLeuEU3wDutB8Cd%2Fimage.png?alt=media&#x26;token=fce51fec-a6f5-487c-91a3-9be823ba1935" alt=""><figcaption></figcaption></figure>

## <mark style="color:green;">**Procedure**</mark> <a href="#procedure" id="procedure"></a>

{% tabs %}
{% tab title="I. Predefine Object" %}
To create distributed firewall rules and add them to a data center group, you need to define some things:

*<mark style="color:blue;">Name</mark>*<mark style="color:blue;">: Name for the rule.</mark>

*<mark style="color:blue;">Source</mark>*<mark style="color:blue;">:</mark> <mark style="color:blue;"></mark><mark style="color:blue;">**IP Sets\Dynamic Groups\Static Group (1.1, 1.2, 1.3, 1.4)**</mark>

*<mark style="color:blue;">Destination</mark>*<mark style="color:blue;">:</mark> <mark style="color:blue;"></mark><mark style="color:blue;">**IP Sets\Dynamic Groups\Static Group (1.1, 1.2, 1.3, 1.4)**</mark>

*<mark style="color:blue;">Application:</mark>* <mark style="color:blue;"></mark><mark style="color:blue;">Select applications with port to apply rule</mark> <mark style="color:blue;"></mark><mark style="color:blue;">**(1.5)**</mark>

*<mark style="color:blue;">Action</mark>*<mark style="color:blue;">:</mark> <mark style="color:blue;"></mark><mark style="color:blue;">**Allow**</mark><mark style="color:blue;">\\</mark><mark style="color:blue;">**Reject**</mark><mark style="color:blue;">\\</mark><mark style="color:blue;">**Drop**</mark>

*<mark style="color:blue;">IP Protocol:</mark>* <mark style="color:blue;">**IPv4/IPv6**</mark> <mark style="color:blue;"></mark><mark style="color:blue;">or</mark> <mark style="color:blue;"></mark><mark style="color:blue;">**both**</mark>

* **Add an IP Set to the Data Center Group:**

IP sets are groups of IP addresses and networks to which the distributed firewall rules apply (as **Source** and **Destination**). Combining multiple objects into IP sets helps you reduce the total number of distributed firewall rules to be created

**Step 1:** In the top navigation bar, click **Networking** and then click the **Data Center Groups** tab

**Step 2:** Click the data center group name

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FXNePk7synT6OFCAwCPNK%2Fimage.png?alt=media&#x26;token=77a6c7ad-45df-45ed-afaf-8de8bc382968" alt=""><figcaption></figcaption></figure>

**Step 3:** Under *Security*, click **IP Sets**

**Step 4:** Click **New**.

**Step 5:** Enter a meaningful **Name,** a **Description** for IP Sets

**Step 6:** Enter an IPv4 address, IPv6 address, or an address range in a CIDR format, and click **Add**.

**Step 7:** To modify an existing IP address or range, click **Modify** and edit the value.

**Step 8:** To confirm, click **Save**.

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FDtsm5LuboY70pKtX296B%2Fimage.png?alt=media&#x26;token=dac6b49a-8dff-4b5c-9af7-4e2477c7a872" alt=""><figcaption></figcaption></figure>

* **Create a Static Security Group:**

Static security groups are data center group networks to which distributed firewall rules apply (as **Source** and **Destination**). Grouping networks helps you reduce the total number of distributed firewall rules that need to be created.

**Step 1:** In the top navigation bar, click **Networking** and then click the **Data Center Groups** tab

**Step 2:** Click the data center group name

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FN2qJ0z8qsTV9E9iH2FTc%2Fimage.png?alt=media&#x26;token=390b7323-36f2-4ed2-8f06-c8cc5928ae56" alt=""><figcaption></figcaption></figure>

**Step 3:** Under *Security*, click **Static Groups**.

**Step 4:** Click **New**.

**Step 5:** Enter a **Name**, a **Description** for the static group, and click **Save**.

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2F9ERM8Z9ggMRvnao6GwmE%2Fimage.png?alt=media&#x26;token=b163546f-52dd-4727-b90b-a96691c27359" alt=""><figcaption></figcaption></figure>

The static security group will appear in the list.

**Step 6:** Select the newly created static security group and click **Manage Members**.

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FPgijt7Svmwi5wtdRBXdF%2Fimage.png?alt=media&#x26;token=803fb194-fed0-415e-98f9-0de372a14346" alt=""><figcaption></figcaption></figure>

**Step 7:** Select the data center group networks that you want to add to the static security group >> **Save**

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2F08F0cTUzhyghKjmaD2bH%2Fimage.png?alt=media&#x26;token=4372526b-4a59-403b-97b1-db100886a257" alt=""><figcaption></figcaption></figure>

* **Assign Security Tags to VM:**

Security tags you create and assign to virtual machines help you define edge gateway and distributed firewall rules.

**Step 1:** In the top navigation bar, click **Networking.**

**Step 2:** Click **Security Tags**.

**Step 3:** Click **Add Tag**.

**Step 4:** Enter a **tag name**.

**Step 5:** From the list of virtual machines in the organization, select the ones to assign the newly created tag.

**Step 6:** Click **Save**.

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FWVQXOgaErltstNII97jW%2Fimage.png?alt=media&#x26;token=b5481797-c08d-4a85-8fe9-12b8b02f9934" alt=""><figcaption></figcaption></figure>

* **Create a Dynamic Security Group:**

You can define dynamic security groups of virtual machines based on specific criteria (**VM Name** or **Tag Name**) to which to apply distributed firewall rules.

**Step 1:** In the top navigation bar, click **Networking** and then click the **Data Center Groups** tab

**Step 2:** Click the data center group name

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FzbzKuyrRmKpz5kyU4WZ6%2Fimage.png?alt=media&#x26;token=bcd08486-8050-45dd-a867-d8c93bde6a73" alt=""><figcaption></figcaption></figure>

**Step 3:** Under *Security*, click **Dynamic Groups**.

**Step 4:** Click **New**.

**Step 5:** Enter a Name and a Description for the dynamic security group.

**Step 6:** To create a **Criterion** for inclusion in the group, add up to **four rules** that apply to a VM Name or a VM security tag.

* *VM Name:* a rule that applies to VM names containing or starting with a term you specify.
* *VM tag:* a rule that applies to VM tags that **equal**, **contain**, **start with**, or **end with** a term you specify.

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FavkdvWRKqG4t9krZns3N%2Fimage.png?alt=media&#x26;token=089d1ac7-abea-4dbd-a633-2630a306e8f9" alt=""><figcaption></figcaption></figure>

As figured out, I created 02 rules

* *VM Name*: **Start With** “demo”
* *VM Tag*: **Equals** “non-prd” (*That you created in **1.3**)*

**Step 7:** Click **Save**.

* **Add a Custom Application Port Profile:**

You can use preconfigured and custom application port profiles to create distributed firewall rules.

Application port profiles include a combination of a protocol and a port or a group of ports, used for firewall services.&#x20;

**Step 1:** In the top navigation bar, click **Networking** and then click the **Data Center Groups** tab

**Step 2:** Click the **data center group name**

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FO6oQEAVRIWYccaAQCgGc%2Fimage.png?alt=media&#x26;token=d2582b58-c3e7-4955-9935-82c87ffee419" alt=""><figcaption></figcaption></figure>

**Step 3:** Under *Security*, click **Application Port Profiles**

**Step 4:** In the **Custom Applications** pane, click **New**.

**Step 5:** Enter a **Name** and, a **Description** for the application port profile.

**Step 6:** From the *Protocol* drop-down menu, select the protocol: **TCP**, **UDP**, **ICMPv4**, **ICMPv6**

**Step 7:** Enter a port, or a range of ports, separated by a comma, and click **Save**.

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FYj3M9MWKE7UOMZSipCel%2Fimage.png?alt=media&#x26;token=8526d36c-23f8-4c81-b62c-82482ae73dc1" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="II. Add a Distributed Firewall Rule" %}
We have predefined Objects in the previous. We will create the distributed firewall rules as below:

1. In the top navigation bar, click **Networking** and then click the **Data Center Groups** tab
2. Click the data center group name

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FbuIPYqVDnjm3EIrPxFwX%2Fimage.png?alt=media&#x26;token=eb504b6d-59ca-49ca-923b-bc1e62812ae3" alt=""><figcaption></figcaption></figure>

3\. Click the **Distributed Firewall** tab on the left.

4\. Click **Edit Rules**.

5\. To add a firewall rule, click **New on Top**.

**NOTE**: Each traffic session is checked against the top rule in the firewall table before moving down the\
subsequent rules in the table. The first rule in the table that matches the traffic parameters is\
enforced

6\. Configure the rule

*<mark style="color:blue;">**Name**</mark>*<mark style="color:blue;">: \[Name of rule]</mark>

*<mark style="color:blue;">**State**</mark>*<mark style="color:blue;">: \[Enable or disable rule by toggle]</mark>

*<mark style="color:blue;">**Applications**</mark>*<mark style="color:blue;">: Select default profiles or custom profiles that created in</mark> <mark style="color:blue;"></mark><mark style="color:blue;">**1.5**</mark>

*<mark style="color:blue;">**Context**</mark><mark style="color:blue;">:</mark>* <mark style="color:blue;"></mark><mark style="color:blue;">(Optional) Select context profile for the rule.</mark>

*<mark style="color:blue;">**Source**</mark><mark style="color:blue;">:</mark>* <mark style="color:blue;"></mark><mark style="color:blue;">Select Any or Object created in</mark> <mark style="color:blue;"></mark>*<mark style="color:blue;">**1.1, 1.2, 1.3, 1.4**</mark>*

*<mark style="color:blue;">**Destination**</mark><mark style="color:blue;">:</mark>* <mark style="color:blue;"></mark><mark style="color:blue;">Select Any or Object created in</mark> <mark style="color:blue;"></mark>*<mark style="color:blue;">**1.1, 1.2, 1.3, 1.4**</mark>*

*<mark style="color:blue;">**Action**</mark><mark style="color:blue;">:</mark>* <mark style="color:blue;"></mark><mark style="color:blue;">**Allow**</mark><mark style="color:blue;">\\</mark><mark style="color:blue;">**Reject**</mark><mark style="color:blue;">\\</mark><mark style="color:blue;">**Drop**</mark>

*<mark style="color:blue;">**IP Protocol**</mark><mark style="color:blue;">:</mark>* <mark style="color:blue;"></mark><mark style="color:blue;">**IPv4/IPv6**</mark> <mark style="color:blue;"></mark><mark style="color:blue;">or</mark> <mark style="color:blue;"></mark><mark style="color:blue;">**both**</mark>

***Logging**:* \[Enable or disable by toggle] enable to have the address translation performed by this rule logged

<figure><img src="https://3953927389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbvay7AR0CH8vZKgD3dSy%2Fuploads%2FRTleZ45M4OVQlo96PKCH%2Fimage.png?alt=media&#x26;token=8f780543-20a7-4f24-9396-d77cbf6854e9" alt=""><figcaption></figcaption></figure>

7\. Click **Save**.

{% hint style="warning" %}
Please do not remove the rules name starting with HIGIO (if any)
{% endhint %}
{% 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/network/1.-working-with-network/using-distributed-firewall-in-a-data-center-group.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.
