settingsLogin | Registersettings

[openstack-dev] [Network] Allocate MAC and IP address for a VM instance

0 votes

Greetings,

Not sure if it is suitable to ask this question in openstack-dev list. Here
come a question related to network and want to get some input or comments
from you experts.

My case is as this: For some security issue, I want to put both MAC and
internal IP address to a pool and when create VM, I can get MAC and its
mapped IP address and assign the MAC and IP address to the VM.

For example, suppose I have following MAC and IP pool:
1) 78:2b:cb:af:78:b0, 192.168.0.10
2) 78:2b:cb:af:78:b1, 192.168.0.11
3) 78:2b:cb:af:78:b2, 192.168.0.12
4) 78:2b:cb:af:78:b3, 192.168.0.13

Then I can create four VMs using above MAC and IP address, each row in
above can be mapped to a VM.

Does any of you have any idea for the solution of this?

--
Thanks,

Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openstack.org/pipermail/openstack-dev/attachments/20140218/cbc3732a/attachment.html

asked Feb 18, 2014 in openstack-dev by Jay_Lau (7,320 points)   1 8 11
retagged Feb 25, 2015 by admin

15 Responses

0 votes

Hi Jay,

In neutron API, you could create port with specified macaddress and fixip, and then create vm with this port.
But the mapping of them need to manage by yourself.

? 2014?2?18??22:41?Jay Lau <jay.lau.513 at gmail.com> ???

Greetings,

Not sure if it is suitable to ask this question in openstack-dev list. Here come a question related to network and want to get some input or comments from you experts.

My case is as this: For some security issue, I want to put both MAC and internal IP address to a pool and when create VM, I can get MAC and its mapped IP address and assign the MAC and IP address to the VM.

For example, suppose I have following MAC and IP pool:
1) 78:2b:cb:af:78:b0, 192.168.0.10
2) 78:2b:cb:af:78:b1, 192.168.0.11
3) 78:2b:cb:af:78:b2, 192.168.0.12
4) 78:2b:cb:af:78:b3, 192.168.0.13

Then I can create four VMs using above MAC and IP address, each row in above can be mapped to a VM.

Does any of you have any idea for the solution of this?

--
Thanks,

Jay


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Feb 18, 2014 by Dong_Liu (520 points)   1
0 votes

Jay,

We've got a similar requirement at CERN where we would like to have pools of ip/mac combinations for each subnet and have it so that the user is just allocated one (and for the same subnet that the hypervisor is on).

We've not found a good solution so far.

Tim

-----Original Message-----
From: Dong Liu [mailto:willowd878 at gmail.com]
Sent: 18 February 2014 18:12
To: OpenStack Development Mailing List (not for usage questions)
Subject: Re: [openstack-dev] [Network] Allocate MAC and IP address for a VM instance

Hi Jay,

In neutron API, you could create port with specified macaddress and fixip, and then create vm with this port.
But the mapping of them need to manage by yourself.

? 2014?2?18??22:41?Jay Lau <jay.lau.513 at gmail.com> ???

Greetings,

Not sure if it is suitable to ask this question in openstack-dev list. Here come a question related to network and want to get some
input or comments from you experts.

My case is as this: For some security issue, I want to put both MAC and internal IP address to a pool and when create VM, I can get
MAC and its mapped IP address and assign the MAC and IP address to the VM.

For example, suppose I have following MAC and IP pool:
1) 78:2b:cb:af:78:b0, 192.168.0.10
2) 78:2b:cb:af:78:b1, 192.168.0.11
3) 78:2b:cb:af:78:b2, 192.168.0.12
4) 78:2b:cb:af:78:b3, 192.168.0.13

Then I can create four VMs using above MAC and IP address, each row in above can be mapped to a VM.

Does any of you have any idea for the solution of this?

--
Thanks,

Jay


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Feb 18, 2014 by Tim_Bell (16,440 points)   1 8 10
0 votes

Hi all,

In Rackspace's quark plugin (github.com/rackerlabs/quark), we?ve developed an extension for MAC address ranges (MARs) as a top-level resource. Thus, the Neutron service manages the MAC address allocation from a pool of ranges (as opposed to randomly generating a MAC address). However, we haven?t made a relationship between MARs and subnets/networks.

Amir

On Feb 18, 2014, at 11:24 AM, Tim Bell <Tim.Bell at cern.ch> wrote:

Jay,

We've got a similar requirement at CERN where we would like to have pools of ip/mac combinations for each subnet and have it so that the user is just allocated one (and for the same subnet that the hypervisor is on).

We've not found a good solution so far.

Tim

