The issue you're running into is that MAC addresses must be unique so when a machine is cloned the mac addresses are regenerated. Unfortunately reconfiguring your network config files to reflect the new MAC is not something that vmware tools takes care of. Additionally, CentOS will have seen that there is already an eth0 interface and put the new MAC on a new eth1 interface.
This vmware KB has your issue: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2002767
The fix can be easily scripted and I'm sure access to vcloud automation center or a similar service would facilitate that.
A simple first boot type script that could take care of it would do the following:
- Find the new MAC that was generated (will be configured as eth1 if the VM only has one adapter)
- Replace the MAC in ifcfg-eth0 with the MAC found in ifcfg-eth1
- Remove 70-persistent-net.rules
- Reboot the VM
Script example below:
#!/bin/sh
#Find the MAC that was generated for the clone (assumes only one network adapter added to the VM)
NEW_MAC=`/sbin/ifconfig eth1 |grep -i hwaddr |awk {'print $5'}`
#Replace the MAC in the eth0 file
/bin/sed -i "s/HWADDR.*/HWADDR=$NEW_MAC/" /etc/sysconfig/network-scripts/ifcfg-eth0
#Delete the net rules file
/bin/rm /etc/udev/rules.d/70-persistent-net.rules
So with the notice from Mark, I will answer my own question.
Host setup:
Assign the IPv6 sub block to your virtual bridge, in my example:
Add
<ip family='ipv6' address='2607:beef:be:beef:1::' prefix='96'>
To /etc/libvirt/qemu/networks/default.xml
, use virsh
destroy and rebuild the virbr0 device, in my case it generated a virbr1 device.
Add ip6tables rule:
ip6tables -A FORWARD -m physdev --physdev-is-bridged -j ACCEPT
ip6tables -A FORWARD -i br0 -j ACCEPT
On the VM side:
Add the selected IPv6 Address to your configuration file:
IPV6INIT=yes
IPV6ADDR=2607:beef:be:beef:1::253:8/128
Restart your VM's network interface, it just works.
I guess that because the VM is connecting with outside world via virbr1 interface at host. The gateway on host is br0. With ip6tables rule it will all sort out.
I've compiled step by step guide in my blog, https://luxing.im/adding-ipv6-support-for-kvm-vms/
Best Answer
You have to set the IP in CentOS.
As long as the tools are installed, XenServer will then detect the IP address that you set in the operating system.
Here are a few articles from a quick Google search:
CentOS Network Configuration Online Documentation
How2CentOS.com -- Configure Network