Chapter 63. router


This chapter describes the commands under the router command.

63.1. router add port

Add a port to a router

Usage:

openstack router add port [-h] <router> <port>
Copy to Clipboard Toggle word wrap

Expand
Table 63.1. Positional arguments
ValueSummary

<router>

Router to which port will be added (name or id)

<port>

Port to be added (name or id)

Expand
Table 63.2. Command arguments
ValueSummary

-h, --help

Show this help message and exit

63.2. router add route

Add extra static routes to a router’s routing table.

Usage:

openstack router add route [-h] [-f {json,shell,table,value,yaml}]
                                  [-c COLUMN] [--noindent] [--prefix PREFIX]
                                  [--max-width <integer>] [--fit-width]
                                  [--print-empty]
                                  [--route destination=<subnet>,gateway=<ip-address>]
                                  <router>
Copy to Clipboard Toggle word wrap

Expand
Table 63.3. Positional arguments
ValueSummary

<router>

Router to which extra static routes will be added (name or ID).

Expand
Table 63.4. Command arguments
ValueSummary

-h, --help

Show this help message and exit

--route destination=<subnet>,gateway=<ip-address>

Add extra static route to the router. destination: destination subnet (in CIDR notation), gateway: nexthop IP address. Repeat option to add multiple routes. Trying to add a route that’s already present (exactly, including destination and nexthop) in the routing table is allowed and is considered a successful operation.

Expand
Table 63.5. Output formatter options
ValueSummary

-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated to show multiple columns

Expand
Table 63.6. JSON formatter options
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 63.7. Shell formatter options
ValueSummary

--prefix PREFIX

Add a prefix to all variable names

Expand
Table 63.8. Table formatter options
ValueSummary

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

--print-empty

Print empty table if there is no data to show.

63.3. router add subnet

Add a subnet to a router

Usage:

openstack router add subnet [-h] <router> <subnet>
Copy to Clipboard Toggle word wrap

Expand
Table 63.9. Positional arguments
ValueSummary

<router>

Router to which subnet will be added (name or id)

<subnet>

Subnet to be added (name or id)

Expand
Table 63.10. Command arguments
ValueSummary

-h, --help

Show this help message and exit

63.4. router create

Create a new router

Usage:

openstack router create [-h] [-f {json,shell,table,value,yaml}]
                               [-c COLUMN] [--noindent] [--prefix PREFIX]
                               [--max-width <integer>] [--fit-width]
                               [--print-empty]
                               [--extra-property type=<property_type>,name=<property_name>,value=<property_value>]
                               [--enable | --disable]
                               [--distributed | --centralized]
                               [--ha | --no-ha] [--description <description>]
                               [--project <project>]
                               [--project-domain <project-domain>]
                               [--availability-zone-hint <availability-zone>]
                               [--tag <tag> | --no-tag]
                               [--external-gateway <network>]
                               [--fixed-ip subnet=<subnet>,ip-address=<ip-address>]
                               [--enable-snat | --disable-snat]
                               [--enable-ndp-proxy | --disable-ndp-proxy]
                               [--flavor <flavor-id>]
                               <name>
Copy to Clipboard Toggle word wrap

Expand
Table 63.11. Positional arguments
ValueSummary

<name>

New router name

Expand
Table 63.12. Command arguments
ValueSummary

-h, --help

Show this help message and exit

--extra-property type=<property_type>,name=<property_name>,value=<property_value>

Additional parameters can be passed using this property. Default type of the extra property is string (str), but other types can be used as well. Available types are: dict, list, str, bool, int. In case of list type, value can be semicolon-separated list of values. For dict value is semicolon-separated list of the key:value pairs.

--enable

Enable router (default)

--disable

Disable router

--distributed

Create a distributed router

--centralized

Create a centralized router

--ha

Create a highly available router

--no-ha

Create a legacy router

--description <description>

Set router description

--project <project>

Owner’s project (name or id)

--project-domain <project-domain>

Domain the project belongs to (name or id). this can be used in case collisions between project names exist.

--availability-zone-hint <availability-zone>