-----Original Message-----
From: Dong Liu [mailto:willowd878 at gmail.com]
Sent: 18 February 2014 18:12
To: OpenStack Development Mailing List (not for usage questions)
Subject: Re: [openstack-dev] [Network] Allocate MAC and IP address for a VM instance

Hi Jay,

In neutron API, you could create port with specified macaddress and fixip, and then create vm with this port.
But the mapping of them need to manage by yourself.

? 2014?2?18??22:41?Jay Lau <jay.lau.513 at gmail.com> ???

Greetings,

Not sure if it is suitable to ask this question in openstack-dev list. Here come a question related to network and want to get some
input or comments from you experts.

My case is as this: For some security issue, I want to put both MAC and internal IP address to a pool and when create VM, I can get
MAC and its mapped IP address and assign the MAC and IP address to the VM.

For example, suppose I have following MAC and IP pool:
1) 78:2b:cb:af:78:b0, 192.168.0.10
2) 78:2b:cb:af:78:b1, 192.168.0.11
3) 78:2b:cb:af:78:b2, 192.168.0.12
4) 78:2b:cb:af:78:b3, 192.168.0.13

Then I can create four VMs using above MAC and IP address, each row in above can be mapped to a VM.

Does any of you have any idea for the solution of this?

--
Thanks,

Jay


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Feb 18, 2014 by Amir_Sadoughi (620 points)   2
0 votes

Thanks Dong for the great help, it does worked with command line!

This seems not available via dashboard, right?

Thanks,

Jay

2014-02-19 1:11 GMT+08:00 Dong Liu :

Hi Jay,

In neutron API, you could create port with specified macaddress and
fix
ip, and then create vm with this port.
But the mapping of them need to manage by yourself.

? 2014?2?18??22:41?Jay Lau <jay.lau.513 at gmail.com> ???

Greetings,

Not sure if it is suitable to ask this question in openstack-dev list.
Here come a question related to network and want to get some input or
comments from you experts.

My case is as this: For some security issue, I want to put both MAC and
internal IP address to a pool and when create VM, I can get MAC and its
mapped IP address and assign the MAC and IP address to the VM.

For example, suppose I have following MAC and IP pool:
1) 78:2b:cb:af:78:b0, 192.168.0.10
2) 78:2b:cb:af:78:b1, 192.168.0.11
3) 78:2b:cb:af:78:b2, 192.168.0.12
4) 78:2b:cb:af:78:b3, 192.168.0.13

Then I can create four VMs using above MAC and IP address, each row in
above can be mapped to a VM.

Does any of you have any idea for the solution of this?

--
Thanks,

Jay


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

--
Thanks,

Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL:

responded Feb 19, 2014 by Jay_Lau (7,320 points)   1 8 11
0 votes

Also thanks Tim and Amir for the input here.

Just one more question and hope can also get some help from you ;-)

I have tried that we can create VM with MAC and FIXED IP bind together,
what about floating IP? Is it possible that I also bind MAC and FLOATING IP
for a VM?

