Public IP address
Public IP address
A public IP address is a static public IP address that is assigned to a node to set up access to the node on the private network from the Internet. External traffic goes through the public IP address and is handled by the cloud router, which acts as a 1:1 NAT. The address is a floating IP because it can automatically switch when the role changes from replica to master and back again. It will not change or be removed from the panel.
The private subnet on which a public IP address can be assigned must correspond to the following demands — before adding a public IP address subnet.
A public IP address can be added:
at cluster creation on an existing private subnet;
or in existing clusterwhich is on a private subnet.
The number of public IP addresses in the cluster can be less than the number of nodes in the group, but cannot exceed it. If necessary, you can disable public IP address.
Private subnet requirements
- The subnet should have a cloud router with a connection to the external network;
- The IP address of the cloud router should be the default gateway on the subnet.
If the subnet does not meet the requirements, prepare it to connect a public IP address.
Prepare a private subnet to connect a public IP address
- Create a cloud router with a connection to an external network.
- Connect the private network to the cloud router.
Create a cloud router with a connection to an external network
A cloud router allows you to route traffic between private networks.
You can use the router to configure access to the Internet from a private network or to access a device on a private subnet from the Internet using a public IP address.
- In control panel go to Cloud platform → Network.
- Open the tab Cloud routers → click Create a router.
- Select pool of the router.
- Enter a name.
- Check the box Connect the router to an external network — an external IP address will be assigned to the router.
- Click Create.
Connect a private network to the cloud router
- Open the router card → tap Add a subnet.
- Select a private subnet.
- Specify the IP address of the router. The cloud router IP address value that is specified by default is the default gateway on the subnet. If you are connecting a global router network, specify a router IP address other than the global router IP address, the IP addresses of the cloud servers on the network, and the service addresses
.253
and.254
. - Click Add a subnet.
Connect a public IP address
- Make sure that the cluster is on a private subnet that matches the demands.
- In control panel go to Cloud platform → Databases.
- Open the Database Cluster page → tab Settings.
- In the block Node addresses and statuses in the line with the desired node, click Connect public IP.
- Click Connect.
Disable public IP address
- In control panels go to Cloud platform → Databases.
- Open the Database Cluster page → tab Settings.
- In the block Node addresses and statuses in the line with the desired node, click .
- Click Delete.