< Back

Set-AzureRmVirtualNetworkGatewayDefaultSite

Tue Jan 29, 2019 9:58 pm

NAME Set-AzureRmVirtualNetworkGatewayDefaultSite



SYNOPSIS

Sets the default site for a virtual network gateway.





SYNTAX

Set-AzureRmVirtualNetworkGatewayDefaultSite [-DefaultProfile <IAzureContextContainer>] -GatewayDefaultSite <PSLocalNetworkGateway>

-VirtualNetworkGateway <PSVirtualNetworkGateway> [<CommonParameters>]





DESCRIPTION

The Set-AzureRmVirtualNetworkGatewayDefaultSite cmdlet assigns a forced tunneling default site to a virtual network gateway. Forced tunneling

provides a way for you to redirect Internet-bound traffic from Azure virtual machines to your on-premises network; this enables you to inspect and

audit traffic before releasing it. Forced tunneling is carried out by using a virtual private network (VPN) tunnel; this tunnel requires a default

site, a local gateway where all the Azure Internet-bound traffic is redirected. Set-AzureRmVirtualNetworkGatewayDefaultSite provides a way to

change the default site assigned to a gateway.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-GatewayDefaultSite <PSLocalNetworkGateway>

Specifies an object reference to the local network gateway to be assigned as the default site for the specified virtual network. You can use

the Get-AzureRmLocalNetworkGateway cmdlet to create an object reference to a local gateway.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-VirtualNetworkGateway <PSVirtualNetworkGateway>

Specifies an object reference to the virtual network gateway where the default site will be assigned. You can create an object reference to a

virtual network gateway by using the Get-AzureRmVirtualNetworkGateway and specifying the name of the gateway.



The variable $VirtualGateway can then be used as the parameter value for the VirtualNetworkGateway parameter:



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



This cmdlet accepts pipelined instances of the Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGateway object.





OUTPUTS



This cmdlet modifies existing instances of the Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGateway object.





NOTES









Example 1: Assign a default site to a virtual network gateway



PS C:\\>$LocalGateway = Get-AzureRmLocalNetworkGateway -Name "ContosoLocalGateway " -ResourceGroup "ContosoResourceGroup"

PS C:\\> $VirtualGateway = Get-AzureRmVirtualNetworkGateway -Name "ContosoVirtualGateway"

PS C:\\> Set-AzureRmVirtualNetworkGatewayDefaultSite -GatewayDefaultSite $LocalGateway -VirtualNetworkGateway $VirtualGateway



This example assigns a default site to a virtual network gateway named ContosoVirtualGateway.



The first command creates an object reference to a local gateway named ContosoLocalGateway. This object reference that is stored in the variable

named $LocalGateway represents the gateway to be configured as the default site



. The second command then creates an object reference to the virtual network gateway and stores the result in the variable named $VirtualGateway.



The third command uses the Set-AzureRmVirtualNetworkGatewayDefaultSite cmdlet to assign the default site to ContosoVirtualGateway.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... efaultsite

Get-AzureRmLocalNetworkGateway

Get-AzureRmVirtualNetworkGateway

Remove-AzureRmVirtualNetworkGatewayDefaultSite