Availability zone in which to create this router (Router Availability Zone extension required, repeat option to set multiple availability zones)

--tag <tag>

Tag to be added to the router (repeat option to set multiple tags)

--no-tag

No tags associated with the router

--external-gateway <network>

External network used as router’s gateway (name or id)

--fixed-ip subnet=<subnet>,ip-address=<ip-address>

Desired ip and/or subnet (name or id) on external gateway: subnet=<subnet>,ip-address=<ip-address> (repeat option to set multiple fixed IP addresses)

--enable-snat

Enable source nat on external gateway

--disable-snat

Disable source nat on external gateway

--enable-ndp-proxy

Enable ipv6 ndp proxy on external gateway

--disable-ndp-proxy

Disable ipv6 ndp proxy on external gateway

--flavor <flavor-id>

Associate the router to a flavor (by name or id

Expand
Table 63.13. Output formatter options
ValueSummary

-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated to show multiple columns

Expand
Table 63.14. JSON formatter options
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 63.15. Shell formatter options
ValueSummary

--prefix PREFIX

Add a prefix to all variable names

Expand
Table 63.16. Table formatter options
ValueSummary

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

--print-empty

Print empty table if there is no data to show.

63.5. router delete

Delete router(s)

Usage:

openstack router delete [-h] <router> [<router> ...]
Copy to Clipboard Toggle word wrap

Expand
Table 63.17. Positional arguments
ValueSummary

<router>

Router(s) to delete (name or id)

Expand
Table 63.18. Command arguments
ValueSummary

-h, --help

Show this help message and exit

63.6. router list

List routers

Usage:

openstack router list [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN]
                             [--quote {all,minimal,none,nonnumeric}]
                             [--noindent] [--max-width <integer>]
                             [--fit-width] [--print-empty]
                             [--sort-column SORT_COLUMN]
                             [--sort-ascending | --sort-descending]
                             [--name <name>] [--enable | --disable] [--long]
                             [--project <project>]
                             [--project-domain <project-domain>]
                             [--agent <agent-id>] [--tags <tag>[,<tag>,...]]
                             [--any-tags <tag>[,<tag>,...]]
                             [--not-tags <tag>[,<tag>,...]]
                             [--not-any-tags <tag>[,<tag>,...]]
Copy to Clipboard Toggle word wrap

Expand
Table 63.19. Command arguments
ValueSummary

-h, --help

Show this help message and exit

--name <name>

List routers according to their name

--enable

List enabled routers

--disable

List disabled routers

--long

List additional fields in output

--project <project>

List routers according to their project (name or id)

--project-domain <project-domain>

Domain the project belongs to (name or id). this can be used in case collisions between project names exist.

--agent <agent-id>

List routers hosted by an agent (id only)

--tags <tag>[,<tag>,…​]

List routers which have all given tag(s) (comma- separated list of tags)

--any-tags <tag>[,<tag>,…​]

List routers which have any given tag(s) (comma- separated list of tags)

--not-tags <tag>[,<tag>,…​]

Exclude routers which have all given tag(s) (comma- separated list of tags)

--not-any-tags <tag>[,<tag>,…​]

Exclude routers which have any given tag(s) (comma- separated list of tags)

Expand
Table 63.20. Output formatter options
ValueSummary

-f {csv,json,table,value,yaml}, --format {csv,json,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated to show multiple columns

--sort-column SORT_COLUMN

Specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

--sort-ascending

Sort the column(s) in ascending order

--sort-descending

Sort the column(s) in descending order

Expand
Table 63.21. CSV formatter options
ValueSummary

--quote {all,minimal,none,nonnumeric}

When to include quotes, defaults to nonnumeric

Expand
Table 63.22. JSON formatter options
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 63.23. Table formatter options
ValueSummary

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

--print-empty

Print empty table if there is no data to show.

63.7. router ndp proxy create

Create NDP proxy

Usage:

openstack router ndp proxy create [-h]
                                         [-f {json,shell,table,value,yaml}]
                                         [-c COLUMN] [--noindent]
                                         [--prefix PREFIX]
                                         [--max-width <integer>] [--fit-width]
                                         [--print-empty] [--name <name>]
                                         --port <port>
                                         [--ip-address <ip-address>]
                                         [--description <description>]
                                         <router>
Copy to Clipboard Toggle word wrap

Expand
Table 63.24. Positional arguments
ValueSummary

<router>

The name or id of a router

Expand
Table 63.25. Command arguments
ValueSummary

-h, --help

Show this help message and exit

--name <name>

New ndp proxy name

--port <port>

The name or id of the network port associated to the NDP proxy

--ip-address <ip-address>

The ipv6 address that is to be proxied. in case the port has multiple addresses assigned, use this option to select which address is to be used.

--description <description>

A text to describe/contextualize the use of the ndp proxy configuration

Expand
Table 63.26. Output formatter options
ValueSummary

-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated to show multiple columns

Expand
Table 63.27. JSON formatter options
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 63.28. Shell formatter options
ValueSummary

--prefix PREFIX

Add a prefix to all variable names

Expand
Table 63.29. Table formatter options
ValueSummary

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

--print-empty

Print empty table if there is no data to show.

63.8. router ndp proxy delete

Delete NDP proxy

Usage:

openstack router ndp proxy delete [-h] <ndp-proxy> [<ndp-proxy> ...]
Copy to Clipboard Toggle word wrap

Expand
Table 63.30. Positional arguments
ValueSummary

<ndp-proxy>

Ndp proxy(s) to delete (name or id)

Expand
Table 63.31. Command arguments
ValueSummary

-h, --help

Show this help message and exit

63.9. router ndp proxy list

List NDP proxies

Usage:

openstack router ndp proxy list [-h] [-f {csv,json,table,value,yaml}]
                                       [-c COLUMN]
                                       [--quote {all,minimal,none,nonnumeric}]
                                       [--noindent] [--max-width <integer>]
                                       [--fit-width] [--print-empty]
                                       [--sort-column SORT_COLUMN]
                                       [--sort-ascending | --sort-descending]
                                       [--router <router>] [--port <port>]
                                       [--ip-address ip-address]
                                       [--project <project>] [--name <name>]
                                       [--project-domain <project-domain>]
Copy to Clipboard Toggle word wrap

Expand
Table 63.32. Command arguments
ValueSummary

-h, --help

Show this help message and exit

--router <router>

List only ndp proxies belong to this router (name or ID)

--port <port>

List only ndp proxies assocate to this port (name or ID)

--ip-address ip-address

List only ndp proxies according to their ipv6 address

--project <project>

List ndp proxies according to their project (name or ID)

--name <name>

List ndp proxies according to their name

--project-domain <project-domain>

Domain the project belongs to (name or id). this can be used in case collisions between project names exist.

Expand
Table 63.33. Output formatter options
ValueSummary

-f {csv,json,table,value,yaml}, --format {csv,json,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated to show multiple columns

--sort-column SORT_COLUMN

Specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

--sort-ascending

Sort the column(s) in ascending order

--sort-descending

Sort the column(s) in descending order

Expand
Table 63.34. CSV formatter options
ValueSummary

--quote {all,minimal,none,nonnumeric}

When to include quotes, defaults to nonnumeric

Expand
Table 63.35. JSON formatter options
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 63.36. Table formatter options
ValueSummary

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

--print-empty

Print empty table if there is no data to show.

63.10. router ndp proxy set

Set NDP proxy properties

Usage:

openstack router ndp proxy set [-h] [--name <name>]
                                      [--description <description>]
                                      <ndp-proxy>
Copy to Clipboard Toggle word wrap

Expand
Table 63.37. Positional arguments
ValueSummary

<ndp-proxy>

The id or name of the ndp proxy to update

Expand
Table 63.38. Command arguments
ValueSummary

-h, --help

Show this help message and exit

--name <name>

Set ndp proxy name

--description <description>

A text to describe/contextualize the use of the ndp proxy configuration

63.11. router ndp proxy show

Display NDP proxy details

Usage:

openstack router ndp proxy show [-h] [-f {json,shell,table,value,yaml}]
                                       [-c COLUMN] [--noindent]
                                       [--prefix PREFIX]
                                       [--max-width <integer>] [--fit-width]
                                       [--print-empty]
                                       <ndp-proxy>
Copy to Clipboard Toggle word wrap

Expand
Table 63.39. Positional arguments
ValueSummary

<ndp-proxy>

The id or name of the ndp proxy

Expand
Table 63.40. Command arguments
ValueSummary

-h, --help

Show this help message and exit

Expand
Table 63.41. Output formatter options
ValueSummary

-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated to show multiple columns

Expand
Table 63.42. JSON formatter options
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 63.43. Shell formatter options
ValueSummary

--prefix PREFIX

Add a prefix to all variable names

Expand
Table 63.44. Table formatter options
ValueSummary

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

--print-empty

Print empty table if there is no data to show.

63.12. router remove port

Remove a port from a router

Usage:

openstack router remove port [-h] <router> <port>
Copy to Clipboard Toggle word wrap

Expand
Table 63.45. Positional arguments
ValueSummary

<router>

Router from which port will be removed (name or id)

<port>

Port to be removed and deleted (name or id)

Expand
Table 63.46. Command arguments
ValueSummary

-h, --help

Show this help message and exit

63.13. router remove route

Remove extra static routes from a router’s routing table.

Usage:

openstack router remove route [-h] [-f {json,shell,table,value,yaml}]
                                     [-c COLUMN] [--noindent]
                                     [--prefix PREFIX] [--max-width <integer>]
                                     [--fit-width] [--print-empty]
                                     [--route destination=<subnet>,gateway=<ip-address>]
                                     <router>
Copy to Clipboard Toggle word wrap

Expand
Table 63.47. Positional arguments
ValueSummary

<router>

Router from which extra static routes will be removed (name or ID).

Expand
Table 63.48. Command arguments
ValueSummary

-h, --help

Show this help message and exit

--route destination=<subnet>,gateway=<ip-address>

Remove extra static route from the router. destination: destination subnet (in CIDR notation), gateway: nexthop IP address. Repeat option to remove multiple routes. Trying to remove a route that’s already missing (fully, including destination and nexthop) from the routing table is allowed and is considered a successful operation.

Expand
Table 63.49. Output formatter options
ValueSummary

-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated to show multiple columns

Expand
Table 63.50. JSON formatter options
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 63.51. Shell formatter options
ValueSummary

--prefix PREFIX

Add a prefix to all variable names

Expand
Table 63.52. Table formatter options
ValueSummary

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

--print-empty

Print empty table if there is no data to show.

63.14. router remove subnet

Remove a subnet from a router

Usage:

openstack router remove subnet [-h] <router> <subnet>
Copy to Clipboard Toggle word wrap

Expand
Table 63.53. Positional arguments
ValueSummary

<router>

Router from which the subnet will be removed (name or id)

<subnet>

Subnet to be removed (name or id)

Expand
Table 63.54. Command arguments
ValueSummary

-h, --help

Show this help message and exit

63.15. router set

Set router properties

Usage:

openstack router set [-h]
                            [--extra-property type=<property_type>,name=<property_name>,value=<property_value>]
                            [--name <name>] [--description <description>]
                            [--enable | --disable]
                            [--distributed | --centralized]
                            [--route destination=<subnet>,gateway=<ip-address>]
                            [--no-route] [--ha | --no-ha]
                            [--external-gateway <network>]
                            [--fixed-ip subnet=<subnet>,ip-address=<ip-address>]
                            [--enable-snat | --disable-snat]
                            [--enable-ndp-proxy | --disable-ndp-proxy]
                            [--qos-policy <qos-policy> | --no-qos-policy]
                            [--tag <tag>] [--no-tag]
                            <router>
Copy to Clipboard Toggle word wrap

Expand
Table 63.55. Positional arguments
ValueSummary

<router>

Router to modify (name or id)

Expand
Table 63.56. Command arguments
ValueSummary

-h, --help

Show this help message and exit

--extra-property type=<property_type>,name=<property_name>,value=<property_value>

Additional parameters can be passed using this property. Default type of the extra property is string (str), but other types can be used as well. Available types are: dict, list, str, bool, int. In case of list type, value can be semicolon-separated list of values. For dict value is semicolon-separated list of the key:value pairs.

--name <name>

Set router name

--description <description>

Set router description

--enable

Enable router

--disable

Disable router

--distributed

Set router to distributed mode (disabled router only)

--centralized

Set router to centralized mode (disabled router only)

--route destination=<subnet>,gateway=<ip-address>

Add routes to the router destination: destination subnet (in CIDR notation) gateway: nexthop IP address (repeat option to add multiple routes). This is deprecated in favor of router add/remove route since it is prone to race conditions between concurrent clients when not used together with --no-route to overwrite the current value of routes.

--no-route

Clear routes associated with the router. specify both --route and --no-route to overwrite current value of routes.

--ha

Set the router as highly available (disabled router only)

--no-ha

Clear high availability attribute of the router (disabled router only)

--external-gateway <network>

External network used as router’s gateway (name or id)

--fixed-ip subnet=<subnet>,ip-address=<ip-address>

Desired ip and/or subnet (name or id) on external gateway: subnet=<subnet>,ip-address=<ip-address> (repeat option to set multiple fixed IP addresses)

--enable-snat

Enable source nat on external gateway

--disable-snat

Disable source nat on external gateway

--enable-ndp-proxy

Enable ipv6 ndp proxy on external gateway

--disable-ndp-proxy

Disable ipv6 ndp proxy on external gateway

--qos-policy <qos-policy>

Attach qos policy to router gateway ips

--no-qos-policy

Remove qos policy from router gateway ips

--tag <tag>

Tag to be added to the router (repeat option to set multiple tags)

--no-tag

Clear tags associated with the router. specify both --tag and --no-tag to overwrite current tags

63.16. router show

Display router details

Usage:

openstack router show [-h] [-f {json,shell,table,value,yaml}]
                             [-c COLUMN] [--noindent] [--prefix PREFIX]
                             [--max-width <integer>] [--fit-width]
                             [--print-empty]
                             <router>
Copy to Clipboard Toggle word wrap

Expand
Table 63.57. Positional arguments
ValueSummary

<router>

Router to display (name or id)

Expand
Table 63.58. Command arguments
ValueSummary

-h, --help

Show this help message and exit

Expand
Table 63.59. Output formatter options
ValueSummary

-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated to show multiple columns

Expand
Table 63.60. JSON formatter options
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 63.61. Shell formatter options
ValueSummary

--prefix PREFIX

Add a prefix to all variable names

Expand
Table 63.62. Table formatter options
ValueSummary

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

--print-empty

Print empty table if there is no data to show.

63.17. router unset

Unset router properties

Usage:

openstack router unset [-h]
                              [--extra-property type=<property_type>,name=<property_name>,value=<property_value>]
                              [--route destination=<subnet>,gateway=<ip-address>]
                              [--external-gateway] [--qos-policy]
                              [--tag <tag> | --all-tag]
                              <router>
Copy to Clipboard Toggle word wrap

Expand
Table 63.63. Positional arguments
ValueSummary

<router>

Router to modify (name or id)

Expand
Table 63.64. Command arguments
ValueSummary

-h, --help

Show this help message and exit

--extra-property type=<property_type>,name=<property_name>,value=<property_value>

Additional parameters can be passed using this property. Default type of the extra property is string (str), but other types can be used as well. Available types are: dict, list, str, bool, int. In case of list type, value can be semicolon-separated list of values. For dict value is semicolon-separated list of the key:value pairs.

--route destination=<subnet>,gateway=<ip-address>

Routes to be removed from the router destination: destination subnet (in CIDR notation) gateway: nexthop IP address (repeat option to unset multiple routes)

--external-gateway

Remove external gateway information from the router

--qos-policy

Remove qos policy from router gateway ips

--tag <tag>

Tag to be removed from the router (repeat option to remove multiple tags)

--all-tag

Clear all tags associated with the router

Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat