How to set up IPv6 on an Azure Ubuntu 24.04 VM

J. Laiho 0 Reputation points
2024-06-19T08:37:37.0366667+00:00

I'm running a Ubuntu 24.04 VM. I've set up IPv6 in the Azure VM settings as instructed by the documentation, and it appears to be set up correctly: just as I had private and public IPv4 addresses by default, I now also have private and public IPv6 addresses displayed in all the right places, attached to the VM NIC as far as I can tell.

Booting the VM after this assignment did not make them appear in the ip addr output, however. The private IPv4 address is there, but the private IPv6 is not.

The image is apparently using systemd-networkd for network configuration. I presume that it's not set up to handle IPv6 by default, since the VMs are not given IPv6 addresses by default.

Let's presume for the moment that everything is correctly configured on the Azure web UI side, and it's just the running VM that needs extra configuration.

What do I need to add to /run/systemd/network/ (or possibly elsewhere)? Currently, the relevant file there, 10-netplan-eth0.network contains this default content:

[Match]
Driver=hv_netvsc
PermanentMACAddress=
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,446 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 34,841 Reputation points Microsoft Employee
    2024-06-19T16:50:11.91+00:00

    @J. Laiho

    I launched a new Ubuntu 24.04 and attached an existing NIC with IPv4 and Ipv6 addresses. By default it was able to utilize IPv6.
    User's image

    This is what my network file looks like. Try updating yours to see if it resolves the issue.

    root@vm24041:/home/azureuser# cat /run/systemd/network/10-netplan-eth0.network
    [Match]
    Driver=hv_netvsc
    PermanentMACAddress=60:45:bd:b8:91:40
    Name=eth0
    
    [Network]
    DHCP=yes
    LinkLocalAddressing=ipv6
    
    [DHCP]
    RouteMetric=100
    UseMTU=true
    
    

    If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.

    If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.

    Thank you for helping to improve Microsoft Q&A!

    User's image