Ask Your Question
1

add a public IP subnet to a network

asked 2014-04-14 07:07:27 -0500

dachary gravatar image

updated 2014-04-14 07:13:49 -0500

I'm adding a new range of public IP addresses to an existing network (ovh)

root@bm0015:~# neutron subnet-create --name ovh-real --allocation-pool=start=91.121.254.226,end=91.121.254.238 ovh 91.121.254.224/28
Created a new subnet:
+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| allocation_pools | {"start": "91.121.254.226", "end": "91.121.254.238"} |
| cidr             | 91.121.254.224/28                                    |
| dns_nameservers  |                                                      |
| enable_dhcp      | True                                                 |
| gateway_ip       | 91.121.254.225                                       |
| host_routes      |                                                      |
| id               | 2eaf4b06-d4b7-45bf-86c1-e7e81b1bfd51                 |
| ip_version       | 4                                                    |
| name             | ovh-real                                             |
| network_id       | 105885c1-8dc9-4e99-8d72-c57bb6ae5536                 |
| tenant_id        | 2a2365c4031d47d890bb403db7e92583                     |
+------------------+------------------------------------------------------+

However, it is not routed, although the other subnet in the same network is

root@bm0015:~# neutron router-show ovh
+-----------------------+-----------------------------------------------------------------------------+
| Field                 | Value                                                                       |
+-----------------------+-----------------------------------------------------------------------------+
| admin_state_up        | True                                                                        |
| external_gateway_info | {"network_id": "105885c1-8dc9-4e99-8d72-c57bb6ae5536", "enable_snat": true} |
| id                    | d82460c4-3bd0-45f5-b094-c8900f7b3907                                        |
| name                  | ovh                                                                         |
| routes                |                                                                             |
| status                | ACTIVE                                                                      |
| tenant_id             | 2a2365c4031d47d890bb403db7e92583                                            |
+-----------------------+-----------------------------------------------------------------------------+
root@bm0015:~# ip netns exec qrouter-d82460c4-3bd0-45f5-b094-c8900f7b3907 ip route
default via 10.88.2.1 dev qg-d7ab22a0-4c
10.0.2.0/24 dev qr-02c06dcc-52  proto kernel  scope link  src 10.0.2.1
10.88.2.0/24 dev qg-d7ab22a0-4c  proto kernel  scope link  src 10.88.2.2

The new subnet is not associated to a port. I expected a port similar to what 10.88.2.2 has.

root@bm0015:~# neutron net-show ovh
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | True                                 |
| id                        | 105885c1-8dc9-4e99-8d72-c57bb6ae5536 |
| name                      | ovh                                  |
| provider:network_type     | gre                                  |
| provider:physical_network |                                      |
| provider:segmentation_id  | 1                                    |
| router:external           | True                                 |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   | 2eaf4b06-d4b7-45bf-86c1-e7e81b1bfd51 |
|                           | ba76908e-d007-4610-b101-d3e1cd0ccd35 |
| tenant_id                 | 2a2365c4031d47d890bb403db7e92583     |
+---------------------------+--------------------------------------+
root@bm0015:~# neutron router-port-list ovh
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------------+
| id                                   | name | mac_address       | fixed_ips                                                                        |
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------------+
| 02c06dcc-5219-4ec1-b67b-7633f408b7b9 |      | fa:16:3e:35:9b:2a | {"subnet_id": "99f6936e-6801-4864-9b8e-172f59897b94", "ip_address": "10.0.2.1"}  |
| d7ab22a0-4c9d-4c38-8dba-bbfcc8bf7164 |      | fa:16:3e:9e:fc:70 | {"subnet_id": "ba76908e-d007-4610-b101-d3e1cd0ccd35", "ip_address": "10.88.2.2"} |

+--------------------------------------+------+-------------------+----------------------------------------------------------------------------------+

edit retag flag offensive close merge delete

Comments

Should I maybe run a port-create ? Was it implicit when I did neutron router-interface-add ovh ovh-lan ?

dachary gravatar imagedachary ( 2014-04-14 07:15:27 -0500 )edit

I have a working setup at OVH indeed and described one trick I had to implement at http://dachary.org/?p=2466

dachary gravatar imagedachary ( 2014-07-05 05:41:18 -0500 )edit

Hi Hoango, can you share your solution ?

Paulo Pereira gravatar imagePaulo Pereira ( 2014-07-08 08:34:48 -0500 )edit
1

Sure, I updated my blog at

http://dohuyhoang.github.io/openstack...

Hope it can help.

HoangDo gravatar imageHoangDo ( 2014-07-10 03:12:46 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
2

answered 2014-04-14 08:41:23 -0500

Doude gravatar image

You need to add an interface from the existing router 'ovh' to that new subnet. An interfaces's router is associated to a subnet through a port [1]. It's not related to a network which could contains more thant one subnet [2].

You can list router's interfaces with that command:

$ neutron port-list --device_id <router_id> --device_owner network:router_interface
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
| id                                   | name | mac_address       | fixed_ips                                                                       |
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
| 0664b64f-8383-4073-980a-e9b18249492e |      | fa:16:3e:61:50:33 | {"subnet_id": "66789194-9b45-4b79-9e3d-cd28fcb76d9b", "ip_address": "10.0.0.1"} |
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+

You can attach a router onto a subnet in two ways:

  1. specify the subnet ID then the subnet's gateway ip address is used to create the router interface
  2. otherwise, specify a port ID then the IP address associated with the port is used for creating the router interface

[1] Third line : http://docs.openstack.org/api/opensta...
[2] http://docs.openstack.org/api/opensta...
[3] http://docs.openstack.org/api/opensta...

edit flag offensive delete link more
1

answered 2014-04-14 08:16:18 -0500

I think you need to add the router interface for that specific subnet:

neutron router-interface-add d82460c4-3bd0-45f5-b094-c8900f7b3907 2eaf4b06-d4b7-45bf-86c1-e7e81b1bfd51

edit flag offensive delete link more

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

3 followers

Stats

Asked: 2014-04-14 07:07:27 -0500

Seen: 1,511 times

Last updated: Apr 14 '14