<div dir="ltr"><div><div><div>Hi Liu Dong,<br><br></div>Just found a solution for this as following, the method is using fixed ip as a bridge for MAC and floating ip.<br><br></div><div>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?<br>
<br>Thanks,<br><br></div><div>Jay<br></div><div><br></div><div>==============My steps==============<br></div><div>Suppose I want to bind MAC  fa:16:3e:9d:e9:11 to floating ip 9.21.52.22, I was doing as following:<br></div>
<div><br></div><div><u><b>1) Create a port for fixed ip with the MAC address   fa:16:3e:9d:e9:11</b></u></div><div>[root@db01b05 ~(keystone_admin)]#  neutron port-create IntAdmin  --mac-address fa:16:3e:9d:e9:11 --fixed-ip ip_address=10.0.1.2 <br>
Created a new port:<br>+-----------------------+---------------------------------------------------------------------------------+<br>| Field                 | Value                                                                           |<br>
+-----------------------+---------------------------------------------------------------------------------+<br>| admin_state_up        | True                                                                            |<br>
| allowed_address_pairs |                                                                                 |<br>| binding:capabilities  | {"port_filter": true}                                                           |<br>
| binding:host_id       |                                                                                 |<br>| binding:vif_type      | ovs                                                                             |<br>
| device_id             |                                                                                 |<br>| device_owner          |                                                                                 |<br>
| fixed_ips             | {"subnet_id": "0fff20f4-142a-4e89-add1-5c5a79c6d54d", "ip_address": "10.0.1.2"} |<br>| id                    | b259770d-7f9c-485a-8f84-bf7b1bbc5706                                            |<br>
| mac_address           | fa:16:3e:9d:e9:11                                                               |<br>| name                  |                                                                                 |<br>
| network_id            | fb1a75f9-e468-408b-a172-5d2b3802d862                                            |<br>| security_groups       | aa3f3025-ba71-476d-a126-25a9e3b34c9a                                            |<br>
| status                | DOWN                                                                            |<br>| tenant_id             | f181a9c2b1b4443dbd91b1b7de716185                                                |<br>
+-----------------------+---------------------------------------------------------------------------------+<br>[root@db01b05 ~(keystone_admin)]# neutron port-list | grep 10.0.1.2<br>| b259770d-7f9c-485a-8f84-bf7b1bbc5706 |      | fa:16:3e:9d:e9:11 | {"subnet_id": "0fff20f4-142a-4e89-add1-5c5a79c6d54d", "ip_address": "10.0.1.2"}   |<br>
<br><u><b>2) Create a floating ip with the port id created in step 1)</b></u><br>[root@db01b05 ~(keystone_admin)]# neutron floatingip-create --port-id b259770d-7f9c-485a-8f84-bf7b1bbc5706 Ex<br>Created a new floatingip:<br>
+---------------------+--------------------------------------+<br>| Field               | Value                                |<br>+---------------------+--------------------------------------+<br>| fixed_ip_address    | 10.0.1.2                             |<br>
| floating_ip_address | 9.21.52.22                           |<br>| floating_network_id | 9b758062-2be8-4244-a5a9-3f878f74e006 |<br>| id                  | 7c0db4ff-8378-4b91-9a6e-87ec06016b0f |<br>| port_id             | b259770d-7f9c-485a-8f84-bf7b1bbc5706 |<br>
| router_id           | 43ceb267-2a4b-418a-bc9a-08d39623d3c0 |<br>| tenant_id           | f181a9c2b1b4443dbd91b1b7de716185     |<br>+---------------------+--------------------------------------+<br><br><u><b>3) Boot the VM with the port id in step 1)</b></u><br>
[root@db01b05 ~(keystone_admin)]#  nova boot --image centos64-x86_64-cfntools --flavor 2 --key-name adminkey --nic port-id=b259770d-7f9c-485a-8f84-bf7b1bbc5706 vm0001<br>+--------------------------------------+--------------------------------------+<br>
| Property                             | Value                                |<br>+--------------------------------------+--------------------------------------+<br>| OS-EXT-STS:task_state                | scheduling                           |<br>
| image                                | centos64-x86_64-cfntools             |<br>| OS-EXT-STS:vm_state                  | building                             |<br>| OS-EXT-SRV-ATTR:instance_name        | instance-00000026                    |<br>
| OS-SRV-USG:launched_at               | None                                 |<br>| flavor                               | m1.small                             |<br>| id                                   | c0cebd6b-94ae-4305-8619-c013d45f0727 |<br>
| security_groups                      | [{u'name': u'default'}]              |<br>| user_id                              | 345dd87da2364fa78ffe97ed349bb71b     |<br>| OS-DCF:diskConfig                    | MANUAL                               |<br>
| accessIPv4                           |                                      |<br>| accessIPv6                           |                                      |<br>| progress                             | 0                                    |<br>
| OS-EXT-STS:power_state               | 0                                    |<br>| OS-EXT-AZ:availability_zone          | nova                                 |<br>| config_drive                         |                                      |<br>
| status                               | BUILD                                |<br>| updated                              | 2014-02-19T10:12:36Z                 |<br>| hostId                               |                                      |<br>
| OS-EXT-SRV-ATTR:host                 | None                                 |<br>| OS-SRV-USG:terminated_at             | None                                 |<br>| key_name                             | adminkey                             |<br>
| OS-EXT-SRV-ATTR:hypervisor_hostname  | None                                 |<br>| name                                 | vm0001                               |<br>| adminPass                            | F4cSHu9oC3Wi                         |<br>
| tenant_id                            | f181a9c2b1b4443dbd91b1b7de716185     |<br>| created                              | 2014-02-19T10:12:36Z                 |<br>| os-extended-volumes:volumes_attached | []                                   |<br>
| metadata                             | {}                                   |<br>+--------------------------------------+--------------------------------------+<br><br></div><div><u><b>4) The VM goes to active with floating ip 9.21.52.22<br>
</b></u></div><div>[root@db01b05 ~(keystone_admin)]# nova list<br>+--------------------------------------+--------+--------+------------+-------------+-------------------------------+<br>| ID                                   | Name   | Status | Task State | Power State | Networks                      |<br>
+--------------------------------------+--------+--------+------------+-------------+-------------------------------+<br>| c0cebd6b-94ae-4305-8619-c013d45f0727 | vm0001 | ACTIVE | None       | Running     | IntAdmin=10.0.1.2, 9.21.52.22 |<br>
+--------------------------------------+--------+--------+------------+-------------+-------------------------------+<br><br></div><div><u><b>5) Check the VM MAC address, it is FA:16:3E:9D:E9:11 as expected</b></u><br></div>
<div>[root@db01b05 ~(keystone_admin)]# ssh -i adminkey.priv <a href="mailto:root@9.21.52.22">root@9.21.52.22</a> <br>ssh: connect to host 9.21.52.22 port 22: Connection refused<br>[root@db01b05 ~(keystone_admin)]# ssh -i adminkey.priv <a href="mailto:root@9.21.52.22">root@9.21.52.22</a> <br>
Last login: Wed Feb 19 18:14:00 2014<br>[root@host-10-0-1-2 ~]# ifconfig<br>eth0      Link encap:Ethernet  HWaddr FA:16:3E:9D:E9:11  <br>          inet addr:10.0.1.2  Bcast:10.0.1.255  Mask:255.255.255.0<br>          inet6 addr: fe80::f816:3eff:fe9d:e911/64 Scope:Link<br>
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br>          RX packets:43 errors:0 dropped:0 overruns:0 frame:0<br>          TX packets:52 errors:0 dropped:0 overruns:0 carrier:0<br>          collisions:0 txqueuelen:1000 <br>
          RX bytes:6402 (6.2 KiB)  TX bytes:6483 (6.3 KiB)<br> <br>lo        Link encap:Local Loopback  <br>          inet addr:127.0.0.1  Mask:255.0.0.0<br>          inet6 addr: ::1/128 Scope:Host<br>          UP LOOPBACK RUNNING  MTU:16436  Metric:1<br>
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0<br>          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0<br>          collisions:0 txqueuelen:0 <br>          RX bytes:352 (352.0 b)  TX bytes:352 (352.0 b)<br>
 <br><br></div></div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-19 17:59 GMT+08:00 Jay Lau <span dir="ltr"><<a href="mailto:jay.lau.513@gmail.com" target="_blank">jay.lau.513@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Thanks Liu Dong.<br><br></div>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?<br>
