# Create Default or Custom Network Security Groups

Configuring Network Security Groups (NSGs) in your Virtual Data Center (VDC) empowers you to effectively manage and filter the network traffic penetrating towards or exiting the VDC, all tailored to your specific security rules and requirements.

NSGs are of two types: **Default** and **Custom**. You can choose between a Default or a Custom NSG and customize them according to your needs. For more information, see [<mark style="color:blue;">What are the differences between default and custom NSG?</mark>](https://docs.ionos.com/sections-test/guides/security/nsg-faqs#what-are-the-differences-between-default-and-custom-nsg).

NSGs provide a level of granular customization that guarantees a secure environment while allowing the necessary connectivity. They protect your virtual networks from unauthorized access, malicious activity, and other security threats.

{% hint style="info" %}
**Prerequisites:** Ensure that you have appropriate permissions to the data centers and to create NSGs. For more information, see [<mark style="color:blue;">Set User Privileges for Network Security Groups</mark>](https://docs.ionos.com/sections-test/guides/security/network-security-groups/how-tos/set-user-privileges).
{% endhint %}

{% hint style="info" %}
**Note:** User-created Virtual Machines (VMs) can be Default or Custom NSG members, but you cannot add nodes from the Managed Kubernetes node pools or suspended Cubes.
{% endhint %}

To create an NSG, select one of these methods:

{% tabs %}
{% tab title="Default NSG" %}
1\. In the **DCD**, go to **Virtual Data Centers** > **Create new**.

2\. Select the **Create default network security group** checkbox.

![Create default NSG](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-da97712e068579dd4cd1434b566924cf4a69d7a7%2Fcreate-default-nsg.png?alt=media)

{% hint style="success" %}
**Result:** The default group is created with four default rules. For more information, see [<mark style="color:blue;">What predefined rules does a default Network Security Group contain?</mark>](https://docs.ionos.com/sections-test/guides/security/nsg-faqs#what-predefined-rules-does-a-default-network-security-group-contain). All servers and NICs associated with the respective data center inherit default rules. If you add new VMs to the data center, all of its NICs inherit the rules from the default NSG.
{% endhint %}

{% hint style="info" %}
**Note:** User-created Virtual Machines (VMs) can be Default or Custom NSG members, but you cannot add nodes from the Managed Kubernetes node pools or suspended Cubes.
{% endhint %}

![Default NSG is created](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-f7821e33255376312b4fe75c8ee23f6ec2a414f4%2Fdefault-nsg-created.png?alt=media)

3\. Optionally, you can add custom rules to the default group or create new custom groups for customized rules. For more information, see [<mark style="color:blue;">Create Rules</mark>](https://docs.ionos.com/sections-test/guides/security/network-security-groups/how-tos/create-rules). Remember to [<mark style="color:blue;">associate custom groups to the servers or NICs</mark>](https://docs.ionos.com/sections-test/guides/security/network-security-groups/how-tos/attach-nsgs), whichever is applicable.
{% endtab %}

{% tab title="Custom NSG" %}
1\. In the **DCD**, go to **Menu** > **Security** > **Network Security Groups**.

2\. Select **Create security group** in the **Network Security Groups** window.

![Create security group](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-0e72552386620af9718fc2b269c1568edd563713%2Fcreate-nsg.png?alt=media)

3\. Enter the following details:

* **Datacenter:** Select a data center from the drop-down list for which you want to configure a security group.
* **Name:** Enter a name for your security group.
* **Description:** Enter additional information about the security group.

![Enter the details](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-cb5eab8bca972a7f63a052e2c3f6c0aa2de9c570%2Fdetails.png?alt=media)

4\. Click **Create** to save the details.

{% hint style="success" %}
**Result:** The desired NSG is created and set to an **Available** state.
{% endhint %}

![Enter the details](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-90bb3d2971afa83adb2cb3afdf1dc2ab7d13dc46%2Fnsg-created.png?alt=media)
{% endtab %}
{% endtabs %}

## Next steps:

* [<mark style="color:blue;">Update the respective Network Security Group</mark>](https://docs.ionos.com/sections-test/guides/security/network-security-groups/how-tos/update-nsg)
* [<mark style="color:blue;">Create Rules</mark>](https://docs.ionos.com/sections-test/guides/security/network-security-groups/how-tos/create-rules)
* [<mark style="color:blue;">Convert Custom Network Security Group to Default</mark>](https://docs.ionos.com/sections-test/guides/security/network-security-groups/how-tos/convert-custom-nsg)
* [<mark style="color:blue;">Attach a Server or NIC to a NSG</mark>](https://docs.ionos.com/sections-test/guides/security/network-security-groups/how-tos/attach-nsgs)
