On this page
External gateways
An external gateway is your router's connection to the public IPv4 network. It is what makes outbound internet access and floating IPs possible, and it is a chargeable resource.
A router with no external gateway has no presence on the public network at all. Instances behind it can talk to each other and to other subnets on the same router, but they cannot reach the IPv4 internet outbound, and no floating IP can be associated with them.
Attaching a gateway unlocks both directions at once. Outbound, every instance behind the router shares the router's public address through SNAT, which is what lets them fetch updates and call external APIs. Inbound, the router can now translate a floating IP to an instance's fixed address.
Key concepts
External gateway — The router's attachment to the public network. One per router.
SNAT — Outbound translation: instances behind the router share its public address when they reach the internet.
External network — The provider network that carries internet-routable addresses. You attach to it, you do not create it.
Chargeable resource — A resource that appears on a quota request and is billed while it exists, rather than one that comes free with the project.
Before you start
- A router serving the subnet whose instances need internet access.
- Available external gateway allocation in the project.
Step by step
- Open the router
Go to Networking > Routers and open the router that serves your subnet.
Screenshot — The router listThe router list - Attach the gateway
Set the external gateway on the router, choosing the public network.
Screenshot — The set-gateway dialog with the external network selectedThe set-gateway dialog with the external network selected - Confirm outbound access
- Connect to an instance behind the router.
- Reach an external address to confirm SNAT is working.
- Add floating IPs as needed
With the gateway in place, floating IPs can now be associated with instances behind this router.
- Detach when it is no longer needed
Removing the gateway stops the charge, and also stops all outbound internet access and breaks every floating IP behind that router.
Examples
patrii router set-gateway prod-router --network public
patrii router list patrii router show <router-id>
Limits & specifications
What the gateway does and does not cover:
| Capability | Needs a gateway? |
|---|---|
| Instances talking to each other on the same router | No |
Outbound access to the internet (SNAT) | Yes |
| Associating a floating IP | Yes |
| A second gateway on the same router | Not supported. One per router. |
Best practices
- Put the instances that need internet access behind one router and share a single gateway, rather than giving each its own router.
- Attach a gateway only when a subnet behind the router genuinely needs internet access.
- Detach the gateway when a project is idle: it is billed while it exists, not while it is used.
- Check for an existing gateway before adding a router, since a floating IP that will not associate is usually a missing gateway.
FAQ
Why is the external gateway charged rather than included?
Do I pay per instance?
My floating IP will not associate. What is wrong?
Learn more
Everything you can do here in the console is also available through the Patrii Cloud API for automation and scripting.