[Openstack] [Neutron] one virtual port with two IP, what is the best way to bind the addresses in VM?

Ashok Kumaran ashokkumaran.b at gmail.com
Sun Apr 13 13:57:53 UTC 2014


On Sun, Apr 13, 2014 at 11:06 AM, sylecn <sylecn at gmail.com> wrote:

> Hi all,
>
> neutron port-create usually allocate one IP with one port, but in a recent
> use case, I need to allocate two IP addresses on one port. I am glade to
> see it is already supported by neutron.
>
> Didn't you try something like this ?
neutron port-create --fixed-ip subnet_id=<subnet1> --fixed-ip
subnet_id=<subnet1> net1

now use the above port in nova boot as nic port id. I dont see any reason
why this shouldnt work, I havent tried this myself though, let me know the
outcome


> The vm also boots fine with the virtual port. Problem is vm is configured
> to get address from DHCP and only one address is offered and binded to eth0
> automatically. What is the best way to bind both IPs in a automated way?
>
> I could think of two solutions:
> 1. create the port and pass in both IPs via userdata to nova api.
>     Use system commands to bind the 2nd IP.
>
> 2. enhance metadata service to return all IP addresses instead of only the
> first IP.
>     For example,
>
> curl http://169.254.169.254/openstack/2013-10-17/ips.json
>
> [["eth0", ["192.168.1.5", "10.0.1.5"]]
>  ["eth1": ["172.17.1.5"]]]
>
>     Use cloud-init to bind all IPs that is not binded by DHCP client.
>
> What's your advice on this? Are there any neutron or DHCP extensions that
> can help on this?
>
>
> *YY Inc. is hiring openstack and python developers. Interested? Check
> http://www.nsbeta.info/jobs <http://www.nsbeta.info/jobs>*
>
> --
> Thanks,
> Yuanle
>
> _______________________________________________
> Mailing list:
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to     : openstack at lists.openstack.org
> Unsubscribe :
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
>
> Best
Ashok
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20140413/a7057cdf/attachment.html>


More information about the Openstack mailing list