New-AzVpnSiteLinkConnection
Skapar ett Azure VpnSiteLink Anslut ion-objekt.
Syntax
New-AzVpnSiteLinkConnection
-Name <String>
-VpnSiteLink <PSVpnSiteLink>
[-SharedKey <SecureString>]
[-ConnectionBandwidth <UInt32>]
[-RoutingWeight <UInt32>]
[-IpSecPolicy <PSIpsecPolicy>]
[-VpnConnectionProtocolType <String>]
[-EnableBgp]
[-UseLocalAzureIpAddress]
[-UsePolicyBasedTrafficSelectors]
[-IngressNatRule <PSResourceId[]>]
[-EgressNatRule <PSResourceId[]>]
[-VpnGatewayCustomBgpAddress <PSGatewayCustomBgpIpConfiguration[]>]
[-VpnLinkConnectionMode <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Skapar ett Azure VpnSiteLink Anslut ion-objekt.
Exempel
Exempel 1
New-AzResourceGroup -Location "West US" -Name "testRG"
$virtualWan = New-AzVirtualWan -ResourceGroupName testRG -Name myVirtualWAN -Location "West US"
$virtualHub = New-AzVirtualHub -VirtualWan $virtualWan -ResourceGroupName "testRG" -Name "westushub" -AddressPrefix "10.0.0.1/24"
New-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw" -VirtualHubId $virtualHub.Id -VpnGatewayScaleUnit 2
$vpnGateway = Get-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw"
$vpnSiteAddressSpaces = New-Object string[] 2
$vpnSiteAddressSpaces[0] = "192.168.2.0/24"
$vpnSiteAddressSpaces[1] = "192.168.3.0/24"
$vpnSiteLink = New-AzVpnSiteLink -Name "testVpnSiteLink1" -IpAddress "15.25.35.45" -LinkProviderName "SomeTelecomProvider" -LinkSpeedInMbps "10"
$vpnSite = New-AzVpnSite -ResourceGroupName "testRG" -Name "testVpnSite" -Location "West US" -VirtualWan $virtualWan -AddressSpace $vpnSiteAddressSpaces -DeviceModel "SomeDevice" -DeviceVendor "SomeDeviceVendor" -VpnSiteLink @($vpnSiteLink)
$vpnSiteLinkConnection = New-AzVpnSiteLinkConnection -Name "testLinkConnection1" -VpnSiteLink $vpnSite.VpnSiteLinks[0] -ConnectionBandwidth 100
New-AzVpnConnection -ResourceGroupName $vpnGateway.ResourceGroupName -ParentResourceName $vpnGateway.Name -Name "testConnection" -VpnSite $vpnSite -VpnSiteLinkConnection @($vpnSiteLinkConnection)
Ovanstående skapar en resursgrupp, Virtual WAN, Virtual Network, Virtual Hub och en VpnSite med 1 VpnSiteLinks i USA, västra i resursgruppen "testRG" i Azure. Därefter skapas en VPN-gateway i den virtuella hubben. När gatewayen har skapats är den ansluten till VpnSite med kommandot New-AzVpn Anslut ion med 1 VpnSiteLink Anslut ions till VpnSiteLink i VpnSite.
Exempel 2 VpnGatewayCustomBgpAddress
$vpnSite = Get-AzVpnSite -ResourceGroupName PS_testing -Name testsite
$vpnGateway = Get-AzVpnGateway -ResourceGroupName PS_testing -Name 196ddf92afae40e4b20edc32dfb48a63-eastus-gw
$address = New-AzGatewayCustomBgpIpConfigurationObject -IpConfigurationId "Instance0" -CustomBgpIpAddress "169.254.22.1"
$address2 = New-AzGatewayCustomBgpIpConfigurationObject -IpConfigurationId "Instance1" -CustomBgpIpAddress "169.254.22.3"
$vpnSiteLinkConnection = New-AzVpnSiteLinkConnection -Name "testLinkConnection1" -VpnSiteLink $vpnSite.VpnSiteLinks[0] -ConnectionBandwidth 100 -VpnGatewayCustomBgpAddress $address,$address2 -EnableBgp
New-AzVpnConnection -ResourceGroupName $vpnGateway.ResourceGroupName -ParentResourceName $vpnGateway.Name -Name "testConnection" -VpnSite $vpnSite -VpnSiteLinkConnection @($vpnSiteLinkConnection)
Ovanstående skapar AzGatewayCustomBgpIpConfigurationObject 1 VpnSiteLinks med Vpn Anslut ion i resursgruppen "PS_testing" i Azure. När anslutningen har skapats ansluts den till VpnSite med kommandot New-AzVpn Anslut ion med 1 VpnSiteLink Anslut ions till VpnSiteLink för VpnSite. Den här anslutningen använder tillhandahållen GatewayCustomBgpIpAddress för Bgp-anslutning på VpnGateway-sidan.
Parametrar
-ConnectionBandwidth
Den bandbredd som måste hanteras av den här länkanslutningen i mbit/s.
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EgressNatRule
Listan över utgående NAT-regler som är associerade med den här länken Anslut ion.
Type: | PSResourceId[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EnableBgp
Aktivera BGP för den här länkanslutningen
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IngressNatRule
Listan över ingress-NAT-regler som är associerade med den här länken Anslut ion.
Type: | PSResourceId[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IpSecPolicy
IpSec-princip som ska beaktas för den här länkanslutningen.
Type: | PSIpsecPolicy |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
VpnSiteLink Anslut ionsnamn
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RoutingWeight
Routningsvikt
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SharedKey
Den delade nyckel som krävs för att konfigurera den här länkanslutningen.
Type: | SecureString |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UseLocalAzureIpAddress
Använd den lokala Ip-adressen för Azure som käll-IP för den här länkanslutningen.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UsePolicyBasedTrafficSelectors
Använd principbaserade trafikväljare för den här länkanslutningen.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VpnConnectionProtocolType
Protokoll för gatewayanslutning:IKEv1/IKEv2
Type: | String |
Accepted values: | IKEv1, IKEv2 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VpnGatewayCustomBgpAddress
GatewayCustomBgpIpAddress för Vpngateway som används i den här länkanslutningen.
Type: | PSGatewayCustomBgpIpConfiguration[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VpnLinkConnectionMode
Anslutningsläget för den här länkanslutningen.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VpnSiteLink
Vpn-platslänkobjektet som du vill ansluta till.
Type: | PSVpnSiteLink |
Aliases: | InputObject |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Indata
PSGatewayCustomBgpIpConfiguration[]
Utdata
Relaterade länkar
Azure PowerShell
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: Under hela 2024 kommer vi att fasa ut GitHub-problem som feedbackmekanism för innehåll och ersätta det med ett nytt feedbacksystem. Mer information finns i:Skicka och visa feedback för