Ask Your Question
0

how to assign public ip address to instance interface directly by using NEUTRON [closed]

asked 2014-10-27 01:26:59 -0600

keky gravatar image

updated 2014-10-27 01:29:40 -0600

I am testing openstack with neutron network,The instances now can access to the internet only by NAT-ROUTER. I want to assign public ip address to them directly, Can anyone tell me how to make it, and would u please give me some suggestion,thx!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by keky
close date 2014-11-11 11:14:08.304453

Comments

What doesn't satisfy you in usual CLI schema like in http://textuploader.com/1hey section "Create and allocate Floating IP addresses". What means directly ?

dbaxps gravatar imagedbaxps ( 2014-10-27 04:59:45 -0600 )edit

"directly" means don't using any NAT|PROXY,But connect to the public internet directly. assign public IP ip1 to vm's eth0 vm-<eth0-ip1>--------------------[neutron]---------------internet

keky gravatar imagekeky ( 2014-10-27 05:46:36 -0600 )edit

3 answers

Sort by » oldest newest most voted
1

answered 2014-10-27 09:07:24 -0600

bishoy gravatar image

updated 2014-10-27 09:47:55 -0600

You can do that by setting Tenanet network type: VLAN. Also you have to get a switch that supports vlans to configure it to the network created for the tenant so that packets won't be dropped. then you can do an ifconfig inside the instance and you will find your lovely public ip.

Hope that helps.

edit flag offensive delete link more

Comments

finally I use vlan to fit my requirement. thx!

keky gravatar imagekeky ( 2014-11-11 11:12:19 -0600 )edit

Nice, Good to hear that!

bishoy gravatar imagebishoy ( 2014-11-11 11:26:23 -0600 )edit

Hi Keky,

I have the same necessity. Could you explain how you achieved it? I have been reading many doc about creating one VLAN but it looks complex and seems that is needed one special switch Could be this achieved also with one FLAT network? Could somebody point to me to some doc or resource? Thk

Gonzo gravatar imageGonzo ( 2015-07-28 03:36:29 -0600 )edit

Hi Gonzo, I am also facing same problem did you get reply from keky? Hi Keky, Help me out

shreyasmahangade gravatar imageshreyasmahangade ( 2018-09-28 01:39:52 -0600 )edit
0

answered 2014-10-27 12:01:46 -0600

xtrill gravatar image

You have to use Flat (or Flat DHCP) networks. Usually you create a Flat shared network on the admin tenant and you use it from the other tenants. If you use VLAN mode it will not work, as you'll need neutron routers to connect them to public networks.

This way traffic goes directly from Instance to OVS and to Network via a bridge mapped to your physical interface. You'll need to configure physical network mappings in the OVS plugin in each hypervisor.

You'll find some information here:

http://docs.openstack.org/trunk/insta...

(You can configure as many flat networks as needed).

edit flag offensive delete link more
0

answered 2014-10-27 05:10:58 -0600

dbaxps gravatar image

updated 2014-10-27 05:15:23 -0600

Forced to use answer field due to formatting options.
What doesn't satisfy you here ? That is schema using neutron :-

$ nova boot --flavor 2 --key_name oskey1 --image \
    fa7a83d1-3ddb-4c0e-9c07-839b6b00f8ca cirr-guest1

  $ nova list
  +--------------------------------------+-------------+--------+------------+-------------+--------------+
  | ID                                   | Name        | Status | Task State | Power State | Networks     |
  +--------------------------------------+-------------+--------+------------+-------------+--------------+
  | acfbd460-d8d7-4eba-962b-de6f2f50db12 | cirr-guest1 | ACTIVE | None       | Running     | int=30.0.0.2 |
  +--------------------------------------+-------------+--------+------------+-------------+--------------+


Create and allocate Floating IP addresses
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Source the user's credentials (tenant will be 'ostenant')

  $ . keystonerc_boris