===============MAC and FIXED IP BIND===============
[root at db01b05 ~(keystoneadmin)]# neutron net-list
+--------------------------------------+----------+---------------------------------------------------+
| id | name |
subnets |
+--------------------------------------+----------+---------------------------------------------------+
| 489e5aac-aedb-4d94-b908-fc8079dee25c | Int |
f307d9fd-2444-4ad0-b21a-9f490b182cbb 10.0.0.0/24 |
| 9b758062-2be8-4244-a5a9-3f878f74e006 | Ex |
b76e9845-8ee1-4794-ae81-4514ce18b428 9.21.52.0/24 |
| fb1a75f9-e468-408b-a172-5d2b3802d862 | IntAdmin |
0fff20f4-142a-4e89-add1-5c5a79c6d54d 10.0.1.0/24 |
+--------------------------------------+----------+---------------------------------------------------+
[root at db01b05 ~(keystone
admin)]# neutron subnet-list
+--------------------------------------+-------------+--------------+----------------------------------------------+
| id | name | cidr |
allocationpools |
+--------------------------------------+-------------+--------------+----------------------------------------------+
| 0fff20f4-142a-4e89-add1-5c5a79c6d54d | SubIntAdmin | 10.0.1.0/24 |
{"start": "10.0.1.2", "end": "10.0.1.254"} |
| b76e9845-8ee1-4794-ae81-4514ce18b428 | SubEx | 9.21.52.0/24 |
{"start": "9.21.52.20", "end": "9.21.52.30"} |
| f307d9fd-2444-4ad0-b21a-9f490b182cbb | SubInt | 10.0.0.0/24 |
{"start": "10.0.0.3", "end": "10.0.0.254"} |
| | | |
{"start": "10.0.0.1", "end": "10.0.0.1"} |
+--------------------------------------+-------------+--------------+----------------------------------------------+
[root at db01b05 ~(keystone
admin)]# neutron port-create IntAdmin
--mac-address fa:16:3e:9d:e9:11 --fixed-ip ipaddress=10.0.1.2
Created a new port:
+-----------------------+---------------------------------------------------------------------------------+
| Field |
Value
|
+-----------------------+---------------------------------------------------------------------------------+
| admin
stateup |
True
|
| allowed
addresspairs
|
|
| binding:capabilities | {"port
filter":
true} |
| binding:hostid
|
|
| binding:vif
type |
ovs
|
| deviceid
|
|
| device
owner
|
|
| fixedips | {"subnetid":
"0fff20f4-142a-4e89-add1-5c5a79c6d54d", "ipaddress": "10.0.1.2"} |
| id |
75a4eca1-1edf-415e-9bce-34a228145110
|
| mac
address |
fa:16:3e:9d:e9:11
|
| name
|
|
| networkid |
fb1a75f9-e468-408b-a172-5d2b3802d862
|
| security
groups |
aa3f3025-ba71-476d-a126-25a9e3b34c9a
|
| status |
DOWN
|
| tenantid |
f181a9c2b1b4443dbd91b1b7de716185
|
+-----------------------+---------------------------------------------------------------------------------+
[root at db01b05 ~(keystone
admin)]# neutron port-list | grep 10.0.1.2
| 75a4eca1-1edf-415e-9bce-34a228145110 | | fa:16:3e:9d:e9:11 |
{"subnetid": "0fff20f4-142a-4e89-add1-5c5a79c6d54d", "ipaddress":
"10.0.1.2"} |
[root at db01b05 ~(keystoneadmin)]# nova boot --image
centos64-x86
64-cfntools --flavor 2 --key-name adminkey --nic
port-id=75a4eca1-1edf-415e-9bce-34a228145110 vm0001
+--------------------------------------+--------------------------------------+
| Property |
Value |
+--------------------------------------+--------------------------------------+
| OS-EXT-STS:taskstate |
scheduling |
| image |
centos64-x86
64-cfntools |
| OS-EXT-STS:vmstate |
building |
| OS-EXT-SRV-ATTR:instance
name |
instance-00000023 |
| OS-SRV-USG:launchedat |
None |
| flavor |
m1.small |
| id |
9af14d06-6fa8-4757-8eb7-118ea01d3fdb |
| security
groups | [{u'name':
u'default'}] |
| userid |
345dd87da2364fa78ffe97ed349bb71b |
| OS-DCF:diskConfig |
MANUAL |
| accessIPv4
| |
| accessIPv6
| |
| progress |
0 |
| OS-EXT-STS:power
state |
0 |
| OS-EXT-AZ:availabilityzone |
nova |
| config
drive
| |
| status |
BUILD |
| updated |
2014-02-19T00:07:20Z |
| hostId
| |
| OS-EXT-SRV-ATTR:host |
None |
| OS-SRV-USG:terminatedat |
None |
| key
name |
adminkey |
| OS-EXT-SRV-ATTR:hypervisorhostname |
None |
| name |
vm0001 |
| adminPass |
6zHF9aXBHs5t |
| tenant
id |
f181a9c2b1b4443dbd91b1b7de716185 |
| created |
2014-02-19T00:07:20Z |
| os-extended-volumes:volumes_attached |
[] |
| metadata |
{} |
+--------------------------------------+--------------------------------------+

Thanks,

Jay

2014-02-19 8:11 GMT+08:00 Jay Lau <jay.lau.513 at gmail.com>:

Thanks Dong for the great help, it does worked with command line!

This seems not available via dashboard, right?

Thanks,

Jay

2014-02-19 1:11 GMT+08:00 Dong Liu :

Hi Jay,

In neutron API, you could create port with specified macaddress and
fix
ip, and then create vm with this port.
But the mapping of them need to manage by yourself.

? 2014?2?18??22:41?Jay Lau <jay.lau.513 at gmail.com> ???

Greetings,

Not sure if it is suitable to ask this question in openstack-dev list.
Here come a question related to network and want to get some input or
comments from you experts.

My case is as this: For some security issue, I want to put both MAC and
internal IP address to a pool and when create VM, I can get MAC and its
mapped IP address and assign the MAC and IP address to the VM.

For example, suppose I have following MAC and IP pool:
1) 78:2b:cb:af:78:b0, 192.168.0.10
2) 78:2b:cb:af:78:b1, 192.168.0.11
3) 78:2b:cb:af:78:b2, 192.168.0.12
4) 78:2b:cb:af:78:b3, 192.168.0.13

