Configure access to and from the Internet
For the cloud server, cloud load balancer, and Managed Database cluster, you can configure access to and from the Internet:
- via a public IP address. To filter incoming traffic, you can use a cloud firewall and security groups;
- via a public subnet. To filter incoming traffic, you can use security groups.
If an Internet-only access is needed for a device without access from the Internet, it can be configured via a cloud router.
Configure access to and from the Internet via a public IP address
To configure access to and from the Internet for devices in a private subnet, you need to connect the subnet to a cloud router with Internet access and connect a public IP address to the device. The cloud router provides 1:1 NAT via an external IP address, which is allocated when the router is connected to the Internet: it organizes Internet access from the private subnet and handles incoming traffic packets for public IP addresses.
You can connect a public IP address when creating a cloud server, creating a cloud load balancer, creating a Managed Database cluster (example for PostgreSQL), and after creation.
The device must be located in a private subnet or a global router subnet that meets the requirements. To prepare the subnet, refer to the guide Prepare a private subnet for connecting a public IP address.
- Create a public IP address.
- Create a cloud router with Internet access.
- Connect the private subnet to the cloud router.
- Connect a public IP address to the device port in the private subnet.
- If the subnet gateway does not match the cloud router IP address, configure a static route to the Internet in the subnet.
1. Create a public IP address
Control panel
OpenStack CLI
- In the Control panel, on the top menu, click Products and select Cloud Servers.
- Go to the Network section → Public IP addresses tab.
- Click Create IP address.
- Select the location where the public IP address will be created.
- Specify the number of public IP addresses — 1.
- Click Create.
2. Create a cloud router with Internet access
Control panel
OpenStack CLI
- In the Control panel, on the top menu, click Products and select Cloud Servers.
- Go to the Network section → Cloud Routers tab.
- Click Create Router.
- Select the location where the cloud router will be created.
- Enter the router name.
- Select the Connect router to the internet checkbox — an external IP address will be assigned to the router.
- Click Create.
3. Connect the subnet to the cloud router
Control panel
OpenStack CLI
-
In the Control panel, on the top menu, click Products and select Cloud Servers.
-
Go to the Network section → Cloud Routers tab.
-
Open the router page.
-
Click Connect subnet.
-
Select a private subnet or a global router subnet.
-
Optional: enter the router IP address—any available IP address from the subnet. If you do not specify an IP address, one will be automatically selected from the available addresses in the subnet.
For devices in the subnet to access the internet without additional routes, the cloud router IP address must match the private subnet gateway. If the subnet gateway is already in use, you will need to configure a static route to the internet in the subnet via the cloud router.
You can view the subnet gateway in the control panel: 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.
-
Click Connect.
4. Connect a public IP address to the device port in the private subnet
Control panel
OpenStack CLI
- In the Control panel, on the top menu, click Products and select Cloud Servers.
- Go to the Network section → Private networks tab.
- Open the network page → Ports tab.
- In the cloud server or load balancer port card, click Connect public IP.
- Select a public IP address.
- Click Connect.
5. Configure a static route to the Internet in the subnet
If you specified a router IP address different from the subnet gateway when connecting the subnet to the cloud router, you must configure a static route in the subnet to the Internet via the cloud router. Specify the following when configuring:
- destination subnet —
0.0.0.0/0; - gateway (next-hop) — the IP address of the cloud router.
Configure access to and from the Internet via a public subnet
To configure access to and from the Internet via a public subnet, you must connect the device to the public subnet. For a load balancer and Managed Database cluster, this can only be done when creating the load balancer and creating the cluster (example for PostgreSQL). A cloud server can be connected to the public subnet either when creating the server or after it is created — to do this, you need to add the cloud server to the public subnet via a port.
1. Create a public subnet
Control panel
- In the Control panel, on the top menu click Products and select Cloud Servers.
- Go to the Network section → Public Networks tab.
- Click Create subnet.
- Select the location where the public subnet will be created.
- Select the subnet size — the range of IP addresses available in the subnet.
- Optional: to change DNS servers, click . Enter one to three values. Click .
- Click Create.
2. Add the cloud server to the public subnet via a port
Control panel
OpenStack CLI
- In the Control panel, on the top menu, click Products and select Cloud Servers.
- Open the server page → Ports tab.
- Click Add port.
- Select a public subnet.
- Enter the port IP address.
- Click Add port.
Configure Internet access via a cloud router
You can configure Internet access for devices in a private subnet without external access from the Internet.
To do this, you need to connect a cloud router with Internet access to the private subnet or the global router subnet where the device is located. If the cloud router is connected to the Internet, it functions as a 1:1 NAT for access from the private network to the Internet via the router's external IP address. The external address is only used for device-to-Internet access; you cannot connect to devices in the subnet using it.
- Create a cloud router with Internet access.
- Connect the private subnet to the cloud router.
- If the subnet gateway does not match the cloud router IP address, configure a static route to the Internet in the subnet.
1. Create a cloud router with Internet access
Control panel
OpenStack CLI
- In the Control panel, on the top menu, click Products and select Cloud Servers.
- Go to the Network section → Cloud Routers tab.
- Click Create Router.
- Select the location where the cloud router will be created.
- Enter the router name.
- Select the Connect router to the internet checkbox — an external IP address will be assigned to the router.
- Click Create.
2. Connect the subnet to the cloud router
Control panel
OpenStack CLI
-
In the Control panel, on the top menu, click Products and select Cloud Servers.
-
Go to the Network section → Cloud Routers tab.
-
Open the router page.
-
Click Connect subnet.
-
Select a private subnet or a global router subnet.
-
Optional: enter the router IP address—any available IP address from the subnet. If you do not specify an IP address, one will be automatically selected from the available addresses in the subnet.
For devices in the subnet to access the internet without additional routes, the cloud router IP address must match the private subnet gateway. If the subnet gateway is already in use, you will need to configure a static route to the internet in the subnet via the cloud router.
You can view the subnet gateway in the control panel: 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.
-
Click Connect.
3. Configure a static route to the Internet in the subnet
If you specified a router address different from the subnet gateway when connecting the subnet to the cloud router, you must configure a static route in the subnet to the Internet via the cloud router. Specify the following when configuring:
- destination subnet —
0.0.0.0/0; - gateway (next-hop) — the IP address of the cloud router.