A router connects your private subnets to each other. With a gateway, it also connects them to a public network, so your servers can reach the internet and take floating IPs. A gateway is the router’s link to a public network, with a public address of its own.
You often don’t need to create a router yourself. When you first connect a network to a public network, Lighthouse makes the project’s Default Router for you. See Create a network. Create your own router when you want to route subnets separately.
Before you start
- You need the View Networking permission to see routers. Creating and changing them is open to the account owner, and to members the owner allows to manage networks.
- A project can have up to 3 routers, and the Default Router counts.
- A gateway takes one public IPv4 address from your allowance.
Create a router
- In the side menu, open Infrastructure, then select Routers under Networking.
- Select Create Router.
- In Name, type a name of up to 64 characters, for example
edge-router. - In Public Network, choose the public network for the gateway, or None (Private Only). Without one, the router only connects your private subnets.
- Read the line under the form. It says how many routers the project has, and how many public addresses you have left.
- Select Create Router.
You see Router Created. If the router takes a moment to set up, you see The router is still being set up. It appears here when it’s ready.
Read the list
Each row shows the router’s Name, Status, Public Network, Interfaces and Static Routes, with its ID. A router with no gateway shows No Gateway. The project’s own router carries a Default badge.
Select the arrow at the start of a row to show its interfaces and routes:
- Interfaces lists each Subnet the router routes, with its CIDR and Router Address. The router address is the subnet’s gateway address.
- Static Routes lists each Destination and its Next Hop.
Route a subnet through the router
- In the router’s row menu, select Add Interface.
- Choose a subnet. A subnet that can’t be added says why, for example Already on this router, On router edge-router or No gateway address.
- Confirm. You see Interface Added.
Only a subnet of a network made in Lighthouse, with a gateway address, and on no other router, can be added. To take a subnet off, select Remove Interface on its row. Servers on it lose the routes this router gives them.
Set, change or clear the gateway
- Set Gateway connects the router to a public network. Its subnets can then reach the internet and take floating IPs.
- Change Gateway moves the gateway to another public network. The router’s public address changes. A move is refused while a floating IP or reserved address uses this router.
- Clear Gateway takes the router off the public network. Servers on its subnets lose their route to the internet, and the address goes back to the pool.
You see Gateway Set or Gateway Cleared when it’s done.
Add static routes
A static route sends traffic for a range of addresses through a next hop, such as another server that acts as a gateway.
- In the router’s row menu, select Edit Static Routes.
- For each route, type a Destination, an IPv4 range written as its network address, and a Next Hop, an address inside one of the router’s subnets.
- Select Add Route for another row. A router takes at most 20 static routes.
- Select Save Routes. The whole list is saved at once, and you see Static Routes Saved.
The router needs an IPv4 interface first: a next hop must sit on a subnet the router is attached to.
Manage the router
Select a router’s name to open its page. There you read its overview, gateway, interfaces, static routes, floating IPs and servers, turn the router or its SNAT off or on, and rename or delete it. See Manage a router.
If something goes wrong
- This project already has its maximum of 3 routers (the Default Router counts). Delete one first.
- Another router already routes that subnet. Remove it there first. Remove the interface from the other router, then add it here.
- A floating IP or reserved address still reaches the internet through this router. Release or move it first. See Assign a floating IP.
- This router wasn’t created here, so it can’t be changed here. It carries a Read Only badge.
- We lost track of this router’s creation. Refresh: if it isn’t listed, create it again.
Fields and statuses
What each item on this page means, what it does and how to read it.
- Name Field
-
What it is. The router’s name, for example edge-router.
How to read it. Up to 64 characters.
- Public Network Field
-
What it is. The public network the router’s gateway connects to.
What it does. A gateway lets its subnets reach the internet and take floating IPs. It takes one public IPv4 address from your allowance.
- None (Private Only) Option
-
What it is. The router has no gateway.
What it does. It only connects your private subnets to each other.
- Interfaces Column
-
What it is. The subnets the router routes.
How to read it. Each shows its CIDR and Router Address.
- Static Routes Column
-
What it is. Routes that send a range of addresses through a next hop.
How to read it. At most 20 per router.
- No Gateway Status
-
What it is. The router isn’t connected to a public network.
What it does. Its subnets can’t reach the internet through it.
How to read it. Select Set Gateway to connect it.
- Default Status
-
What it is. The project’s own router, made when you first connect a network to a public network.
How to read it. It counts toward the limit of 3 routers.
- CIDR Column
-
What it is. The range of the subnet on this interface.
- Router Address Column
-
What it is. The router’s address on the subnet.
What it does. It is the subnet’s gateway address.
- Destination Field
-
What it is. The IPv4 range the static route is for, written as its network address.
- Next Hop Field
-
What it is. The address the traffic is sent through, such as a server that acts as a gateway.
How to read it. It must sit inside one of the router’s subnets.
- Already on this router Status
-
What it is. The subnet is already routed by this router.
- No gateway address Status
-
What it is. The subnet has no gateway address, so a router can’t route it.
How to read it. Edit the subnet and give it a gateway.