Then I can create four VMs using above MAC and IP address, each row in
above can be mapped to a VM.

Does any of you have any idea for the solution of this?

--
Thanks,

Jay


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

--
Thanks,

Jay

--
Thanks,

Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL:

responded Feb 19, 2014 by Jay_Lau (7,320 points)   1 8 11
0 votes

yes, it does not worked via dashboard

Dong Liu

? 2014-02-19 8:11, Jay Lau ??:

Thanks Dong for the great help, it does worked with command line!

This seems not available via dashboard, right?

Thanks,

Jay

2014-02-19 1:11 GMT+08:00 Dong Liu >:

Hi Jay,

In neutron API, you could create port with specified mac_address and
fix_ip, and then create vm with this port.
But the mapping of them need to manage by yourself.


? 2014?2?18??22:41?Jay Lau <jay.lau.513 at gmail.com
<mailto:jay.lau.513 at gmail.com>> ???

 > Greetings,
 >
 > Not sure if it is suitable to ask this question in openstack-dev
list. Here come a question related to network and want to get some
input or comments from you experts.
 >
 > My case is as this: For some security issue, I want to put both
MAC and internal IP address to a pool and when create VM, I can get
MAC and its mapped IP address and assign the MAC and IP address to
the VM.
 >
 > For example, suppose I have following MAC and IP pool:
 > 1) 78:2b:cb:af:78:b0, 192.168.0.10
 > 2) 78:2b:cb:af:78:b1, 192.168.0.11
 > 3) 78:2b:cb:af:78:b2, 192.168.0.12
 > 4) 78:2b:cb:af:78:b3, 192.168.0.13
 >
 > Then I can create four VMs using above MAC and IP address, each
row in above can be mapped to a VM.
 >
 > Does any of you have any idea for the solution of this?
 >
 > --
 > Thanks,
 >
 > Jay
 > _______________________________________________
 > OpenStack-dev mailing list
 > OpenStack-dev at lists.openstack.org
<mailto:OpenStack-dev at lists.openstack.org>
 > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


_______________________________________________
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
<mailto:OpenStack-dev at lists.openstack.org>
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

--
Thanks,

Jay


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Feb 19, 2014 by Dong_Liu (520 points)   1
0 votes

Thanks Liu Dong.

In case that you may not get my previous question, so here just post it
again to see if you can give a help.

Is it possible to bind MAC to a FLOATING IP?

Thanks,

Jay

2014-02-19 10:38 GMT+08:00 Dong Liu :

yes, it does not worked via dashboard

Dong Liu

? 2014-02-19 8:11, Jay Lau ??:

Thanks Dong for the great help, it does worked with command line!

This seems not available via dashboard, right?

Thanks,

Jay

2014-02-19 1:11 GMT+08:00 Dong Liu >:

Hi Jay,

In neutron API, you could create port with specified mac_address and
fix_ip, and then create vm with this port.
But the mapping of them need to manage by yourself.


? 2014?2?18??22:41?Jay Lau <jay.lau.513 at gmail.com
<mailto:jay.lau.513 at gmail.com>> ???


 > Greetings,
 >
 > Not sure if it is suitable to ask this question in openstack-dev
list. Here come a question related to network and want to get some
input or comments from you experts.
 >
 > My case is as this: For some security issue, I want to put both
MAC and internal IP address to a pool and when create VM, I can get
MAC and its mapped IP address and assign the MAC and IP address to
the VM.
 >
 > For example, suppose I have following MAC and IP pool:
 > 1) 78:2b:cb:af:78:b0, 192.168.0.10
 > 2) 78:2b:cb:af:78:b1, 192.168.0.11
 > 3) 78:2b:cb:af:78:b2, 192.168.0.12
 > 4) 78:2b:cb:af:78:b3, 192.168.0.13
 >
 > Then I can create four VMs using above MAC and IP address, each
row in above can be mapped to a VM.
 >
 > Does any of you have any idea for the solution of this?
 >
 > --
 > Thanks,
 >
 > Jay
 > _______________________________________________
 > OpenStack-dev mailing list
 > OpenStack-dev at lists.openstack.org
<mailto:OpenStack-dev at lists.openstack.org>

 > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


_______________________________________________
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
<mailto:OpenStack-dev at lists.openstack.org>

http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

--
Thanks,

Jay


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

--
Thanks,

Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL:

responded Feb 19, 2014 by Jay_Lau (7,320 points)   1 8 11
0 votes

Jay, what the mac belong to? Is it a vm mac, or a mac of floatingip.
If it is a vm mac, you can associate any floatingip to vm port.
If it is a floatingip mac, I have no idea.

