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

import ConfigureSubnetForInternetAccess from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/managed-databases/common/configure-subnet-for-internet-access.mdx';
import EditIcon from '@selectel/docux/icons/edit';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import {TabItemLabel} from '@selectel/docux/components';
import Formbricks from '@theme/MDXComponents/Formbricks';

# Public IP address in an OpenSearch cluster

Public IP addresses are static IP addresses that can be attached to cluster nodes in a private network to configure access to them from the internet. Addresses are attached to all nodes in the group simultaneously, with a dedicated public IP address for each node. 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.

To connect a public IP address, a [cloud router](/cloud-servers/cloud-networks/cloud-routers.mdx) with internet access is used. The public IP address is associated with the private IP address of the cluster node. Incoming traffic is processed by the cloud router — the router performs 1:1 NAT via an external IP address allocated when connecting the router to the internet. Incoming traffic can be filtered using a [cloud firewall](/cloud-servers/firewalls/) or [security group](/cloud-servers/security-groups/).

You can attach a public IP address:

* when [creating a cluster](/managed-databases/opensearch/create-cluster.mdx) in an existing private subnet, if the subnet meets the [requirements](#requirements). If the subnet does not meet the requirements, [prepare it for connecting a public IP address](#configure-subnet-for-internet-access) before creating the cluster or [connect the public IP address](#connect-public-ip-in-existing-cluster) after creating the cluster;

* or in an [existing cluster](#connect-public-ip-in-existing-cluster), even if the private subnet does not meet the [requirements](#requirements).

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

## Private subnet requirements for attaching a public IP address \{#requirements}

* the subnet must have a cloud router connected to the internet;
* The IP address of the cloud router must be the default gateway in the cluster subnet.

If the router is already connected to the cluster subnet, but its IP address does not match the gateway, you will not be able to connect a public IP address. In this case, [disconnect the subnet from the cloud router](/cloud-servers/cloud-networks/cloud-routers.mdx#disconnect-private-subnet-from-cloud-router), and then [connect](#connect-private-subnet-to-cloud-router) it again and specify the subnet gateway address.

## Prepare a private subnet for attaching a public IP address \{#configure-subnet-for-internet-access}

<ConfigureSubnetForInternetAccess />

## Attach a public IP address \{#connect-public-ip-in-existing-cluster}

1. In the [control panel](https://my.selectel.ru/vpc/default/dbaas/), in the top menu, click **Products** and select **Managed Databases**.
2. Open the **Active** tab.
3. Open the database cluster page → **Settings** tab.
4. In the node group card, in the **Public access** line, click <EditIcon />.
5. If the cluster subnet meets the [requirements](#requirements), click **Connect**.
6. If the cluster subnet does not meet the [requirements](#requirements):

   6.1. Select an existing cloud router or create a new one. The cluster subnet will be connected to the router. If you select an existing router without internet access or a new router, it will be automatically connected to the internet.

   6.2. Click **Connect router and address**.

Public IP addresses will be attached to all nodes in the node group simultaneously, with a dedicated public IP address for each node.

## Detach a public IP address \{#disconnect-public-ip}

1. In the [control panel](https://my.selectel.ru/vpc/default/dbaas/), in the top menu, click **Products** and select **Managed Databases**.
2. Open the **Active** tab.
3. Open the database cluster page → **Settings** tab.
4. In the node group card, in the **Public access** line, click <EditIcon />.
5. Click **Disconnect**. Public IP addresses will be disconnected from all nodes in the node group simultaneously.

<Formbricks />