List the ports 

 $ neutron port-list --device-id acfbd460-d8d7-4eba-962b-de6f2f50db12
 +--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
 | id                                   | name | mac_address       | fixed_ips                                                                       |
 +--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
 | 4ecfe633-dbab-4660-a51c-78ea6dbcc149 |      | fa:16:3e:88:05:e0 | {"subnet_id": "04b95f13-cc77-4f9a-8206-7f6ed183461d", "ip_address": "30.0.0.2"} |
 +--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+

Create a floating IP

  $ neutron floatingip-create ext
  Created a new floatingip:
  +---------------------+--------------------------------------+
  | Field               | Value                                |
  +---------------------+--------------------------------------+
  | fixed_ip_address    |                                      |
  | floating_ip_address | 192.168.122.11                       |
  | floating_network_id | 12e4de23-34f8-4f9f-ba2b-810c36f3cc40 |
  | id                  | 5976f269-bca2-4c44-8860-7d493909568f |
  | port_id             |                                      |
  | router_id           |                                      |
  | tenant_id           | 2c845a6ad20e45ccb0b045cee27a9661     |
  +---------------------+--------------------------------------+

    List the floating IP

  $ neutron floatingip-list
  +--------------------------------------+------------------+---------------------+---------+
  | id                                   | fixed_ip_address | floating_ip_address | port_id |
  +--------------------------------------+------------------+---------------------+---------+
  | 5976f269-bca2-4c44-8860-7d493909568f |                  | 192.168.122.11      |         |
  +--------------------------------------+------------------+---------------------+---------+

Associate floating IP with the port of the VM

  $ neutron floatingip-associate 5976f269-bca2-4c44-8860-7d493909568f 4ecfe633-dbab-4660-a51c-78ea6dbcc149
  Associated floatingip 5976f269-bca2-4c44-8860-7d493909568f

Show the floating IP

  $ neutron floatingip-show 5976f269-bca2-4c44-8860-7d493909568f
  +---------------------+--------------------------------------+
  | Field               | Value                                |
  +---------------------+--------------------------------------+
  | fixed_ip_address    | 30.0.0.2                             |
  | floating_ip_address | 192.168.122.11                       |
  | floating_network_id | 12e4de23-34f8-4f9f-ba2b-810c36f3cc40 |
  | id                  | 5976f269-bca2-4c44-8860-7d493909568f |
  | port_id             | 4ecfe633-dbab-4660-a51c-78ea6dbcc149 |
  | router_id           | d72adddf-4c02-4916-ae6d-16bfdaf59d99 |
  | tenant_id           | 2c845a6ad20e45ccb0b045cee27a9661     |
  +---------------------+--------------------------------------+
edit flag offensive delete link more

Comments

thx for your reply, as shown in the above, You should first assign an inner IP(ip2) to the instance, And then give it a floating_ip(ip1) [PUBLIC]------>ip1-[ROUTE-NAT]<--------------ip2-[eth0-VMS] What I want to achieve is show below: [PUBLIC]------>[ROUTE]<-------------ip1-[eth0-VMS]

keky gravatar imagekeky ( 2014-10-27 05:41:23 -0600 )edit

As shown above floating (ext) IP is NOT connected with outbound VM connectivity. Fixed IP is assigned automatically as soon as instance gets created ( routing within qdhcp-namespace from dnsmasq daemon associated with particular qdhcp-namespace ).

dbaxps gravatar imagedbaxps ( 2014-10-27 06:04:14 -0600 )edit

Assigning floating IP1 to VM happens without routing packet via [ROUTE-NAT].
(view https://www.hastexo.com/system/files/...
page 18) via qrouter-namespace internal routing.

dbaxps gravatar imagedbaxps ( 2014-10-27 06:11:32 -0600 )edit

as the picture shown,the qROUTE acts as a [ROUTE-NAT]

keky gravatar imagekeky ( 2014-10-27 08:27:42 -0600 )edit

I hardly understand what target is . Do you want to assign floating IP to VM avoiding Neutron router , been shown in neutron router-list ?

dbaxps gravatar imagedbaxps ( 2014-10-27 09:58:49 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-10-27 01:26:59 -0600

Seen: 6,554 times

Last updated: Oct 27 '14