<br></div><div>Also what do you mean by floatingip mac?<br>
<br></div><div>Really thanks very much for your kind help, it is really helped me a lot!<br></div><div><br></div>Thanks,<br><br></div>Jay<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-19 16:21 GMT+08:00 Dong Liu <span dir="ltr"><<a href="mailto:willowd878@gmail.com" target="_blank">willowd878@gmail.com</a>></span>:<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Jay, what the mac belong to? Is it a vm mac, or a mac of floatingip.<br>
If it is a vm mac, you can associate any floatingip to vm port.<br>
If it is a floatingip mac, I have no idea.<br>
<br>
2014-02-19 11:44, Jay Lau :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
Thanks Liu Dong.<br>
<br>
In case that you may not get my previous question, so here just post it<br>
again to see if you can give a help.<br>
<br>
Is it possible to bind MAC to a FLOATING IP?<br>
<br>
Thanks,<br>
<br>
Jay<br>
<br>
<br>
<br>
2014-02-19 10:38 GMT+08:00 Dong Liu <<a href="mailto:willowd878@gmail.com" target="_blank">willowd878@gmail.com</a><br></div>
<mailto:<a href="mailto:willowd878@gmail.com" target="_blank">willowd878@gmail.com</a>>><u></u>:<div><br>
<br>
    yes, it does not worked via dashboard<br>
