Context: template-specific IPv6 address overriden

Hello,

I have an IPv4/IPv6 virtual network with /24 IPv4 and /64 IPv6 prefixes, so I have set it up for 254 addresses. I want a particular long-term VM to have a fixed IPv4 and IPv6 address. So I made a block of reservations for 64 addresses from that vnet, and in the VM template I set the IP and IPV6_GLOBAL parameters in network/advanced settings.

When I instantiate the VM, the IPv4 address gets propagated to the context.sh file as ETH0_IP variable as expected,
but the IPv6 address is not: the ETH0_IP6 address is not taken from the IPV6_GLOBAL parameter, but instead it is calculated from the IPv6 prefix and MAC address in the EUI-64 format - in context.sh I see something like

ETH0_IP6=‘my_prefix:xxxx:xxxx:xxfe:ffxx:xxxx:xxxx’

(where xx:xx:xx:xx:xx:xx is the MAC address).

How can I override the IPv6 address for a given template? Thanks!

You may define the set of IPv6 address in a AR and request the IP from
there…

Thanks! I am not sure how to do it:

  • I have a VNet with a range of 256 addresses, type IP4_6, /24 IPv4 prefix and /64 IPv6 prefix.
  • when I add another IPv6-only AR, how can I set up the template to use the IPv4 and MAC address from the original AR, and the IPv6 address from the new AR?
  • the AR blocks probably cannot contain 2^64 addresses? I vaguely remember that trying to set up the AR for 10.0.0.0/8 (2^24 addresses) failed with “too many addresses”.

when I add another IPv6-only AR, how can I set up the template to use the
IPv4 and MAC address from the original AR, and the IPv6 address from the
new AR

This is not supported. There is an issue to assign multiple IP’s to the
same interface. You need that feature to implement that. This was initially
planned for 5.0, let see if we can work on it after 5.0

The AR blocks probably cannot contain 2^64 addresses?

The actual limit is the size of the MAC 2^48, we assume that each lease in
a AR will be assigned to a NIC that needs a unique L2 address in that AR.

OK. There is a problem that IPv4 addresses are scarce, so I need the whole /24 for the main AR.

Well, I obviously don’t need to have 2^64 or 2^48 VMs on the same VNet, but I do need to be able to choose the IPv6 address from the whole /64 range.

Regarding IPv6 selection we had a nice discussion here:

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

OpenNebula current approach is to rely on IPv6 autoconfiguration mechanisms
(which is one of the reasons and improvements over IPv4). The standard IPv6
network implementation uses RA or DHCP6 (or a combination of both) to set
the IP and related conf parameters. In this scenario the host part is
generated by the host, e.g. modified EUI64, random…

It seems that some use cases needs to fix both prefix and host id parts. To
address this we want to develop/merge a IPAM module that can interact with
IPAM services or custom IP assignment to deal with these situations.

Cheers