Set up IPv6 in Xen domU with nat-mode

I have a Xen dom0 with nat-mode and IPv6 enabled. Set up IPv6 in Xen domU is like a classical IPv6 network: add IPv6 addresses on vif interfaces on dom0 and IPv6 addresses on domU (manually or with radvd on dom0). The only tip is how adding IPv6 addresses on vif interfaces which are dynamically created by Xen. Here is my dirty hack to do it on /etc/xen/scripts/vif-nat file:

        [ "$dhcp" != 'no' ] && dhcp_up
        +# Add IPv6 addresses
        +[ "$vif_ip" = '192.168.0.1' ] && ifconfig "$vif" add 2001:6f8:143d:1::101:1234/64
        +[ "$vif_ip" = '192.168.0.2' ] && ifconfig "$vif" add 2001:6f8:143d:2::101:1234/64
        ;;
    offline)

Where $vif_ip is the IP address from domU configuration : vif=[‘ip=192.168.0.1].

I think the best solution is adding ipv6 option to domU configuration. I will consider to open a wishlist bug for that.

Tags: ,

Comments are closed.