2014-02-19 11:44, Jay Lau :

Thanks Liu Dong.

In case that you may not get my previous question, so here just post it
again to see if you can give a help.

Is it possible to bind MAC to a FLOATING IP?

Thanks,

Jay

2014-02-19 10:38 GMT+08:00 Dong Liu >:

yes, it does not worked via dashboard

Dong Liu

? 2014-02-19 8:11, Jay Lau ??:

    Thanks Dong for the great help, it does worked with command line!

    This seems not available via dashboard, right?

    Thanks,

    Jay



    2014-02-19 1:11 GMT+08:00 Dong Liu <willowd878 at gmail.com
    <mailto:willowd878 at gmail.com>
    <mailto:willowd878 at gmail.com <mailto:willowd878 at gmail.com>>>__:


         Hi Jay,

         In neutron API, you could create port with specified
    mac_address and
         fix_ip, and then create vm with this port.
         But the mapping of them need to manage by yourself.


         ? 2014?2?18??22:41?Jay Lau <jay.lau.513 at gmail.com
    <mailto:jay.lau.513 at gmail.com>
         <mailto:jay.lau.513 at gmail.com
    <mailto:jay.lau.513 at gmail.com>>__> ???


          > Greetings,
          >
          > Not sure if it is suitable to ask this question in
    openstack-dev
         list. Here come a question related to network and want to
    get some
         input or comments from you experts.
          >
          > My case is as this: For some security issue, I want to
    put both
         MAC and internal IP address to a pool and when create VM, I
    can get
         MAC and its mapped IP address and assign the MAC and IP
    address to
         the VM.
          >
          > For example, suppose I have following MAC and IP pool:
          > 1) 78:2b:cb:af:78:b0, 192.168.0.10
          > 2) 78:2b:cb:af:78:b1, 192.168.0.11
          > 3) 78:2b:cb:af:78:b2, 192.168.0.12
          > 4) 78:2b:cb:af:78:b3, 192.168.0.13
          >
          > Then I can create four VMs using above MAC and IP
    address, each
         row in above can be mapped to a VM.
          >
          > Does any of you have any idea for the solution of this?
          >
          > --
          > Thanks,
          >
          > Jay
          > _________________________________________________
          > OpenStack-dev mailing list
          > OpenStack-dev at lists.openstack.__org
    <mailto:OpenStack-dev at lists.openstack.org>
         <mailto:OpenStack-dev at lists.__openstack.org
    <mailto:OpenStack-dev at lists.openstack.org>>

          >
    http://lists.openstack.org/__cgi-bin/mailman/listinfo/__openstack-dev
    


         _________________________________________________
         OpenStack-dev mailing list
    OpenStack-dev at lists.openstack.__org
    <mailto:OpenStack-dev at lists.openstack.org>
         <mailto:OpenStack-dev at lists.__openstack.org
    <mailto:OpenStack-dev at lists.openstack.org>>

    http://lists.openstack.org/__cgi-bin/mailman/listinfo/__openstack-dev
    




    --
    Thanks,

    Jay


    _________________________________________________
    OpenStack-dev mailing list
    OpenStack-dev at lists.openstack.__org
    <mailto:OpenStack-dev at lists.openstack.org>
    http://lists.openstack.org/__cgi-bin/mailman/listinfo/__openstack-dev
    



_________________________________________________
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.__org
<mailto:OpenStack-dev at lists.openstack.org>
http://lists.openstack.org/__cgi-bin/mailman/listinfo/__openstack-dev 

--
Thanks,

Jay


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
responded Feb 19, 2014 by Dong_Liu (520 points)   1
0 votes

Thanks Liu Dong.

It is a VM mac address, so do you have any idea for how can I make sure the
VM mac address can bind to a floating ip address?

Also what do you mean by floatingip mac?

Really thanks very much for your kind help, it is really helped me a lot!

Thanks,

Jay

2014-02-19 16:21 GMT+08:00 Dong Liu :

Jay, what the mac belong to? Is it a vm mac, or a mac of floatingip.
If it is a vm mac, you can associate any floatingip to vm port.
If it is a floatingip mac, I have no idea.

2014-02-19 11:44, Jay Lau :

Thanks Liu Dong.

In case that you may not get my previous question, so here just post it
again to see if you can give a help.

Is it possible to bind MAC to a FLOATING IP?

Thanks,

Jay

2014-02-19 10:38 GMT+08:00 Dong Liu >:

yes, it does not worked via dashboard

Dong Liu

