Public floating IP addresses
Public floating IP addresses are static IP addresses that can be attached to devices in private networks to configure internet access to them: to a cloud server, load balancer, managed database cluster node.
The address is floating (Floating IP in the API) because it can be quickly switched between devices in private subnets. When switching, the address does not change and is not deleted.
To connect a public floating IP address, the device must be in a private subnet connected to a cloud router with internet access — learn more in the Prepare private subnet for public floating IP address section. The public floating IP address is associated with the private IP address of the device. Incoming traffic is processed by the cloud router — the router performs 1:1 NAT via the external IP address allocated when connecting the router to the internet. Incoming traffic can be filtered using a cloud firewall or a security group.
When created, a public floating IP address is automatically allocated from the address pool; it cannot be selected manually.
A public floating IP address can only be used within one project and one pool.
For public floating IP addresses, there are traffic volume limits — bandwidth. You can check it in the Bandwidth table.
You can work with public floating IP addresses in the control panel, using the OpenStack CLI, or Terraform.
Create a public floating IP address
If you create the first public floating IP address in a project and pool, the private network nat and cloud router router-nat will be created automatically.
Control panel
OpenStack CLI
- In the control panel, in the top menu, click Products and select Cloud Servers.
- Go to Network → Public Floating IPs tab.
- Click Create IP address.
- Select the location where the public floating IP address will be created.
- Specify the number of public floating IP addresses.
- Click Create.
Prepare a private subnet for connecting a public floating IP address
To configure access to and from the internet via a public floating IP address, you must connect it to a device.
The device must be in a private subnet that meets the following requirements:
- the subnet must be connected to a cloud router that is connected to the internet. If the cloud router is connected to the internet, it performs 1:1 NAT for access from the private network to the internet via the router's external address and for access to the device in the private subnet from the internet via the public floating IP address;
- the private IP address of the cloud router must match the default gateway in the subnet.
If the subnet does not meet the requirements, prepare it for connecting a public floating IP address:
1. Create a cloud router with an internet connection
Control panel
OpenStack CLI
- In the control panel, in the top menu, click Products and select Cloud Servers.
- Go to Network → Cloud Routers tab.
- Click Create router.
- Select the location where the cloud router will be created.
- Select the router type.
- Enter a router name.
- Select the Connect router to the internet checkbox — an external IP address will be allocated for the router.
- Click Create.
2. Connect the subnet to the cloud router
Control panel
OpenStack CLI
-
In the control panel, in the top menu, click Products and select Cloud Servers.
-
Go to the Network section → the Cloud Routers tab.
-
Open the router page.
-
Click Connect Subnet.
-
Select a private subnet.
-
Optional: enter the router IP address — any available IP address from the subnet. If you do not specify an IP address, it will be automatically selected from the available subnet addresses.
For devices in the subnet to access the internet without configuring additional routes, the cloud router's IP address must match the private subnet gateway. If the subnet gateway is already occupied, you will need to configure a static route via the cloud router in the subnet to access the internet.
You can view the subnet gateway in the control panel: in the top menu, click Products → Cloud Servers → Network → the Private Networks tab → the network page → the Subnets tab → the subnet card → the Automatic Network Settings section → the Subnet Gateway field.
-
Click Connect.
Connect a public floating IP address to a cloud server
A public floating IP address can be connected when creating a cloud server or to an existing server.
Control panel
OpenStack CLI
- Make sure that the cloud server is in a subnet that meets the requirements; for more information, see the Prepare private subnet for public floating IP address section. You can view the server's subnets in the control panel: in the top menu, click Products → Cloud Servers → server page → Ports tab.
- In the control panel, in the top menu, click Products and select Cloud Servers.
- Go to the Network section → Public floating IP addresses tab.
- On the public floating IP address card, click .
- Select the cloud server private IP address.
- Click Save.
Disconnect a public floating IP address from a cloud server
Control panel
OpenStack CLI
- In the control panel, in the top menu, click Products and select Cloud Servers.
- Go to the Network section → Public Floating IPs tab.
- On the public floating IP address card, click .
- In the New private address for traffic NAT field, select Disconnect from current.
- Click Save.
Connect a public floating IP address to a load balancer
A public floating IP address can be connected when creating a load balancer or to an existing load balancer.
Control panel
OpenStack CLI
- Make sure that the load balancer is in a subnet that meets the requirements; for more information, see the Prepare private subnet for public floating IP address section. You can view the load balancer subnets in the control panel: in the top menu, click Products → Cloud Servers → Load Balancers → Load Balancers tab → load balancer page → Settings block → Network field.
- In the control panel, in the top menu, click Products and select Cloud Servers.
- Go to the Network section.
- Open the Public floating IP addresses tab.
- On the public floating IP address card, click .
- Select the load balancer private IP address.
- Click Save.
Disconnect a public floating IP address from a load balancer
Control panel
OpenStack CLI
- In the control panel, in the top menu, click Products and select Cloud Servers.
- Go to the Network section → Public Floating IPs tab.
- On the public floating IP address card, click .
- In the New private address for traffic NAT field, select Disconnect from current.
- Click Save.
Connect a public floating IP address to a cloud database cluster node
Connecting public floating IP addresses is not supported for all DBMSs. The availability and connection process are described in the documentation of the corresponding DBMS in the Managed Databases section.
Disconnect a public floating IP address from a cloud database cluster node
- In the control panel, in the top menu, click Products and select Cloud Databases.
- Open the Active tab.
- Open the database cluster page → Settings tab.
- In the Node addresses and statuses section, in the node row, click .
- Click Delete.
Switch a public floating IP address between devices
Control panel
OpenStack CLI
- In the control panel, in the top menu, click Products and select Cloud Servers.
- Go to the Network section → Public floating IP addresses tab.
- On the public floating IP address card, click .
- Select a new private IP address for NAT.
- Click Save.
Configure NAT
To configure NAT, you need to configure port forwarding — set up traffic redirection from one port to another. For example, you can configure port forwarding from a public floating IP address to any port in a private subnet — in this case, access to the private port is organized without creating an additional public floating IP address.
Before configuring port forwarding, the public floating IP address must not be associated with a cloud server, load balancer, or other devices.
In Selectel, by default, certain TCP/UDP ports are blocked, and traffic through them is blocked.
OpenStack CLI
-
Configure port forwarding:
openstack floating ip port forwarding create \--internal-ip-address <internal_ip_address> \--port <port> \--internal-protocol-port <internal_protocol> \--external-protocol-port <external_protocol> \--protocol <protocol> \<floating_ip_address>Specify:
<internal_ip_address>— IP address of the port in the private subnet to which forwarding will be performed;<port>— ID or name of the port in the private network to which forwarding will be performed, can be viewed using the commandopenstack port list;<internal_protocol>— protocol of the port in the private subnet;<external_protocol>— protocol of the public floating IP address port being forwarded;<protocol>— protocol:tcporudp;<floating_ip_address>— ID or public floating IP address whose port is being forwarded. Can be viewed using the commandopenstack floating ip list.
Example command:
openstack floating ip port forwarding create \--internal-ip-address 192.168.0.2 \--port ed010217-9f78-4002-8703-2112da3fef1f \--internal-protocol-port 80 \--external-protocol-port 80 \--protocol tcp \192.0.2.7
Delete a public floating IP address
After deletion, the public floating IP address will be returned to the public floating IP pool.
Control panel
OpenStack CLI
- In the control panel, in the top menu, click Products and select Cloud Servers.
- Go to the Network section → Public floating IP addresses tab.
- On the public floating IP address card, click .
- Enter the IP address to confirm deletion.
- Click Delete.