Setting Up IPv6
Networking
vSphere supports both Internet Protocol
version 4 (IPv4) and Internet Protocol version 6 (IPv6) environments. With
IPv6, you can use vSphere features such as NFS in an IPv6 environment.
An IPv6-specific configuration in vSphere involves
providing IPv6 addresses, either by entering static addresses or by using DHCP
for all relevant vSphere networking interfaces. IPv6 addresses can also be
configured using stateless autoconfiguration sent by router advertisement.
You can set up IPv6 networking for a host by
changing the
HostIpConfig.ipV6Config
property, which is a
HostIpConfigIpV6AddressConfiguration
data
object.
HostIpConfigIpV6AddressConfiguration
allows you
to specify whether auto-configuration is enabled, whether DHCP for ipV6
addresses is enabled, and an array of IPv6 addresses (HostIpConfigIpV6Address
data objects).
HostIpConfigIpV6Address
allows you to specify
all aspects of the IPv6 address including the state of the address, the address
(unless DHCP is enabled), life time, operation, origin, and prefix length. See
the
API Reference
. The following code
fragment illustrates setting the VMkernel NIC to get an automatic IPv6 address
from router advertisements and through DHCP. The user provides the IP address
on the command line when calling the program from which the fragment is taken.
The sample retrieves the address using the
cb.get_option
utility
applications call.
IPv6 Setup
private HostVirtualNicSpec createVNicSpecification() { HostVirtualNicSpec vNicSpec = new HostVirtualNicSpec(); HostIpConfig ipConfig = new HostIpConfig(); //setting the vnic to get an automatic ipv6 address from router advertisements // and through dhcp ipV6Config = new HostIpConfigIpV6AddressConfiguration(); ipV6Config.setAutoConfigurationEnabled(true); ipV6Config.setDhcpV6Enabled(true); ipConfig.setIpV6Config(ipV6Config); vNicSpec.setIp(ipConfig); return vNicSpec; ....