<br>
    Dong Liu<br>
<br>
    于 2014-02-19 8:11, Jay Lau 写道:<br>
<br>
        Thanks Dong for the great help, it does worked with command line!<br>
<br>
        This seems not available via dashboard, right?<br>
<br>
        Thanks,<br>
<br>
        Jay<br>
<br>
<br>
<br>
        2014-02-19 1:11 GMT+08:00 Dong Liu <<a href="mailto:willowd878@gmail.com" target="_blank">willowd878@gmail.com</a><br>
        <mailto:<a href="mailto:willowd878@gmail.com" target="_blank">willowd878@gmail.com</a>><br></div>
        <mailto:<a href="mailto:willowd878@gmail.com" target="_blank">willowd878@gmail.com</a> <mailto:<a href="mailto:willowd878@gmail.com" target="_blank">willowd878@gmail.com</a>>><u></u>>__:<div>
<br>
<br>
<br>
             Hi Jay,<br>
<br>
             In neutron API, you could create port with specified<br>
        mac_address and<br>
             fix_ip, and then create vm with this port.<br>
             But the mapping of them need to manage by yourself.<br>
<br>
<br>
             在 2014年2月18日,22:41,Jay Lau <<a href="mailto:jay.lau.513@gmail.com" target="_blank">jay.lau.513@gmail.com</a><br>
        <mailto:<a href="mailto:jay.lau.513@gmail.com" target="_blank">jay.lau.513@gmail.com</a>><br></div>
             <mailto:<a href="mailto:jay.lau.513@gmail.com" target="_blank">jay.lau.513@gmail.com</a><br>
        <mailto:<a href="mailto:jay.lau.513@gmail.com" target="_blank">jay.lau.513@gmail.com</a>><u></u>>__> 写道:<div><div><br>
