此内容没有您所选择的语言版本。

Chapter 58. router


This chapter describes the commands under the router command.

58.1. router add port

Usage:

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

Add a port to a router

Expand
Table 58.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 58.2. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

58.2. router add subnet

Usage:

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

Add a subnet to a router

Expand
Table 58.3. Positional Arguments
ValueSummary

<router>

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

<subnet>

Subnet to be added (name or id)

Expand
Table 58.4. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

58.3. router create

Usage:

openstack router create [-h] [-f {json,shell,table,value,yaml}]

                             [-c COLUMN] [--max-width <integer>]
                             [--fit-width] [--print-empty] [--noindent]
                             [--prefix PREFIX] [--enable | --disable]
                             [--distributed | --centralized]
                             [--ha | --no-ha] [--description <description>]
                             [--project <project>]
                             [--project-domain <project-domain>]
                             [--availability-zone-hint <availability-zone>]
                             [--tag <tag> | --no-tag]
                             <name>
Copy to Clipboard Toggle word wrap

Create a new router

Expand
Table 58.5. Positional Arguments
ValueSummary

<name>

New router name

Expand
Table 58.6. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

--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

Expand
Table 58.7. Output Formatters
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

Expand
Table 58.8. Table Formatter
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.

Expand
Table 58.9. JSON Formatter
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 58.10. shell formatter
ValueSummary

--prefix PREFIX

Add a prefix to all variable names

58.4. router delete

Usage:

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

Delete router(s)

Expand
Table 58.11. Positional Arguments
ValueSummary

<router>

Router(s) to delete (name or id)

Expand
Table 58.12. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

58.5. router list

Usage:

openstack router list [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN]

                           [--max-width <integer>] [--fit-width]
                           [--print-empty] [--noindent]
                           [--quote {all,minimal,none,nonnumeric}]
                           [--sort-column SORT_COLUMN] [--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

List routers

Expand
Table 58.13. Optional 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 58.14. Output Formatters
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

--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

Expand
Table 58.15. Table Formatter
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.

Expand
Table 58.16. JSON Formatter
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 58.17. CSV Formatter
ValueSummary

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

when to include quotes, defaults to nonnumeric

58.6. router remove port

Usage:

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

Remove a port from a router

Expand
Table 58.18. 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 58.19. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

58.7. router remove subnet

Usage:

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

Remove a subnet from a router

Expand
Table 58.20. 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 58.21. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

58.8. router set

Usage:

openstack router set [-h] [--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] [--tag <tag>]
                          [--no-tag]
                          <router>
Copy to Clipboard Toggle word wrap

Set router properties

Expand
Table 58.22. Positional Arguments
ValueSummary

<router>

Router to modify (name or id)

Expand
Table 58.23. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

--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>

Routes associated with the router destination: destination subnet (in CIDR notation) gateway: nexthop IP address (repeat option to set multiple routes)

--no-route

Clear routes associated with the router. specify both

--route and --no-route to overwrite current value of

route.

--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

--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

 

58.9. router show

Usage:

openstack router show [-h] [-f {json,shell,table,value,yaml}]

                           [-c COLUMN] [--max-width <integer>] [--fit-width]
                           [--print-empty] [--noindent] [--prefix PREFIX]
                           <router>
Copy to Clipboard Toggle word wrap

Display router details

Expand
Table 58.24. Positional Arguments
ValueSummary

<router>

Router to display (name or id)

Expand
Table 58.25. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

Expand
Table 58.26. Output Formatters
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

Expand
Table 58.27. Table Formatter
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.

Expand
Table 58.28. JSON Formatter
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 58.29. shell formatter
ValueSummary

--prefix PREFIX

Add a prefix to all variable names

58.10. router unset

Usage:

openstack router unset [-h]

                            [--route destination=<subnet>,gateway=<ip-address>]
                            [--external-gateway] [--tag <tag> | --all-tag]
                            <router>
Copy to Clipboard Toggle word wrap

Unset router properties

Expand
Table 58.30. Positional Arguments
ValueSummary

<router>

Router to modify (name or id)

Expand
Table 58.31. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

--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

--tag <tag>

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

--all-tag

Clear all tags associated with the router

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat