Skip to main content

Static Routes in Cloud Platform Networks

You can use static routing if there is a device in the cloud subnet that acts as a router. You can:

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

Examples of use cases

Internet access for a network connected to a global router

For example, a private Cloud Platform network is connected to a global router, and you need to:

  • configure internet access for cloud servers located in subnets of this private network;
  • configure internet access for a private Managed Kubernetes cluster subnet to deploy nodes;
  • use a public floating IP address for a cloud server or a load balancer in a private network;
  • use a cloud router as a gateway for internet access 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 a cloud server as a gateway and configure static routing. For example:

  • configure internet access from a subnet;
  • configure connectivity with external infrastructure via VPN.

Configure static routes in a subnet

The following can be used as the source subnet:

  • a private subnet;
  • public subnet — only via OpenStack CLI;
  • private networks and public subnets that have access configured in different projects (with the Cross-project tag) — only via OpenStack CLI.

You cannot set a metric (route weight or cost) for a static route, so it is impossible to configure two or more routes with the same source and destination subnets.

When configuring a static route in the Control panel, only a private subnet can be selected as the source subnet.

  1. In the Control panel, on the top menu, click Products and select Cloud Servers.
  2. Go to the Network section → Private 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 destination subnet CIDR — this is the subnet to which traffic will be directed.
  7. Enter the gateway (next-hop) — the IP address through which devices in the source subnet will direct 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 a 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> — the CIDR of the destination subnet to which traffic will be routed, for example 172.16.0.8/29;
    • <next_hop_ip_address> — the next-hop gateway (next-hop) — the IP address of the router through which traffic will be directed to the destination subnet. The subnet with the router must be connected to a cloud router. The router address must not match the cloud router IP address;
    • <router> — the cloud router ID or name; you can view it using the openstack router list.