<br>
<br>
              > Greetings,<br>
              ><br>
              > Not sure if it is suitable to ask this question in<br>
        openstack-dev<br>
             list. Here come a question related to network and want to<br>
        get some<br>
             input or comments from you experts.<br>
              ><br>
              > My case is as this: For some security issue, I want to<br>
        put both<br>
             MAC and internal IP address to a pool and when create VM, I<br>
        can get<br>
             MAC and its mapped IP address and assign the MAC and IP<br>
        address to<br>
             the VM.<br>
              ><br>
              > For example, suppose I have following MAC and IP pool:<br>
              > 1) 78:2b:cb:af:78:b0, 192.168.0.10<br>
              > 2) 78:2b:cb:af:78:b1, 192.168.0.11<br>
              > 3) 78:2b:cb:af:78:b2, 192.168.0.12<br>
              > 4) 78:2b:cb:af:78:b3, 192.168.0.13<br>
              ><br>
              > Then I can create four VMs using above MAC and IP<br>
        address, each<br>
             row in above can be mapped to a VM.<br>
              ><br>
              > Does any of you have any idea for the solution of this?<br>
              ><br>
              > --<br>
              > Thanks,<br>
              ><br>
              > Jay<br></div></div>
              > ______________________________<u></u>___________________<br>
              > OpenStack-dev mailing list<br>
              > OpenStack-dev@lists.openstack.<u></u>__org<br>
        <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.<u></u>openstack.org</a>><br>
             <mailto:<a href="mailto:OpenStack-dev@lists." target="_blank">OpenStack-dev@lists.</a>__<a href="http://openstack.org" target="_blank"><u></u>openstack.org</a><br>
        <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.<u></u>openstack.org</a>>><br>
<br>
              ><br>
        <a href="http://lists.openstack.org/__cgi-bin/mailman/listinfo/__openstack-dev" target="_blank">http://lists.openstack.org/__<u></u>cgi-bin/mailman/listinfo/__<u></u>openstack-dev</a><br>
        <<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openstack-dev</a>><br>
<br>
<br>
             ______________________________<u></u>___________________<br>
             OpenStack-dev mailing list<br>
        OpenStack-dev@lists.openstack.<u></u>__org<br>
        <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.<u></u>openstack.org</a>><br>
             <mailto:<a href="mailto:OpenStack-dev@lists." target="_blank">OpenStack-dev@lists.</a>__<a href="http://openstack.org" target="_blank"><u></u>openstack.org</a><br>
        <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.<u></u>openstack.org</a>>><br>
<br>
        <a href="http://lists.openstack.org/__cgi-bin/mailman/listinfo/__openstack-dev" target="_blank">http://lists.openstack.org/__<u></u>cgi-bin/mailman/listinfo/__<u></u>openstack-dev</a><div><br>
        <<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openstack-dev</a>><br>
<br>
<br>
<br>
<br>
        --<br>
        Thanks,<br>
<br>
        Jay<br>
<br>
<br></div>
        ______________________________<u></u>___________________<br>
        OpenStack-dev mailing list<br>
        OpenStack-dev@lists.openstack.<u></u>__org<br>
        <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.<u></u>openstack.org</a>><br>
        <a href="http://lists.openstack.org/__cgi-bin/mailman/listinfo/__openstack-dev" target="_blank">http://lists.openstack.org/__<u></u>cgi-bin/mailman/listinfo/__<u></u>openstack-dev</a><br>
        <<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openstack-dev</a>><br>
<br>
<br>
<br>
    ______________________________<u></u>___________________<br>
    OpenStack-dev mailing list<br>
    OpenStack-dev@lists.openstack.<u></u>__org<br>
    <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.<u></u>openstack.org</a>><br>
    <a href="http://lists.openstack.org/__cgi-bin/mailman/listinfo/__openstack-dev" target="_blank">http://lists.openstack.org/__<u></u>cgi-bin/mailman/listinfo/__<u></u>openstack-dev</a> <<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openstack-dev</a>><div>

<br>
<br>
<br>
<br>
<br>
--<br>
Thanks,<br>
<br>
Jay<br>
<br>
<br>
______________________________<u></u>_________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.<u></u>org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openstack-dev</a><br>
<br>
</div></blockquote><div><div>
<br>
<br>
______________________________<u></u>_________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.<u></u>org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openstack-dev</a><br>
</div></div></blockquote></div></div></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div dir="ltr"><div>Thanks,<br><br></div>Jay<br></div>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div>Thanks,<br><br></div>Jay<br></div>
</div>