Chapter 69. router This chapter describes the commands under the router command. 69.1. router add port Add a port to a router Usage: Table 69.1. Positional arguments Value Summary <router> Router to which port will be added (name or id) <port> Port to be added (name or id) Table 69.2. Command arguments Value Summary -h, --help Show this help message and exit 69.2. router add route Add extra static routes to a router's routing table. Usage: Table 69.3. Positional arguments Value Summary <router> Router to which extra static routes will be added (name or ID). Table 69.4. Command arguments Value Summary -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. Table 69.5. Output formatter options Value Summary -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 Table 69.6. JSON formatter options Value Summary --noindent Whether to disable indenting the json Table 69.7. Shell formatter options Value Summary --prefix PREFIX Add a prefix to all variable names Table 69.8. Table formatter options Value Summary --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. 69.3. router add subnet Add a subnet to a router Usage: Table 69.9. Positional arguments Value Summary <router> Router to which subnet will be added (name or id) <subnet> Subnet to be added (name or id) Table 69.10. Command arguments Value Summary -h, --help Show this help message and exit 69.4. router create Create a new router Usage: Table 69.11. Positional arguments Value Summary <name> New router name Table 69.12. Command arguments Value Summary -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 --flavor-id <flavor-id> Associate the router to a flavor by id Table 69.13. Output formatter options Value Summary -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 Table 69.14. JSON formatter options Value Summary --noindent Whether to disable indenting the json Table 69.15. Shell formatter options Value Summary --prefix PREFIX Add a prefix to all variable names Table 69.16. Table formatter options Value Summary --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. 69.5. router delete Delete router(s) Usage: Table 69.17. Positional arguments Value Summary <router> Router(s) to delete (name or id) Table 69.18. Command arguments Value Summary -h, --help Show this help message and exit 69.6. router list List routers Usage: Table 69.19. Command arguments Value Summary -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) Table 69.20. Output formatter options Value Summary -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 Table 69.21. CSV formatter options Value Summary --quote {all,minimal,none,nonnumeric} When to include quotes, defaults to nonnumeric Table 69.22. JSON formatter options Value Summary --noindent Whether to disable indenting the json Table 69.23. Table formatter options Value Summary --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. 69.7. router remove port Remove a port from a router Usage: Table 69.24. Positional arguments Value Summary <router> Router from which port will be removed (name or id) <port> Port to be removed and deleted (name or id) Table 69.25. Command arguments Value Summary -h, --help Show this help message and exit 69.8. router remove route Remove extra static routes from a router's routing table. Usage: Table 69.26. Positional arguments Value Summary <router> Router from which extra static routes will be removed (name or ID). Table 69.27. Command arguments Value Summary -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. Table 69.28. Output formatter options Value Summary -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 Table 69.29. JSON formatter options Value Summary --noindent Whether to disable indenting the json Table 69.30. Shell formatter options Value Summary --prefix PREFIX Add a prefix to all variable names Table 69.31. Table formatter options Value Summary --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. 69.9. router remove subnet Remove a subnet from a router Usage: Table 69.32. Positional arguments Value Summary <router> Router from which the subnet will be removed (name or id) <subnet> Subnet to be removed (name or id) Table 69.33. Command arguments Value Summary -h, --help Show this help message and exit 69.10. router set Set router properties Usage: Table 69.34. Positional arguments Value Summary <router> Router to modify (name or id) Table 69.35. Command arguments Value Summary -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> 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 --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 69.11. router show Display router details Usage: Table 69.36. Positional arguments Value Summary <router> Router to display (name or id) Table 69.37. Command arguments Value Summary -h, --help Show this help message and exit Table 69.38. Output formatter options Value Summary -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 Table 69.39. JSON formatter options Value Summary --noindent Whether to disable indenting the json Table 69.40. Shell formatter options Value Summary --prefix PREFIX Add a prefix to all variable names Table 69.41. Table formatter options Value Summary --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. 69.12. router unset Unset router properties Usage: Table 69.42. Positional arguments Value Summary <router> Router to modify (name or id) Table 69.43. Command arguments Value Summary -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 --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

Commands:
openstack router add port [-h] <router> <port>
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>
openstack router add subnet [-h] <router> <subnet>
openstack router create [-h] [-f {json,shell,table,value,yaml}] [-c COLUMN] [--noindent] [--prefix PREFIX] [--max-width <integer>] [--fit-width] [--print-empty] [--enable | --disable] [--distributed | --centralized] [--ha | --no-ha] [--description <description>] [--project <project>] [--project-domain <project-domain>] [--availability-zone-hint <availability-zone>] [--tag <tag> | --no-tag] [--flavor-id <flavor-id>] <name>
openstack router delete [-h] <router> [<router> ...]
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>,...]]
openstack router remove port [-h] <router> <port>
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>
openstack router remove subnet [-h] <router> <subnet>
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] [--qos-policy <qos-policy> | --no-qos-policy] [--tag <tag>] [--no-tag] <router>
openstack router show [-h] [-f {json,shell,table,value,yaml}] [-c COLUMN] [--noindent] [--prefix PREFIX] [--max-width <integer>] [--fit-width] [--print-empty] <router>
openstack router unset [-h] [--route destination=<subnet>,gateway=<ip-address>] [--external-gateway] [--qos-policy] [--tag <tag> | --all-tag] <router>