? 2014-02-19 8:11, Jay Lau ??:

    Thanks Dong for the great help, it does worked with command line!

    This seems not available via dashboard, right?

    Thanks,

    Jay



    2014-02-19 1:11 GMT+08:00 Dong Liu <willowd878 at gmail.com
    <mailto:willowd878 at gmail.com>
    <mailto:willowd878 at gmail.com <mailto:willowd878 at gmail.com>>>__:



         Hi Jay,

         In neutron API, you could create port with specified
    mac_address and
         fix_ip, and then create vm with this port.
         But the mapping of them need to manage by yourself.


         ? 2014?2?18??22:41?Jay Lau <jay.lau.513 at gmail.com
    <mailto:jay.lau.513 at gmail.com>
         <mailto:jay.lau.513 at gmail.com
    <mailto:jay.lau.513 at gmail.com>>__> ???



          > Greetings,
          >
          > Not sure if it is suitable to ask this question in
    openstack-dev
         list. Here come a question related to network and want to
    get some
         input or comments from you experts.
          >
          > My case is as this: For some security issue, I want to
    put both
         MAC and internal IP address to a pool and when create VM, I
    can get
         MAC and its mapped IP address and assign the MAC and IP
    address to
         the VM.
          >
          > For example, suppose I have following MAC and IP pool:
          > 1) 78:2b:cb:af:78:b0, 192.168.0.10
          > 2) 78:2b:cb:af:78:b1, 192.168.0.11
          > 3) 78:2b:cb:af:78:b2, 192.168.0.12
          > 4) 78:2b:cb:af:78:b3, 192.168.0.13
          >
          > Then I can create four VMs using above MAC and IP
    address, each
         row in above can be mapped to a VM.
          >
          > Does any of you have any idea for the solution of this?
          >
          > --
          > Thanks,
          >
          > Jay
          > _________________________________________________
          > OpenStack-dev mailing list
          > OpenStack-dev at lists.openstack.__org
    <mailto:OpenStack-dev at lists.openstack.org>
         <mailto:OpenStack-dev at lists.__openstack.org
    <mailto:OpenStack-dev at lists.openstack.org>>

          >
    http://lists.openstack.org/__cgi-bin/mailman/listinfo/__

openstack-dev

openstack-dev>

         _________________________________________________
         OpenStack-dev mailing list
    OpenStack-dev at lists.openstack.__org
    <mailto:OpenStack-dev at lists.openstack.org>
         <mailto:OpenStack-dev at lists.__openstack.org
    <mailto:OpenStack-dev at lists.openstack.org>>

    http://lists.openstack.org/__cgi-bin/mailman/listinfo/__

openstack-dev

    > openstack-dev>




    --
    Thanks,

    Jay


    _________________________________________________
    OpenStack-dev mailing list
    OpenStack-dev at lists.openstack.__org
    <mailto:OpenStack-dev at lists.openstack.org>
    http://lists.openstack.org/__cgi-bin/mailman/listinfo/__

openstack-dev

openstack-dev>

_________________________________________________
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.__org
<mailto:OpenStack-dev at lists.openstack.org>
http://lists.openstack.org/__cgi-bin/mailman/listinfo/__openstack-dev<

http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

--
Thanks,

Jay


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

--
Thanks,

Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL:

responded Feb 19, 2014 by Jay_Lau (7,320 points)   1 8 11
0 votes

Hi Liu Dong,

Just found a solution for this as following, the method is using fixed ip
as a bridge for MAC and floating ip.

Can you please help check if it is the way that you want me to do? If not,
can you please give some suggestion for your idea?

Thanks,

Jay

==============My steps==============
Suppose I want to bind MAC fa:16:3e:9d:e9:11 to floating ip 9.21.52.22, I
was doing as following:

