Multiple ip address

Hi all,
is possible to assign multiple ip address to a vm? Someone can help me?
Thanks

Hi,

A NIC can only have one IP address, but you can add several NIC interfaces from the same vnet to your VMs.

Hi,

I’m also looked for this point, I would be interessted to know if this is an expected point in a future release of opennebula ?

Sincerly,

LEFEUVRE Sébastien forum@opennebula.org writes:

Hi,

Hello,

I’m also looked for this point, I would be interessted to know if this
is an expected point in a future version of opennebula ?

I was asking something similar for MAC addresses[1].

Regards.

Footnotes:
[1] Backlog #2348: Add static MAC address to - OpenNebula - OpenNebula Development pages

Hi,

Apart from adding more NICs, a user can make a reservation, so effectively
assigning a IP set to a user. Then VMs can use IP’s from the VNET
reservation and within the VM the user can freely use the IPs. Note that
IPs from the VNET reservation will not be assigned for any other VMs if
they are on hold. With the current functinality this can be implemented as
follows:

1.- Create a VNET reservation
2.- Put on hold IPs for extra IP assignment
3.- VMs NICs use the VNET Reservation
4.- Within the VM any IP on hold from the Reservation may be used

This is not probably very convenient, but could be used as a work around
for now…

In order to implement this and leverage the current functionality (quotas,
VNET access control…) this could be implemented by adding a special NIC
type:

NAME = more_ips
NIC = [ NETWORK="myvlan" ]
NIC = [ NETWORK="myvlan", model="dummy" ]

So this VM will get 2 IP’s from myvlan but only one NIC will make into the
deployment file and the hypervisor VM description.

What do you think?

Cheers

This would work, but does not feel as a “natural” / clean solution to me, more like a workaround / hack. I wonder if it would be easily possible to, have context scripts, determine to which interface an extra ip should be added in the case of a VM having multiple real (not dummy) interfaces. Coincidentally I have added #3784 this moring to address this issue (http://dev.opennebula.org/issues/3784).

Hi Steefan,

What would be your proposed interface? Something more in the line with:

NIC = [ NETWORK="public_ipv4", LEASES=2 ]

But you also suggest to have leases from 2 different VNETs, right ?

In this case you would get the first two free IP’s in the NETWORK “public_ipv4”, right? But what if you require two specific IP’s. Can you still use IP=“IP1”, IP=“IP2”, or would that become IP_ALIAS=“IPv4_IP1”, IP_ALIAS=", or IP6_ALIAS1=“IPv6_IP1”, IP6_ALIAS2=“IPv6_IP2” in the case of IPv6.

But you also suggest to have leases from 2 different VNETs, right ?

Yeah, that would be a special case. If you would for example include a (couple) of IP’s from a different VNET / AR on the same interface (for example: 1 VLAN with different subnets (AR’s) in it). You would then need something like:

NIC = [ NETWORK=“public_ipv4”, AR=AR-ID, LEASES=2 ]

or (when requiring specific IP’s)
NIC = [ NETWORK=“public_ipv4”, AR=AR-ID, IP_ALIAS=“IP”, AR=AR-ID,IP_ALIAS2 ]

Now you should have enough flexibility to fullfill (al)most all use cases.

What do think?

Just thinking about the current logic, my first proposal is more a hackish
extension of the current code, granted :wink:

This new interface will require to check through the code, whenever a NIC
is handled is there are more IP’s within (quotas, ACLs checks,
lease/release of addresses etc…) . This requires updates in multiple
parts of the code.

So, from a code point of view adding more NICs is preferred, but still we
need a way to link the addresses to the same physical device. So either we
express that explicitly something like:

NIC = [ NETWORK="public" NAME="main" ]
NIC = [ NETWORK="public" ALIAS="main" ]

Then oned will generate ETH0_IP values for both of them. And we need to
touch only 2 points:

1.- Context generation to duplicate ETHx entries for ALIAS
2.- Deployment file generation to not include ALIAS NICs

This way the rest of the NIC logic remains untouched.

Does this feel more natural?

Cheers

Yes, it does. Less coding makes it easier to implement, less likely to create new bugs, etc.

Thanks!. Updated the issue and moved to the backlog, tentative planning
after current development cycle.

Hi there,
did not see this feature in the backlog (http://dev.opennebula.org/projects/opennebula/search?utf8=✓&q=multiple+ip&scope=&all_words=&all_words=1&titles_only=&issues=1) ,
since 497 days, is the NIC alias feature lying somewhere ?

Regards

Here

http://dev.opennebula.org/issues/3784

Problem with this solution is not working IP Spoofing, because second, third… IP are blocked to use in VM. :frowning: Would be nice to have option to assign more IP to one interface.

Kristian Feldsam opennebula@discoursemail.com writes:

Problem with this solution is not working IP Spoofing, because second, third… IP are blocked to use in VM. :frowning: Would be nice to have option to assign more IP to one interface.

I think it may be related to Backlog #2348: Add static MAC address to - OpenNebula - OpenNebula Development pages

Regards.