Skip to main content
Static routes in cloud platform networks
Last update:

Static routes in cloud platform networks

Static routing can be used if there is a device on the cloud subnet that acts as a router. You can:

To configure static routes on a global router, use the instructions to Configure Routing on a Global Router.

Examples of tasks to be solved

Internet access for a network connected to a global router

For example, a cloud platform's private network is connected to a global router, and you need to:

  • configure Internet access for cloud servers that are located in subnets of this private network;
  • Configure Internet access for the Managed Kubernetes cluster private subnet to deploy nodes;
  • Use a public IP address for a cloud server or for a load balancer on a private network;
  • Use the cloud router as a gateway to access the internet for servers or hosts from other pools and services.

Sending traffic through a cloud server (proxy)

If you need to send traffic to other subnets, you can use the cloud server as a gateway and configure static routing. For example:

  • configure access to the Internet from a subnet;
  • configure connectivity to the external infrastructure via VPN.

Configure static routes in a subnetwork

You can use as the source subnet:

  • a private subnet;
  • subnet of the global router;
  • public subnet — only through the OpenStack CLI;
  • private networks and public subnets to which access is configured in different projects (with the CrossProject tag) — only via OpenStack CLI.

You cannot set a metric (route weight or cost) for a static route, so you cannot configure two or more routes with the same source subnet and destination subnet.

When configuring a static route in the control panel, you can select a private subnet or a global router subnet as the source subnet.

  1. In the dashboard, on the top menu, click Products and select Cloud Servers.
  2. Go to NetworkPrivate Networks tab.
  3. Open the Private Network page → Subnets tab.
  4. In the subnet card, open the Automatic Network Settings block.
  5. Click Add Route.
  6. Enter the CIDR of the destination subnet, which is the subnet to which traffic will be routed.
  7. Enter the gateway (next-hop) — the IP address through which devices on the source subnet will route traffic to the destination subnet. You can enter any address from the source subnet.
  8. Click .
  9. Apply the changes. To do this, update the network settings on the devices in the subnet.

Configure static routes on the cloud router

  1. Open the OpenStack CLI.

  2. Configure a static route:

    openstack router add route \
    --route destination=<destination_subnet_cidr>,gateway=<next_hop_ip_address> \
    <router>

    Specify:

    • <destination_subnet_cidr> — CIDR of the destination subnet to which traffic will be routed, e.g. 172.16.0.8/29;
    • <next_hop_ip_address> — gateway (next-hop) — the IP address that is specified on the cloud router, e.g. 172.16.0.1. You can view it with the command openstack router show <router> The value of ip_address in the interfaces_info;
    • <router> — The ID or name of the cloud router can be viewed with the command openstack router list.