1) Create a port for fixed ip with the MAC address fa:16:3e:9d:e9:11
[root at db01b05 ~(keystoneadmin)]# neutron port-create IntAdmin
--mac-address fa:16:3e:9d:e9:11 --fixed-ip ip
address=10.0.1.2
Created a new port:
+-----------------------+---------------------------------------------------------------------------------+
| Field |
Value
|
+-----------------------+---------------------------------------------------------------------------------+
| adminstateup |
True
|
| allowedaddresspairs
|
|
| binding:capabilities | {"portfilter":
true} |
| binding:host
id
|
|
| binding:viftype |
ovs
|
| device
id
|
|
| deviceowner
|
|
| fixed
ips | {"subnetid":
"0fff20f4-142a-4e89-add1-5c5a79c6d54d", "ip
address": "10.0.1.2"} |
| id |
b259770d-7f9c-485a-8f84-bf7b1bbc5706
|
| macaddress |
fa:16:3e:9d:e9:11
|
| name
|
|
| network
id |
fb1a75f9-e468-408b-a172-5d2b3802d862
|
| securitygroups |
aa3f3025-ba71-476d-a126-25a9e3b34c9a
|
| status |
DOWN
|
| tenant
id |
f181a9c2b1b4443dbd91b1b7de716185
|
+-----------------------+---------------------------------------------------------------------------------+
[root at db01b05 ~(keystoneadmin)]# neutron port-list | grep 10.0.1.2
| b259770d-7f9c-485a-8f84-bf7b1bbc5706 | | fa:16:3e:9d:e9:11 |
{"subnet
id": "0fff20f4-142a-4e89-add1-5c5a79c6d54d", "ip_address":
"10.0.1.2"} |

2) Create a floating ip with the port id created in step 1)
[root at db01b05 ~(keystoneadmin)]# neutron floatingip-create --port-id
b259770d-7f9c-485a-8f84-bf7b1bbc5706 Ex
Created a new floatingip:
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| fixed
ipaddress | 10.0.1.2 |
| floating
ipaddress | 9.21.52.22 |
| floating
networkid | 9b758062-2be8-4244-a5a9-3f878f74e006 |
| id | 7c0db4ff-8378-4b91-9a6e-87ec06016b0f |
| port
id | b259770d-7f9c-485a-8f84-bf7b1bbc5706 |
| routerid | 43ceb267-2a4b-418a-bc9a-08d39623d3c0 |
| tenant
id | f181a9c2b1b4443dbd91b1b7de716185 |
+---------------------+--------------------------------------+

3) Boot the VM with the port id in step 1)
[root at db01b05 ~(keystoneadmin)]# nova boot --image
centos64-x86
64-cfntools --flavor 2 --key-name adminkey --nic
port-id=b259770d-7f9c-485a-8f84-bf7b1bbc5706 vm0001
+--------------------------------------+--------------------------------------+
| Property |
Value |
+--------------------------------------+--------------------------------------+
| OS-EXT-STS:taskstate |
scheduling |
| image |
centos64-x86
64-cfntools |
| OS-EXT-STS:vmstate |
building |
| OS-EXT-SRV-ATTR:instance
name |
instance-00000026 |
| OS-SRV-USG:launchedat |
None |
| flavor |
m1.small |
| id |
c0cebd6b-94ae-4305-8619-c013d45f0727 |
| security
groups | [{u'name':
u'default'}] |
| userid |
345dd87da2364fa78ffe97ed349bb71b |
| OS-DCF:diskConfig |
MANUAL |
| accessIPv4
| |
| accessIPv6
| |
| progress |
0 |
| OS-EXT-STS:power
state |
0 |
| OS-EXT-AZ:availabilityzone |
nova |
| config
drive
| |
| status |
BUILD |
| updated |
2014-02-19T10:12:36Z |
| hostId
| |
| OS-EXT-SRV-ATTR:host |
None |
| OS-SRV-USG:terminatedat |
None |
| key
name |
adminkey |
| OS-EXT-SRV-ATTR:hypervisorhostname |
None |
| name |
vm0001 |
| adminPass |
F4cSHu9oC3Wi |
| tenant
id |
f181a9c2b1b4443dbd91b1b7de716185 |
| created |
2014-02-19T10:12:36Z |
| os-extended-volumes:volumes_attached |
[] |
| metadata |
{} |
+--------------------------------------+--------------------------------------+

4) The VM goes to active with floating ip 9.21.52.22
[root at db01b05 ~(keystone_admin)]# nova list
+--------------------------------------+--------+--------+------------+-------------+-------------------------------+
| ID | Name | Status | Task State |
Power State | Networks |
+--------------------------------------+--------+--------+------------+-------------+-------------------------------+
| c0cebd6b-94ae-4305-8619-c013d45f0727 | vm0001 | ACTIVE | None |
Running | IntAdmin=10.0.1.2, 9.21.52.22 |
+--------------------------------------+--------+--------+------------+-------------+-------------------------------+

