New-​Azure​Rm​Route​Config

Creates a route for a route table.

Syntax

New-AzureRmRouteConfig
   [-AddressPrefix <String>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   -Name <String>
   [-NextHopIpAddress <String>]
   -NextHopType <String>
   [<CommonParameters>]

Description

The New-AzureRmRouteConfig cmdlet creates a route for an Azure route table.

Examples

Example 1: Create a route

PS C:\>$Route = New-AzureRmRouteConfig -Name "Route07" -AddressPrefix 10.1.0.0/16 -NextHopType "VnetLocal"
PS C:\> $Route
Name              : Route07
Id                : 
Etag              : 
ProvisioningState : 
AddressPrefix     : 10.1.0.0/16
NextHopType       : VnetLocal
NextHopIpAddress  :

The first command creates a route named Route07, and then stores it in the $Route variable. This route forwards packets to the local virtual network.

The second command displays the properties of the route.

Required Parameters

-Name

Specifies a name for the route.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NextHopType

Specifies how this route forwards packets. The acceptable values for this parameter are:- Internet. The default Internet gateway provided by Azure.

  • None. If you specify this value, the route does not forward packets.
  • VirtualAppliance. A virtual appliance that you add to your Azure virtual network.
  • VirtualNetworkGateway. An Azure server-to-server virtual private network gateway.
  • VnetLocal. The local virtual network. If you have two subnets, 10.1.0.0/16 and 10.2.0.0/16 in the same virtual network, select a value of VnetLocal for each subnet to forward to the other subnet.
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-AddressPrefix

Specifies the destination, in Classless Interdomain Routing (CIDR) format, to which the route applies.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationAction

Specifies how this cmdlet responds to an information event.The acceptable values for this parameter are:- Continue

  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NextHopIpAddress

Specifies the IP address of a virtual appliance that you add to your Azurevirtual network. This route forwards packets to that address. Specify this parameter only if you specify a value of VirtualAppliance for the NextHopType parameter.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False