Ask Your Question
1

openstack cli router gateway set

asked 2016-07-18 01:03:40 -0500

OpenStackGossin gravatar image

According to the docs, the openstack command line interface (cli) is preferred and the individual cli's are deprecated, but how do I do neutron router-gateway-set with the openstack cli? I can of course do "SET GATEWAY" in Horizon as well but I need to know how (if possible) this can be done with the new openstack cli. It should be something like openstack router gateway ... but that command does not exist. Is this just not implemented yet?

edit retag flag offensive close merge delete

6 answers

Sort by ยป oldest newest most voted
3

answered 2017-01-25 11:24:10 -0500

gadamiak gravatar image

In the http://docs.openstack.org/user-guide/cli-create-and-manage-networks.html#create-routers (user guide) I found the following:

Link the router to the external provider network:

$ openstack router set ROUTER --external-gateway NETWORK

Replace ROUTER with the unique identifier of the router, replace NETWORK with the unique identifier of the external provider network.

However, it's not available in Mitaka.

edit flag offensive delete link more

Comments

1

available from python-openstackclient 3.6

OpenStackGossin gravatar imageOpenStackGossin ( 2017-02-17 05:55:33 -0500 )edit
1

answered 2017-02-17 12:24:30 -0500

dbaxps gravatar image
edit flag offensive delete link more
0

answered 2017-03-04 11:18:02 -0500

You may still run:

openstack router set --external-gateway <network> <router>

but you must update your python-openstackclient first. I had the same issue but it worked like charm after updating the client

sudo  pip install --upgrade python-openstackclient
edit flag offensive delete link more
0

answered 2017-02-17 00:22:08 -0500

AnLaoch gravatar image

updated 2017-02-17 00:22:53 -0500

I can confirm I came across the same thing.

controller:~$  openstack router set --external-gateway=provider router1 
usage: openstack router set [-h] [--name <name>] [--enable | --disable]
                            [--distributed | --centralized]
                            [--route destination=<subnet>,gateway=<ip-address> | --no-route]
                            <router>
openstack router set: error: unrecognized arguments: --external-gateway=provider

Using the old neutron command

controller:~$ neutron router-gateway-set router1 provider
Set gateway for router router1

verified that the command set

controller:~$  openstack router show router1 
+-------------------------+------------------------------------------------------------------+
| Field                   | Value                                                            |
+-------------------------+------------------------------------------------------------------+
| admin_state_up          | UP                                                               |
| availability_zone_hints |                                                                  |
| availability_zones      | nova                                                             |
| created_at              | 2017-02-17T05:58:10Z                                             |
| description             |                                                                  |
| external_gateway_info   | {"network_id": "1ad8799b-8d9a-4ddd-801f-942da3549ee4",           |
|                         | "enable_snat": true, "external_fixed_ips": [{"subnet_id":        |
|                         | "d0fa8e34-ced4-4574-934d-824bb92bcc97", "ip_address":            |
|                         | "203.0.113.105"}]}                                               |
| flavor_id               | None                                                             |
| id                      | 6f30e6d8-6b4b-49cc-a995-6ee8267370c7                             |
| name                    | router1                                                          |
| project_id              | f5a2b881391e4170b1649c7343e0b361                                 |
| project_id              | f5a2b881391e4170b1649c7343e0b361                                 |
| revision_number         | 5                                                                |
| routes                  |                                                                  |
| status                  | ACTIVE                                                           |
| updated_at              | 2017-02-17T06:17:26Z                                             |
+-------------------------+------------------------------------------------------------------+
edit flag offensive delete link more
0

answered 2017-02-17 01:24:28 -0500

silently gravatar image

such as :

neutron router-gateway-set route01 ff6516a0-0e70-4195-bc4a-0a14b0948c62
edit flag offensive delete link more
0

answered 2016-07-18 02:12:38 -0500

you could use openstack router set, have a look at:

openstack router set

HTH Amedeo

edit flag offensive delete link more

Comments

1

thanks but I dont think this works, I have tried many variations of e.g. openstack router set router1 --route destination=172.16.0.0/16,gateway=172.16.0.1 but it does not allow me to do what neutron router-gateway-set does

OpenStackGossin gravatar imageOpenStackGossin ( 2016-07-18 02:52:59 -0500 )edit

Does not appear to be implemented yet (openstack version 2.2.0).

barry.davis gravatar imagebarry.davis ( 2016-07-19 10:26:21 -0500 )edit

This works now, was implemented in python-openstackclient 3.6 (in Dec 16) !

$ openstack router set --external-gateway <network> <router>
OpenStackGossin gravatar imageOpenStackGossin ( 2017-02-17 05:53:50 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-07-18 01:03:40 -0500

Seen: 6,361 times

Last updated: Mar 04 '17