5) Check the VM MAC address, it is FA:16:3E:9D:E9:11 as expected
[root at db01b05 ~(keystoneadmin)]# ssh -i adminkey.priv root at 9.21.52.22
ssh: connect to host 9.21.52.22 port 22: Connection refused
[root at db01b05 ~(keystone
admin)]# ssh -i adminkey.priv root at 9.21.52.22
Last login: Wed Feb 19 18:14:00 2014
[root at host-10-0-1-2 ~]# ifconfig
eth0 Link encap:Ethernet HWaddr FA:16:3E:9D:E9:11
inet addr:10.0.1.2 Bcast:10.0.1.255 Mask:255.255.255.0
inet6 addr: fe80::f816:3eff:fe9d:e911/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:43 errors:0 dropped:0 overruns:0 frame:0
TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6402 (6.2 KiB) TX bytes:6483 (6.3 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:352 (352.0 b) TX bytes:352 (352.0 b)

2014-02-19 17:59 GMT+08:00 Jay Lau <jay.lau.513 at gmail.com>:

Thanks Liu Dong.

It is a VM mac address, so do you have any idea for how can I make sure
the VM mac address can bind to a floating ip address?

Also what do you mean by floatingip mac?

Really thanks very much for your kind help, it is really helped me a lot!

Thanks,

Jay

2014-02-19 16:21 GMT+08:00 Dong Liu :

Jay, what the mac belong to? Is it a vm mac, or a mac of floatingip.

If it is a vm mac, you can associate any floatingip to vm port.
If it is a floatingip mac, I have no idea.

2014-02-19 11:44, Jay Lau :

Thanks Liu Dong.

In case that you may not get my previous question, so here just post it
again to see if you can give a help.

Is it possible to bind MAC to a FLOATING IP?

Thanks,

Jay

2014-02-19 10:38 GMT+08:00 Dong Liu >:

yes, it does not worked via dashboard

Dong Liu

? 2014-02-19 8:11, Jay Lau ??:

    Thanks Dong for the great help, it does worked with command line!

    This seems not available via dashboard, right?

    Thanks,

    Jay



    2014-02-19 1:11 GMT+08:00 Dong Liu <willowd878 at gmail.com
    <mailto:willowd878 at gmail.com>
    <mailto:willowd878 at gmail.com <mailto:willowd878 at gmail.com>>>__:



         Hi Jay,

         In neutron API, you could create port with specified
    mac_address and
         fix_ip, and then create vm with this port.
         But the mapping of them need to manage by yourself.


         ? 2014?2?18??22:41?Jay Lau <jay.lau.513 at gmail.com
    <mailto:jay.lau.513 at gmail.com>
         <mailto:jay.lau.513 at gmail.com
    <mailto:jay.lau.513 at gmail.com>>__> ???



          > Greetings,
          >
          > Not sure if it is suitable to ask this question in
    openstack-dev
         list. Here come a question related to network and want to
    get some
         input or comments from you experts.
          >
          > My case is as this: For some security issue, I want to
    put both
         MAC and internal IP address to a pool and when create VM, I
    can get
         MAC and its mapped IP address and assign the MAC and IP
    address to
         the VM.
          >
          > For example, suppose I have following MAC and IP pool:
          > 1) 78:2b:cb:af:78:b0, 192.168.0.10
          > 2) 78:2b:cb:af:78:b1, 192.168.0.11
          > 3) 78:2b:cb:af:78:b2, 192.168.0.12
          > 4) 78:2b:cb:af:78:b3, 192.168.0.13
          >
          > Then I can create four VMs using above MAC and IP
    address, each
         row in above can be mapped to a VM.
          >
          > Does any of you have any idea for the solution of this?
          >
          > --
          > Thanks,
          >
          > Jay
          > _________________________________________________
          > OpenStack-dev mailing list
          > OpenStack-dev at lists.openstack.__org
    <mailto:OpenStack-dev at lists.openstack.org>
         <mailto:OpenStack-dev at lists.__openstack.org
    <mailto:OpenStack-dev at lists.openstack.org>>

          >
    http://lists.openstack.org/__cgi-bin/mailman/listinfo/__

openstack-dev

openstack-dev>

         _________________________________________________
         OpenStack-dev mailing list
    OpenStack-dev at lists.openstack.__org
    <mailto:OpenStack-dev at lists.openstack.org>
         <mailto:OpenStack-dev at lists.__openstack.org
    <mailto:OpenStack-dev at lists.openstack.org>>

    http://lists.openstack.org/__cgi-bin/mailman/listinfo/__

openstack-dev

    >> openstack-dev>




    --
    Thanks,

    Jay


    _________________________________________________
    OpenStack-dev mailing list
    OpenStack-dev at lists.openstack.__org
    <mailto:OpenStack-dev at lists.openstack.org>
    http://lists.openstack.org/__cgi-bin/mailman/listinfo/__

openstack-dev

openstack-dev>

_________________________________________________
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.__org
<mailto:OpenStack-dev at lists.openstack.org>
http://lists.openstack.org/__cgi-bin/mailman/listinfo/__

openstack-dev >> openstack-dev>

--
Thanks,

Jay


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

--
Thanks,

Jay

--
Thanks,

Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL:

responded Feb 19, 2014 by Jay_Lau (7,320 points)   1 8 11
...