---
title: "Public IP address in an OpenSearch cluster"
sidebar_label: "Public IP address"
sidebar_position: 15
description: "How to connect a public IP address to an OpenSearch cluster node group"
---

import TrashIcon from '@selectel/docux/icons/trash'
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import Link from '@docusaurus/Link'
import Formbricks from '@theme/MDXComponents/Formbricks'

# Public IP address in an OpenSearch cluster

A public IP address is a static public IP address assigned to a node to configure access to a node in a private network from the internet. External traffic passes through the public IP address and is processed by a cloud router that performs 1:1 NAT logic.

The private subnet to which a public IP address can be assigned must comply with the [requirements](#requirements) — before adding a public IP address, [prepare the subnet](#configure-subnet).

A public IP address can be assigned:

* when [creating a cluster](/managed-databases/opensearch/create-cluster.mdx) in an existing private subnet;
* or in an [existing cluster](#assign-public-ip-in-existing-cluster).

In an OpenSearch cluster, a public IP address is assigned to all nodes in the group simultaneously. If you add a node to a group where all nodes already have IP addresses, the new node will also be assigned a public IP address.

If necessary, you can [disable the public IP address](#detach-public-ip) for the entire node group.

## Requirements for a private subnet \{#requirements}

* The subnet must contain a cloud router with internet access;
* The cloud router IP address must be the default gateway in the subnet.

If the subnet does not meet the requirements, [prepare it for connecting a public IP address](#configure-subnet).

## Prepare a private subnet for connecting a public IP address \{#configure-subnet}

1. [Create a cloud router with internet access](#create-cloud-router).
2. [Connect the private network to the cloud router](#connect-private-network-to-cloud-router).

### 1. Create a cloud router with internet access \{#create-cloud-router}

A cloud router allows routing traffic between private networks.

The router can be used to configure internet access from a private network or to access a device in a private subnet from the internet via a public IP address.

1. In the [Control panel](https://my.selectel.ru/vpc/default/routers/), on the top menu click **Products** and select **Cloud Servers**.
2. Go to the **Network** section → the **Cloud Routers \*\*\*\* tab**.
3. Click **Create Router**.
4. Select the [location](/infrastructure/locations.mdx) where the cloud router will be created.
5. Enter the router name.
6. Check the **Connect router to the internet** checkbox — an external IP address will be allocated for the router.
7. Click **Create**.

### 2. Connect a private network to a cloud router \{#connect-private-network-to-cloud-router}

1. In the [Control panel](https://my.selectel.ru/vpc/default/routers/), on the top menu click **Products** and select **Cloud Servers**.
2. Go to the **Network** section → the **Cloud Routers \*\*\*\* tab**.
3. Open the router details page.
4. Click **Add Subnet**.
5. Select a private subnet.
6. Optional: enter the router IP address. If you do not specify an IP address, it will be automatically selected from the available addresses in the subnet. The cloud router IP address must match the default gateway of the private subnet. The gateway can be viewed in the [Control panel](https://my.selectel.ru/vpc/default/networks/): in the top menu click **Products** → **Cloud Servers** → **Network** → tab **Private Networks** → network page → tab **Subnets** → subnet card → block **Automatic Network Settings** → field **Subnet Gateway**.
7. Click **Add Subnet**.

## Connect a public IP address \{#assign-public-ip-in-existing-cluster}

A public IP address is assigned to all nodes in the group simultaneously.

1. Ensure that the cluster is in a private subnet that meets the [requirements](#requirements).
2. In the [Control panel](https://my.selectel.ru/vpc/default/dbaas/), on the top menu click **Products** and select **Managed Databases**.
3. Open the **Active \*\*\*\* tab**.
4. Open the database cluster page → tab **Settings**.
5. In the **Cluster** block, open the node group card.
6. Enable the **Public access \*\*\*\* toggle**.

## Disable a public IP address \{#detach-public-ip}

The public IP address is disabled for all nodes in the group simultaneously.

1. In the [Control panel](https://my.selectel.ru/vpc/default/dbaas/), on the top menu click **Products** and select **Managed Databases**.
2. Open the **Active \*\*\*\* tab**.
3. Open the database cluster page → tab **Settings**.
4. In the **Cluster** block, open the node group card.
5. Disable the **Public access \*\*\*\* toggle**.

<Formbricks />
