-
Josef Němec authoredJosef Němec authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
create-router.md 3.39 KiB
title: Create router
search:
exclude: false
Create Router
Router Creation
=== "GUI"
Navigate yourself towards **Project > Network > Routers** in the left menu and click on the **Create Router** on the right side of the window.
!!! example

Enter router name and select external gateway with the `-GROUP` suffix.
!!! example

Now you need to attach your internal network to the router.
**1.** Click on the router you just created.
!!! example

**2.** Move to the **Interfaces** tab and click on the **Add interface**.
!!! example


**3.** Select a previously created subnet and submit.
!!! example

=== "CLI"
**1.** **Create router**
```
openstack router create project_router
```
The current router has no ports. We need to create at least 2 interfaces: external and internal).
**2.** **Set external network for the router (select one with `-GROUP`)**
```
openstack router set --external-gateway public-muni-147-251-255-GROUP project_router
```
**3.** **Assign router as a gateway for internal network**
```
openstack router add subnet project_subnet project_router
```
Additional router configuration is available in [official CLI documentation](https://docs.openstack.org/python-openstackclient/train/cli/command-objects/router.html).
Router external gateway assign
If you have no gateway on you router, you can assign a new one.
=== "GUI"
1. You can set your gateway by clicking **Set Gateway**.
!!! example

2. Choose the network you desire to use (e.g. **public-cesnet-78-128-251**) and confirm.
!!! example

=== "CLI"
**Set external network for the router (let us say public-muni-147-251-255-GROUP), and the external port will be created automatically**
```
openstack router set --external-gateway public-muni-147-251-255-GROUP my-router1
```
Additional router configuration is available in [official CLI documentation](https://docs.openstack.org/python-openstackclient/train/cli/command-objects/router.html).
Router external gateway release
=== "GUI"
Navigate to the **Project > Network > Routers**. Click on the action **Clear Gateway** of your router. This action will disassociate the external network from your router, so your machines will no longer be able to access the Internet. If you get an error you need to first **Disassociate Floating IPs**.
!!! example

=== "CLI"
**Release external gateway from router**
```
openstack router unset --external-gateway my-router1
```
Make sure to first [release FIPs](../how-to-guides/allocating-floating-ips.md#release-of-floating-ip) from the network.
Additional router configuration is available in [official CLI documentation](https://docs.openstack.org/python-openstackclient/train/cli/command-objects/router.html).