New-​Azure​Rm​Network​Interface

Creates a network interface.

Syntax

New-AzureRmNetworkInterface
   [-ApplicationGatewayBackendAddressPool <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayBackendAddressPool]>]
   [-DnsServer <System.Collections.Generic.List`1[System.String]>]
   [-EnableAcceleratedNetworking]
   [-EnableIPForwarding]
   [-Force]
   [-InternalDnsNameLabel <String>]
   [-IpConfigurationName <String>]
   [-LoadBalancerBackendAddressPool <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSBackendAddressPool]>]
   [-LoadBalancerInboundNatRule <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSInboundNatRule]>]
   -Location <String>
   -Name <String>
   [-NetworkSecurityGroup <PSNetworkSecurityGroup>]
   [-PrivateIpAddress <String>]
   [-PublicIpAddress <PSPublicIpAddress>]
   -ResourceGroupName <String>
   -Subnet <PSSubnet>
   [-Tag <Hashtable>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzureRmNetworkInterface
   [-ApplicationGatewayBackendAddressPoolId <System.Collections.Generic.List`1[System.String]>]
   [-DnsServer <System.Collections.Generic.List`1[System.String]>]
   [-EnableAcceleratedNetworking]
   [-EnableIPForwarding]
   [-Force]
   [-InternalDnsNameLabel <String>]
   [-IpConfigurationName <String>]
   [-LoadBalancerBackendAddressPoolId <System.Collections.Generic.List`1[System.String]>]
   [-LoadBalancerInboundNatRuleId <System.Collections.Generic.List`1[System.String]>]
   -Location <String>
   -Name <String>
   [-NetworkSecurityGroupId <String>]
   [-PrivateIpAddress <String>]
   [-PublicIpAddressId <String>]
   -ResourceGroupName <String>
   -SubnetId <String>
   [-Tag <Hashtable>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzureRmNetworkInterface
   [-DnsServer <System.Collections.Generic.List`1[System.String]>]
   [-EnableAcceleratedNetworking]
   [-EnableIPForwarding]
   [-Force]
   [-InternalDnsNameLabel <String>]
   -IpConfiguration <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSNetworkInterfaceIPConfiguration]>
   -Location <String>
   -Name <String>
   -ResourceGroupName <String>
   [-Tag <Hashtable>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
New-AzureRmNetworkInterface
   [-DnsServer <System.Collections.Generic.List`1[System.String]>]
   [-EnableAcceleratedNetworking]
   [-EnableIPForwarding]
   [-Force]
   [-InternalDnsNameLabel <String>]
   -IpConfiguration <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSNetworkInterfaceIPConfiguration]>
   -Location <String>
   -Name <String>
   [-NetworkSecurityGroup <PSNetworkSecurityGroup>]
   [-NetworkSecurityGroupId <String>]
   -ResourceGroupName <String>
   [-Tag <Hashtable>]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

The New-AzureRmNetworkInterface cmdlet creates an Azure network interface.

Examples

Example 1: Create an Azure network interface

PS C:\>New-AzureRmNetworkInterface -Name "NetworkInterface1" -ResourceGroupName "ResourceGroup1" -Location "centralus" -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup1/providers/Microsoft.Network/virtualNetworks/VirtualNetwork1/subnets/Subnet1" -IpConfigurationName "IPConfiguration1" -DnsServer "8.8.8.8", "8.8.4.4"

This command creates a network interface named NetworkInterface001 with a dynamically assigned private IP address from Subnet1 in the virtual network named VirtualNetwork1. The command also assigns two DNS servers to the network interface. The IPConfiguration child resource will be created automatically using the name IPConfiguration1.

Example 2: Create an Azure network interface using an IP configuration object

PS C:\>$IPconfig = New-AzureRmNetworkInterfaceIpConfig -Name "IPConfig1" -PrivateIpAddressVersion IPv4 -PrivateIpAddress "10.0.1.10" -SubnetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup1/providers/Microsoft.Network/virtualNetworks/VirtualNetwork1/subnets/Subnet1"
PS C:\> New-AzureRmNetworkInterface -Name "NetworkInterface1" -ResourceGroupName "ResourceGroup1" -Location "centralus" -IpConfiguration $IPconfig

This example creates a new network interface using an IP configuration object. The IP configuration object specifies a static private IPv4 address.

The first command creates a network interface IP configuration named IPConfig1 and stores the configuration in the variable named $IPconfig.

The second command creates a network interface named NetworkInterface1 that uses the network interface IP configuration stored in the variable named $IPconfig.

Required Parameters

-IpConfiguration

Specifies the IP configuration that this cmdlet uses for the network interface.

Type:System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSNetworkInterfaceIPConfiguration]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Location

Specifies the region for a network interface.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies the name of the network interface to create.

Type:String
Aliases:ResourceName
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of a resource group that the network interface belongs to.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Subnet

Specifies a Subnet object. This cmdlet creates a network interface for the subnet that this parameter specifies.

Type:PSSubnet
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SubnetId

Specifies the ID of the subnet for which to create a network interface.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ApplicationGatewayBackendAddressPool

Specifies an ApplicationGatewayBackendAddressPool object.

Type:System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayBackendAddressPool]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ApplicationGatewayBackendAddressPoolId

Specifies the ID of a ApplicationGatewayBackendAddressPool object.

Type:System.Collections.Generic.List`1[System.String]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DnsServer

Specifies the DNS server for the network interface.

Type:System.Collections.Generic.List`1[System.String]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-EnableAcceleratedNetworking

Enables accelerated networking.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EnableIPForwarding

Indicates that this cmdlet enables IP forwarding for the network interface. IP forwarding allows a virtual machine to receive traffic addressed to other destinations.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

Forces the creation of the network interface even if a network interface with the same name already exists.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InternalDnsNameLabel

Specifies the internal DNS name label for the new network interface.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-IpConfigurationName

Specifies the name of an IP configuration.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-LoadBalancerBackendAddressPool

Specifies a BackendAddressPool object.

Type:System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSBackendAddressPool]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-LoadBalancerBackendAddressPoolId

Specifies the ID of a BackendAddressPool object.

Type:System.Collections.Generic.List`1[System.String]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-LoadBalancerInboundNatRule

Specifies an inbound NAT rule configuration for a load balancer.

Type:System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSInboundNatRule]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-LoadBalancerInboundNatRuleId

Specifies the ID of an inbound NAT rule configuration for a load balancer.

Type:System.Collections.Generic.List`1[System.String]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-NetworkSecurityGroup

Specifies a NetworkSecurityGroup object.

Type:PSNetworkSecurityGroup
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-NetworkSecurityGroupId

Specifies the ID of a network security group.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PrivateIpAddress

Specifies a static IPv4 IP address to assign to this network interface.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PublicIpAddress

Specifies a PublicIPAddress object to assign to a network interface.

Type:PSPublicIpAddress
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PublicIpAddressId

Specifies the ID of a PublicIPAddress object to assign to a network interface.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Tag

Specifies a dictionary of tags to associate with a network interface.

Type:Hashtable
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False