Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this article, you create a virtual machine in Azure with the Azure portal. The virtual machine is created along with the dual-stack network as part of the procedures. You choose from the Azure portal, Azure CLI, or Azure PowerShell to complete the steps in this article. When completed, the virtual machine supports IPv4 and IPv6 communication.
- An Azure account with an active subscription. Create an account.
In this section, you create a resource group and dual-stack virtual network for the virtual machine in the Azure portal.
Sign-in to the Azure portal.
In the search box at the top of the portal, enter Virtual network. Select Virtual networks in the search results.
Select + Create.
In the Basics tab of Create virtual network, enter or select the following information.
Setting Value Project details Subscription Select your subscription. Resource group Select Create new.
In Name, enter myResourceGroup.
Select OK.Instance details Name Enter myVNet. Region Select China North 3. Select the IP Addresses tab, or Next>Next.
Leave the default IPv4 address space of 10.0.0.0/16. If the default is absent or different, enter an IPv4 address space of 10.0.0.0/16.
Select the default subnet.
On the Edit subnet page, enter myBackendSubnet in Subnet name and select Save.
Select Add IPv6 address space from the dropdown menu.
In IPv6 address space, edit the default address space and change its value to 2404:f800:8000:122::/63.
To add an IPv6 subnet, select + Add a subnet and enter or select the following information:
Setting Value Subnet Subnet name Enter myBackendSubnet. Address range Leave default of 2404:f800:8000:122::. Size Leave the default of /64. Select Add.
Select the Review + create.
Select Create.
You create two public IP addresses in this section, IPv4 and IPv6 in the Azure portal.
In the search box at the top of the portal, enter Public IP address. Select Public IP addresses in the search results.
Select + Create.
Enter or select the following information in Create public IP address.
Setting Value Project details Subscription Select your subscription. Resource group Select myResourceGroup. Location Select China North 3. Availability zone Select Zone redundant. Instance details Name Enter myPublicIP-IPv4. IP version Select IPv4. SKU Leave the default of Standard. Tier Leave the default of Regional. IP address assignment Routing preference Leave the default of Microsoft network. Idle timeout (minutes) Leave the default of 4. DNS name label Enter myPublicIP-IPv4. Select Review + create then Create.
In the search box at the top of the portal, enter Public IP address. Select Public IP addresses in the search results.
Select + Create.
Enter or select the following information in Create public IP address.
Setting Value Project details Subscription Select your subscription. Resource group Select myResourceGroup. Location Select China North 3. Availability zone Select Zone redundant. Instance details Name Enter myPublicIP-IPv6. IP version Select IPv6. SKU Leave the default of Standard. Tier Leave the default of Regional. IP address assignment DNS name label Enter myPublicIP-IPv6. Select Review + create then Create.
In this section, you create the virtual machine and its supporting resources.
In the search box at the top of the portal, enter Virtual machine. Select Virtual machines in the search results.
Select + Create then Azure virtual machine.
In the Basics tab, enter or select the following information.
Setting Value Project details Subscription Select your subscription. Resource group Select myResourceGroup. Instance details Virtual machine name Enter myVM. Region Select China North 3. Availability options Select No infrastructure redundancy required. Security type Select Standard. Image Select Ubuntu Server 20.04 LTS - Gen2. Size Select the default size. Administrator account Authentication type Select SSH public key. Username Enter a username. SSH public key source Select Generate new key pair. Key pair name Enter mySSHKey. Inbound port rules Public inbound ports Select None. Select the Networking tab, or Next: Disks then Next: Networking.
Enter or select the following information in the Networking tab.
Setting Value Network interface Virtual network Select myVNet. Subnet Select myBackendSubnet (10.1.0.0/24,2404:f800:8000:122:/64). Public IP Select myPublicIP-IPv4. NIC network security group Select Advanced. Configure network security group Select Create new.
Enter myNSG in Name.
Select OK.Select Review + create.
Select Create.
Generate new key pair appears. Select Download private key and create resource.
The private key downloads to your local computer. Copy the private key to a directory on your computer. In the following example, it's ~/.ssh.
A network interface is automatically created and attached to the chosen virtual network during creation. In this section, you add the IPv6 configuration to the existing network interface.
In the search box at the top of the portal, enter Virtual machine. Select Virtual machines in the search results.
Select myVM or your existing virtual machine name.
Select Networking in Settings.
The name of your default network interface will be myvmxx, with xx a random number. In this example, it's myvm281. Select myvm281 next to Network Interface:.
In the properties of the network interface, select IP configurations in Settings.
In IP configurations, select + Add.
In Add IP configuration, enter or select the following information.
Setting Value Name Enter Ipv6config. IP version Select IPv6. Private IP address settings Allocation Leave the default of Dynamic. Public IP address Select Associate. Public IP address Select myPublicIP-IPv6. Select OK.
You connect to the virtual machine with SSH to test the IPv4 public IP address.
In the search box at the top of the portal, enter Public IP address. Select Public IP addresses in the search results.
Select myPublicIP-IPv4.
The public IPv4 address is in the Overview in IP address. In this example it's, 20.22.46.19.
Open an SSH connection to the virtual machine by using the following command. Replace the IP address with the IP address of your virtual machine. Replace
azureuser
with the username you chose during virtual machine creation. The-i
is the path to the private key that you downloaded earlier. In this example, it's ~/.ssh/mySSHKey.pem.ssh -i ~/.ssh/mySSHkey.pem azureuser@20.22.46.19
When your finished with the resources created in this article, delete the resource group and all of the resources it contains:
In the search box at the top of the portal, enter myResourceGroup. Select myResourceGroup in the search results in Resource groups.
Select Delete resource group.
Enter myResourceGroup for TYPE THE RESOURCE GROUP NAME and select Delete.
In this article, you learned how to create an Azure Virtual machine with a dual-stack network.
For more information about IPv6 and IP addresses in Azure, see: