Create a router and connect networks to it
Create a router when the virtual machines (VMs) of one network need to exchange traffic with another network, for example when the VMs of an Isolated network need access to an external network. Connect all the networks you need right away: later, you can add a port only to a stopped router.
Before you begin
-
You need the VDC admin role in this virtual data center (VDC), or the Cluster master role.
-
The networks that the router will connect are assigned to the VDC — Assign a network to a VDC.
-
The IP pool of each network has a free address for the router port — Exclude an address from an IP pool and view used addresses.
-
You have decided which address the router port gets in each network. For the VMs of an Isolated network to access the external network through the router, assign the router port in this network the gateway address — it is shown in the Gateway (v4) field of the network panel (Provider Data Center → All Networks → the network row). The VMs of the network get this address as the default gateway, so their outbound traffic goes through the router. A port can take the gateway address in Isolated, GENEVE and Q-in-Q networks, and only if you enter it manually: Center itself never assigns the gateway address.
1. Open the router creation window
- In the left menu, select Virtual Data Centers → the VDC → Edges.
- Click Create an Edge above the Edges table. The Create an Edge window opens. This VDC is already selected in the VDC field.
2. Connect networks and create the router
- In the Create an Edge window, select a network in the Name field of the Network 1 block. The network subnet appears under the field: "CIDR: …". The list contains the networks of the selected VDC.
- Enter the port address in the IP field, without a mask, for example
192.0.2.1. An empty field means that Center assigns a free address from the pool, but not the gateway address. - Click Add network. The Network 2 block appears with the same fields.
- Select the second network in the Name field and, if needed, set IP, for example
203.0.113.10. You can connect up to four networks in total. - Click Create an Edge. The button is available when all blocks are filled in correctly. While Center creates the router, the web interface shows Edge is creating....
Check the result
When the router is created, the web interface shows the notification Edge successfully created and opens the router page. The router has no name: its UUID is shown instead. The Networks section of the router page lists the connected networks, the slots and the port addresses in the IP column. The router appears in the Edges table of the VDC.
Right after creation, Center starts the router automatically: the Status field on the router page shows Starting, then Started. You can apply rules when the Apply rules button becomes available.
If the router could not be created, the web interface shows a notification with the error. Common causes: the IP pool of the network has no free addresses, or the specified address is already in use.
More
- Slot — the router port number, from 1 to 4. The default is the first free one.
- MBps limit — the port speed limit; an empty field means no limit.
- IP guard — protection against address spoofing on the port, enabled by default. When you create a router, you can disable it only on a port in an Isolated network.
- To create a router without a VDC, select Provider Data Center → All Edges, click Create an Edge above the table and leave Vdc not selected in the VDC field. Such a router is visible only in All Edges.
- To connect a network to an existing router, stop the router, click Add network in the header of the Networks section on the router page, fill in the block and click Save network. To remove a network, click the trash icon in the port row; this also works only on a stopped router. How to stop a router — Start and stop a router and apply rules.
Next
- Configure NAT rules
- Configure firewall rules
- Routers — how a router works and when rules take effect.
API methods: edge-create, edge-add-nic, edge-remove-nic — in the API reference.