command syntax1: openstack router <action/operation> <--flags values> <router-name>

command syntax2: openstack router <action/operation> subnet <router-name> <subnet-name>

#to check the list of routers

cumulus@server01:~$ openstack router list

#let's create a new router

cumulus@server01:~$ openstack router create --project firstProject firstRouter
+-------------------------+--------------------------------------+
| Field | Value |
+-------------------------+--------------------------------------+
| admin_state_up | UP |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2018-07-10T12:10:14Z |
| description | |
| distributed | False |
| external_gateway_info | None |
| flavor_id | None |
| ha | False |
| id | 8b2c9007-5c60-44d5-a4cd-29a0e07df3b1 |
| name | firstRouter |
| project_id | e79e5fbcf2be47aa9c1d3600ddfd7a81 |
| revision_number | None |
| routes | |
| status | ACTIVE |
| tags | |
| updated_at | 2018-07-10T12:10:14Z |
+-------------------------+--------------------------------------+
cumulus@server01:~$

#let's add subnets to the router

cumulus@server01:~$ openstack router add subnet firstRouter firstSubnet
cumulus@server01:~$ openstack router add subnet firstRouter firstProviderSubnet
cumulus@server01:~$

#a provider network can also be added to the router by specifying the --external-gateway value

#to check the router list again

cumulus@server01:~$ openstack router list --long
+--------------------------------------+-------------+--------+-------+-------------+-------+----------------------------------+--------+-----------------------+--------------------+------+
| ID | Name | Status | State | Distributed | HA | Project| Routes | External gateway info | Availability zones | Tags |
+--------------------------------------+-------------+--------+-------+-------------+-------+----------------------------------+--------+-----------------------+--------------------+------+
| 8b2c9007-5c60-44d5-a4cd-29a0e07df3b1 | firstRouter | ACTIVE | UP | False | False | e79e5fbcf
2be47aa9c1d3600ddfd7a81 | | None | nova | |
+--------------------------------------+-------------+--------+-------+-------------+-------+----------------------------------+--------+-----------------------+--------------------+------+

--end-of-post--