Azure Network Interface (NIC)
An Azure Network Interface (NIC) serves as the connection point between a Virtual Machine (VM) and Azure’s underlying software network. Each Azure VM can have one or more NICs, which can be assigned various types of IP addresses.
1. Configuring the Network Interface
Virtual Network & Subnets
- A NIC must be associated with a Virtual Network (VNet) and a Subnet.
- Once a NIC is deployed into a VNet, its association cannot be changed.
IP Configuration
- Public and Private IP Addresses: Each NIC can have one or more static or dynamic public and private IP addresses.
- Primary & Secondary IP Configurations: You can assign multiple IP configurations to a NIC, designating one as primary.
Network Security Group (NSG) & Routes
- You can associate one NSG with each NIC and apply multiple routes to manage traffic.
IP Forwarding
- IP forwarding must be enabled for any NIC attached to a virtual machine to allow the NIC to forward traffic.
DNS Servers
- You can specify DNS servers that Azure’s DHCP servers will assign to the NIC.
2. IP Addresses
Types of IP Addresses
- Private IP Addressing: Allows communication between VMs and other resources within the same VNet or connected networks.
- Public IP Addressing: Enables inbound communication from the internet and outbound connectivity with a predictable IP address.
Address Assignment
- Dynamic IP Addresses: Automatically assigned from the subnet’s address space and released when the public IP resource is dissociated.
- Static IP Addresses: Manually assigned from the subnet’s address space and remain assigned to the resource until explicitly changed.
3. Hostname Resolution
DNS Domain Name Label
- You can specify a DNS domain name label for a public IP resource, which maps to a public IP address in Azure’s managed DNS servers (e.g.,
domainnamelabel.location.cloudapp.azure.com
).
Internal DNS Hostname Resolution
- By default, Azure VMs use Azure-managed DNS servers, which provide internal name resolution for VMs within the same VNet. This allows you to use a VM’s name instead of its private IP address for communication (e.g., Remote Desktop Protocol or RDP).
4. Configuring Multiple NICs and IP Addresses for a VM
Step-by-Step Instructions
Step 1: Create a Network Interface
- Go to the Azure portal and click on the Create a resource button.
- Type in Network Interface and select it from the dropdown list.
- Click on the Create button.
Step 2: Fill in Required Details
- On the NIC creation page, provide the necessary details such as:
- Name of the NIC
- Resource Group (select or create a new one)
- Region where the NIC will be deployed
- Select the desired VNet and Subnet
- Configure IP settings (Public and Private IP addresses as needed).
- Click on Create to deploy the NIC.
Step 3: Confirm NIC Creation
- Your Network Interface will be created and ready for use.
Step 4: Create a Public IP Address
- Return to the Azure portal home page.
- Click on the Create a resource button.
- Type in Public IP address and select it.
- Click on Create.
Step 5: Fill in Public IP Details
- On the public IP address creation page, provide the required details such as:
- Name of the public IP
- SKU (Basic or Standard)
- IP address assignment (Dynamic or Static).
- Click on Create to deploy the public IP address.
Step 6: Associate NIC with Public IP
- After creating both the NIC and Public IP address, you can associate them with the virtual machine as part of the VM setup process.