Skip to Content
Open Beta — managed Kubernetes, DNS & more are live.
🔀

Routers

Updated 2026-11-20
On this page

Routers

Routers connect your private networks to each other and to the internet. Attach a router to a subnet to give its instances outbound access and reachable addresses.

A router is the hinge of your topology. Give it an external gateway and it becomes the door to the internet; add an interface on a subnet and every instance there can route outbound through it. The same router can carry interfaces on several subnets so they route between each other.

Routers are also where floating IPs become useful: inbound traffic to a floating IP is delivered through the router's external gateway to the instance behind it. Static routes let you steer specific destinations toward another next hop when the default path is not what you want.

Screenshot — A router's detail page showing its external gateway, subnet interfaces and static routes
A router's detail page showing its external gateway, subnet interfaces and static routes

Key concepts

External gateway — The router's connection to an external (public) network, enabling outbound internet and floating IPs.

Interface — A connection from the router into one of your subnets so that subnet can be routed.

Static route — A manual rule sending traffic for a given destination CIDR to a specific next hop.

SNAT — Source address translation the gateway applies so private instances can reach the internet outbound.

Before you start

  • At least one network and subnet to route.
  • An external network available as a gateway (listed under external gateways).

Step by step

  1. Open Routers

    Go to Networking and open Routers.

    Screenshot — The Routers list with the Create router button
    The Routers list with the Create router button
  2. Create the router

    Create a router and set its external gateway to an available external network so it can reach the internet.

    Screenshot — The Create router form with the external gateway selector
    The Create router form with the external gateway selector
  3. Add subnet interfaces

    Add an interface on each subnet that needs routing. Instances on those subnets then get outbound access.

    Screenshot — The add-interface dialog listing subnets
    The add-interface dialog listing subnets
  4. Add static routes (optional)

    If some traffic must take a non-default path, add a static route with a destination CIDR and a next-hop address.

  5. Assign floating IPs

    For inbound access, allocate a floating IP and associate it with an instance behind this router. See Floating IPs.

Examples

Create a router with a gateway and interface
patrii router create --name edge-router \
  --external-network public --subnet app-tier-a
# attach another subnet later
patrii router attach <router-id> --subnet <subnet-id>
Add a static route
patrii router add-route <router-id> \
  --destination 192.168.50.0/24 --nexthop 10.10.0.5
Router, interface and static route with Terraform
data "patrii_network" "public" {
  name = "public"
}

resource "patrii_router" "edge" {
  name                = "edge-router"
  external_network_id = data.patrii_network.public.id
}

resource "patrii_router_interface" "app" {
  router_id = patrii_router.edge.id
  subnet_id = patrii_subnet.app.id
}

resource "patrii_router_static_route" "branch" {
  router_id   = patrii_router.edge.id
  destination = "192.168.50.0/24"
  nexthop     = "10.10.0.5"
}

Limits & specifications

What a router lets you do:

ActionEffect
Set external gatewayConnects the router to an external network for outbound internet and floating IPs.
Add interfaceRoutes a subnet through the router.
Add static routeSends a destination CIDR to a chosen next hop.
Remove external gatewayCuts the router off from the external network.

Best practices

  • Give a router an external gateway only when a subnet behind it truly needs internet access.
  • Keep purely internal subnets off any router that has an external gateway.
  • Document static routes; a forgotten route is a common cause of traffic taking a surprising path.
  • Remove router interfaces before deleting a router, or the delete will be blocked while interfaces remain.

FAQ

Why can't I delete my router?
Routers with interfaces or a floating IP still associated cannot be deleted. Remove the interfaces and disassociate floating IPs first, then delete the router.
Do I need one router per network?
No. A single router can carry interfaces on several subnets and route between them, which also gives them shared outbound access through one gateway.
My instances have outbound internet but can't be reached inbound. Why?
The external gateway provides outbound SNAT. For inbound connections you also need a floating IP associated with the instance.

Learn more

Everything you can do here in the console is also available through the Patrii Cloud API for automation and scripting.

Was this article helpful?
Thank you for your feedback. Still stuck? Contact us