다음을 통해 공유


테넌트 가상 네트워크에 가상 게이트웨이 추가

적용 대상: Windows Server 2022, Windows Server 2019, Windows Server 2016, Azure Stack HCI, 버전 22H2, 21H2 및 20H2

Windows PowerShell cmdlet 및 스크립트를 사용하여 테넌트의 가상 네트워크에 사이트 간 연결을 제공하는 방법을 알아봅니다. 이 토픽에서는 네트워크 컨트롤러를 사용하여 게이트웨이 풀의 구성원인 RAS 게이트웨이 인스턴스에 테넌트 가상 게이트웨이를 추가합니다. RAS 게이트웨이는 각 테넌트에서 사용되는 대역폭에 따라 최대 100개의 테넌트를 지원합니다. 네트워크 컨트롤러는 테넌트에 대한 새 가상 게이트웨이를 배포할 때 사용할 최상의 RAS 게이트웨이를 자동으로 결정합니다.

각 가상 게이트웨이는 특정 테넌트에 해당하며 하나 이상의 네트워크 연결(사이트 간 VPN 터널) 및 필요에 따라 BGP(Border Gateway Protocol) 연결로 구성됩니다. 사이트 간 연결을 제공하는 경우 고객은 테넌트 가상 네트워크를 테넌트 엔터프라이즈 네트워크, 서비스 공급자 네트워크 또는 인터넷과 같은 외부 네트워크에 연결할 수 있습니다.

테넌트 가상 게이트웨이를 배포하는 경우 다음과 같은 구성 옵션을 사용할 수 있습니다.

네트워크 연결 옵션 BGP 구성 옵션
  • IPSec 사이트 간 VPN(가상 사설망)
  • GRE(일반 라우팅 캡슐화)
  • 계층 3 전달
  • BGP 경로 구성
  • BGP 피어 구성
  • BGP 라우팅 정책 구성

이 토픽의 Windows PowerShell 예제 스크립트 및 명령은 이러한 각 옵션을 사용하여 RAS 게이트웨이에 테넌트 가상 게이트웨이를 배포하는 방법을 보여 줍니다.

Important

제공된 Windows PowerShell 명령 및 스크립트 예제를 실행하기 전에 값이 배포에 적합하도록 모든 변수 값을 변경해야 합니다.

  1. 네트워크 컨트롤러에 게이트웨이 풀 개체가 있는지 확인합니다.

    $uri = "https://ncrest.contoso.com"
    
    # Retrieve the Gateway Pool configuration
    $gwPool = Get-NetworkControllerGatewayPool -ConnectionUri $uri
    
    # Display in JSON format
    $gwPool | ConvertTo-Json -Depth 2
    
    
  2. 네트워크 컨트롤러에 테넌트의 가상 네트워크에서 패킷을 라우팅하는 데 사용되는 서브넷이 있는지 확인합니다. 또한 테넌트 게이트웨이와 가상 네트워크 간의 라우팅에 사용되는 가상 서브넷을 검색합니다.

    $uri = "https://ncrest.contoso.com"
    
    # Retrieve the Tenant Virtual Network configuration
    $Vnet = Get-NetworkControllerVirtualNetwork -ConnectionUri $uri  -ResourceId "Contoso_Vnet1"
    
    # Display in JSON format
    $Vnet | ConvertTo-Json -Depth 4
    
    # Retrieve the Tenant Virtual Subnet configuration
    $RoutingSubnet = Get-NetworkControllerVirtualSubnet -ConnectionUri $uri  -ResourceId "Contoso_WebTier" -VirtualNetworkID $vnet.ResourceId
    
    # Display in JSON format
    $RoutingSubnet | ConvertTo-Json -Depth 4
    
    
  3. 테넌트 가상 게이트웨이에 대한 새 개체를 만든 다음 게이트웨이 풀 참조를 업데이트합니다. 게이트웨이와 가상 네트워크 간의 라우팅에 사용되는 가상 서브넷도 지정합니다. 가상 서브넷을 지정한 후 나머지 가상 게이트웨이 개체 속성을 업데이트한 다음 테넌트의 새 가상 게이트웨이를 추가합니다.

    # Create a new object for Tenant Virtual Gateway
    $VirtualGWProperties = New-Object Microsoft.Windows.NetworkController.VirtualGatewayProperties
    
    # Update Gateway Pool reference
    $VirtualGWProperties.GatewayPools = @()
    $VirtualGWProperties.GatewayPools += $gwPool
    
    # Specify the Virtual Subnet that is to be used for routing between the gateway and Virtual Network
    $VirtualGWProperties.GatewaySubnets = @()
    $VirtualGWProperties.GatewaySubnets += $RoutingSubnet
    
    # Update the rest of the Virtual Gateway object properties
    $VirtualGWProperties.RoutingType = "Dynamic"
    $VirtualGWProperties.NetworkConnections = @()
    $VirtualGWProperties.BgpRouters = @()
    
    # Add the new Virtual Gateway for tenant
    $virtualGW = New-NetworkControllerVirtualGateway -ConnectionUri $uri  -ResourceId "Contoso_VirtualGW" -Properties $VirtualGWProperties -Force
    
    
  4. IPsec, GRE 또는 L3(계층 3) 전달을 사용하여 사이트 간 VPN 연결을 만듭니다.

    필요에 따라 이전 단계를 모두 결합하고 세 가지 연결 옵션을 모두 사용하여 테넌트 가상 게이트웨이를 구성할 수 있습니다. 자세한 내용은 세 가지 연결 유형(IPsec, GRE, L3) 및 BGP를 모두 사용하여 게이트웨이 구성을 참조하세요.

    참고 항목

    PerfectForwardSecrecy은(는) 로컬 및 원격 사이트에 대해 일치해야 합니다.

    IPsec VPN 사이트 간 네트워크 연결

    # Create a new object for Tenant Network Connection
    $nwConnectionProperties = New-Object Microsoft.Windows.NetworkController.NetworkConnectionProperties
    
    # Update the common object properties
    $nwConnectionProperties.ConnectionType = "IPSec"
    $nwConnectionProperties.OutboundKiloBitsPerSecond = 10000
    $nwConnectionProperties.InboundKiloBitsPerSecond = 10000
    
    # Update specific properties depending on the Connection Type
    $nwConnectionProperties.IpSecConfiguration = New-Object Microsoft.Windows.NetworkController.IpSecConfiguration
    $nwConnectionProperties.IpSecConfiguration.AuthenticationMethod = "PSK"
    $nwConnectionProperties.IpSecConfiguration.SharedSecret = "P@ssw0rd"
    
    $nwConnectionProperties.IpSecConfiguration.QuickMode = New-Object Microsoft.Windows.NetworkController.QuickMode
    $nwConnectionProperties.IpSecConfiguration.QuickMode.PerfectForwardSecrecy = "PFS2048"
    $nwConnectionProperties.IpSecConfiguration.QuickMode.AuthenticationTransformationConstant = "SHA256128"
    $nwConnectionProperties.IpSecConfiguration.QuickMode.CipherTransformationConstant = "DES3"
    $nwConnectionProperties.IpSecConfiguration.QuickMode.SALifeTimeSeconds = 1233
    $nwConnectionProperties.IpSecConfiguration.QuickMode.IdleDisconnectSeconds = 500
    $nwConnectionProperties.IpSecConfiguration.QuickMode.SALifeTimeKiloBytes = 1048576
    
    $nwConnectionProperties.IpSecConfiguration.MainMode = New-Object Microsoft.Windows.NetworkController.MainMode
    $nwConnectionProperties.IpSecConfiguration.MainMode.DiffieHellmanGroup = "Group2"
    $nwConnectionProperties.IpSecConfiguration.MainMode.IntegrityAlgorithm = "SHA256"
    $nwConnectionProperties.IpSecConfiguration.MainMode.EncryptionAlgorithm = "AES256"
    $nwConnectionProperties.IpSecConfiguration.MainMode.SALifeTimeSeconds = 1234
    $nwConnectionProperties.IpSecConfiguration.MainMode.SALifeTimeKiloBytes = 1048576
    
    # L3 specific configuration (leave blank for IPSec)
    $nwConnectionProperties.IPAddresses = @()
    $nwConnectionProperties.PeerIPAddresses = @()
    
    # Update the IPv4 Routes that are reachable over the site-to-site VPN Tunnel
    $nwConnectionProperties.Routes = @()
    $ipv4Route = New-Object Microsoft.Windows.NetworkController.RouteInfo
    $ipv4Route.DestinationPrefix = "14.1.10.1/32"
    $ipv4Route.metric = 10
    $nwConnectionProperties.Routes += $ipv4Route
    
    # Tunnel Destination (Remote Endpoint) Address
    $nwConnectionProperties.DestinationIPAddress = "10.127.134.121"
    
    # Add the new Network Connection for the tenant
    New-NetworkControllerVirtualGatewayNetworkConnection -ConnectionUri $uri -VirtualGatewayId $virtualGW.ResourceId -ResourceId "Contoso_IPSecGW" -Properties $nwConnectionProperties -Force
    
    

    GRE VPN 사이트 간 네트워크 연결

    # Create a new object for the Tenant Network Connection
    $nwConnectionProperties = New-Object Microsoft.Windows.NetworkController.NetworkConnectionProperties
    
    # Update the common object properties
    $nwConnectionProperties.ConnectionType = "GRE"
    $nwConnectionProperties.OutboundKiloBitsPerSecond = 10000
    $nwConnectionProperties.InboundKiloBitsPerSecond = 10000
    
    # Update specific properties depending on the Connection Type
    $nwConnectionProperties.GreConfiguration = New-Object Microsoft.Windows.NetworkController.GreConfiguration
    $nwConnectionProperties.GreConfiguration.GreKey = 1234
    
    # Update the IPv4 Routes that are reachable over the site-to-site VPN Tunnel
    $nwConnectionProperties.Routes = @()
    $ipv4Route = New-Object Microsoft.Windows.NetworkController.RouteInfo
    $ipv4Route.DestinationPrefix = "14.2.20.1/32"
    $ipv4Route.metric = 10
    $nwConnectionProperties.Routes += $ipv4Route
    
    # Tunnel Destination (Remote Endpoint) Address
    $nwConnectionProperties.DestinationIPAddress = "10.127.134.122"
    
    # L3 specific configuration (leave blank for GRE)
    $nwConnectionProperties.L3Configuration = New-Object Microsoft.Windows.NetworkController.L3Configuration
    $nwConnectionProperties.IPAddresses = @()
    $nwConnectionProperties.PeerIPAddresses = @()
    
    # Add the new Network Connection for the tenant
    New-NetworkControllerVirtualGatewayNetworkConnection -ConnectionUri $uri -VirtualGatewayId $virtualGW.ResourceId -ResourceId "Contoso_GreGW" -Properties $nwConnectionProperties -Force
    
    

    L3 전달 네트워크 연결

    L3 전달 네트워크 연결이 적절하게 작동하려면 해당 논리 네트워크를 구성해야 합니다.

    1. L3 전달 네트워크 연결에 대한 논리 네트워크를 구성합니다.

      # Create a new object for the Logical Network to be used for L3 Forwarding
      $lnProperties = New-Object Microsoft.Windows.NetworkController.LogicalNetworkProperties
      
      $lnProperties.NetworkVirtualizationEnabled = $false
      $lnProperties.Subnets = @()
      
      # Create a new object for the Logical Subnet to be used for L3 Forwarding and update properties
      $logicalsubnet = New-Object Microsoft.Windows.NetworkController.LogicalSubnet
      $logicalsubnet.ResourceId = "Contoso_L3_Subnet"
      $logicalsubnet.Properties = New-Object Microsoft.Windows.NetworkController.LogicalSubnetProperties
      $logicalsubnet.Properties.VlanID = 1001
      $logicalsubnet.Properties.AddressPrefix = "10.127.134.0/25"
      $logicalsubnet.Properties.DefaultGateways = "10.127.134.1"
      
      $lnProperties.Subnets += $logicalsubnet
      
      # Add the new Logical Network to Network Controller
      $vlanNetwork = New-NetworkControllerLogicalNetwork -ConnectionUri $uri -ResourceId "Contoso_L3_Network" -Properties $lnProperties -Force
      
      
    2. 네트워크 연결 JSON 개체를 만들고 이를 네트워크 컨트롤러에 추가합니다.

      # Create a new object for the Tenant Network Connection
      $nwConnectionProperties = New-Object Microsoft.Windows.NetworkController.NetworkConnectionProperties
      
      # Update the common object properties
      $nwConnectionProperties.ConnectionType = "L3"
      $nwConnectionProperties.OutboundKiloBitsPerSecond = 10000
      $nwConnectionProperties.InboundKiloBitsPerSecond = 10000
      
      # GRE specific configuration (leave blank for L3)
      $nwConnectionProperties.GreConfiguration = New-Object Microsoft.Windows.NetworkController.GreConfiguration
      
      # Update specific properties depending on the Connection Type
      $nwConnectionProperties.L3Configuration = New-Object Microsoft.Windows.NetworkController.L3Configuration
      $nwConnectionProperties.L3Configuration.VlanSubnet = $vlanNetwork.properties.Subnets[0]
      
      $nwConnectionProperties.IPAddresses = @()
      $localIPAddress = New-Object Microsoft.Windows.NetworkController.CidrIPAddress
      $localIPAddress.IPAddress = "10.127.134.55"
      $localIPAddress.PrefixLength = 25
      $nwConnectionProperties.IPAddresses += $localIPAddress
      
      $nwConnectionProperties.PeerIPAddresses = @("10.127.134.65")
      
      # Update the IPv4 Routes that are reachable over the site-to-site VPN Tunnel
      $nwConnectionProperties.Routes = @()
      $ipv4Route = New-Object Microsoft.Windows.NetworkController.RouteInfo
      $ipv4Route.DestinationPrefix = "14.2.20.1/32"
      $ipv4Route.metric = 10
      $nwConnectionProperties.Routes += $ipv4Route
      
      # Add the new Network Connection for the tenant
      New-NetworkControllerVirtualGatewayNetworkConnection -ConnectionUri $uri -VirtualGatewayId $virtualGW.ResourceId -ResourceId "Contoso_L3GW" -Properties $nwConnectionProperties -Force
      
      
  5. 게이트웨이를 BGP 라우터로 구성하고 이를 네트워크 컨트롤러에 추가합니다.

    1. 테넌트에 대한 BGP 라우터를 추가합니다.

      # Create a new object for the Tenant BGP Router
      $bgpRouterproperties = New-Object Microsoft.Windows.NetworkController.VGwBgpRouterProperties
      
      # Update the BGP Router properties
      $bgpRouterproperties.ExtAsNumber = "0.64512"
      
      # Add the new BGP Router for the tenant
      $bgpRouter = New-NetworkControllerVirtualGatewayBgpRouter -ConnectionUri $uri -VirtualGatewayId $virtualGW.ResourceId -ResourceId "Contoso_BgpRouter1" -Properties $bgpRouterProperties -Force
      
      
    2. 위에 추가된 사이트 간 VPN 네트워크 연결에 해당하는 이 테넌트에 대한 BGP 피어를 추가합니다.

      # Create a new object for Tenant BGP Peer
      $bgpPeerProperties = New-Object Microsoft.Windows.NetworkController.VGwBgpPeerProperties
      
      # Update the BGP Peer properties
      $bgpPeerProperties.PeerIpAddress = "14.1.10.1"
      $bgpPeerProperties.AsNumber = 64521
      $bgpPeerProperties.ExtAsNumber = "0.64521"
      
      # Add the new BGP Peer for tenant
      New-NetworkControllerVirtualGatewayBgpPeer -ConnectionUri $uri -VirtualGatewayId $virtualGW.ResourceId -BgpRouterName $bgpRouter.ResourceId -ResourceId "Contoso_IPSec_Peer" -Properties $bgpPeerProperties -Force
      
      

(선택적 단계) 세 가지 연결 유형(IPsec, GRE, L3) 및 BGP를 모두 사용하여 게이트웨이 구성

필요에 따라 이전 단계를 모두 결합하고 세 가지 연결 옵션을 모두 사용하여 테넌트 가상 게이트웨이를 구성할 수 있습니다.

참고 항목

PerfectForwardSecrecy은(는) 로컬 및 원격 사이트에 대해 일치해야 합니다.

# Create a new Virtual Gateway Properties type object
$VirtualGWProperties = New-Object Microsoft.Windows.NetworkController.VirtualGatewayProperties

# Update GatewayPool reference
$VirtualGWProperties.GatewayPools = @()
$VirtualGWProperties.GatewayPools += $gwPool

# Specify the Virtual Subnet that is to be used for routing between GW and VNET
$VirtualGWProperties.GatewaySubnets = @()
$VirtualGWProperties.GatewaySubnets += $RoutingSubnet

# Update some basic properties
$VirtualGWProperties.RoutingType = "Dynamic"

# Update Network Connection object(s)
$VirtualGWProperties.NetworkConnections = @()

# IPSec Connection configuration
$ipSecConnection = New-Object Microsoft.Windows.NetworkController.NetworkConnection
$ipSecConnection.ResourceId = "Contoso_IPSecGW"
$ipSecConnection.Properties = New-Object Microsoft.Windows.NetworkController.NetworkConnectionProperties
$ipSecConnection.Properties.ConnectionType = "IPSec"
$ipSecConnection.Properties.OutboundKiloBitsPerSecond = 10000
$ipSecConnection.Properties.InboundKiloBitsPerSecond = 10000

$ipSecConnection.Properties.IpSecConfiguration = New-Object Microsoft.Windows.NetworkController.IpSecConfiguration

$ipSecConnection.Properties.IpSecConfiguration.AuthenticationMethod = "PSK"
$ipSecConnection.Properties.IpSecConfiguration.SharedSecret = "P@ssw0rd"

$ipSecConnection.Properties.IpSecConfiguration.QuickMode = New-Object Microsoft.Windows.NetworkController.QuickMode

$ipSecConnection.Properties.IpSecConfiguration.QuickMode.PerfectForwardSecrecy = "PFS2048"
$ipSecConnection.Properties.IpSecConfiguration.QuickMode.AuthenticationTransformationConstant = "SHA256128"
$ipSecConnection.Properties.IpSecConfiguration.QuickMode.CipherTransformationConstant = "DES3"
$ipSecConnection.Properties.IpSecConfiguration.QuickMode.SALifeTimeSeconds = 1233
$ipSecConnection.Properties.IpSecConfiguration.QuickMode.IdleDisconnectSeconds = 500
$ipSecConnection.Properties.IpSecConfiguration.QuickMode.SALifeTimeKiloBytes = 1048576

$ipSecConnection.Properties.IpSecConfiguration.MainMode = New-Object Microsoft.Windows.NetworkController.MainMode

$ipSecConnection.Properties.IpSecConfiguration.MainMode.DiffieHellmanGroup = "Group2"
$ipSecConnection.Properties.IpSecConfiguration.MainMode.IntegrityAlgorithm = "SHA256"
$ipSecConnection.Properties.IpSecConfiguration.MainMode.EncryptionAlgorithm = "AES256"
$ipSecConnection.Properties.IpSecConfiguration.MainMode.SALifeTimeSeconds = 1234
$ipSecConnection.Properties.IpSecConfiguration.MainMode.SALifeTimeKiloBytes = 1048576

$ipSecConnection.Properties.IPAddresses = @()
$ipSecConnection.Properties.PeerIPAddresses = @()

$ipSecConnection.Properties.Routes = @()

$ipv4Route = New-Object Microsoft.Windows.NetworkController.RouteInfo
$ipv4Route.DestinationPrefix = "14.1.10.1/32"
$ipv4Route.metric = 10
$ipSecConnection.Properties.Routes += $ipv4Route

$ipSecConnection.Properties.DestinationIPAddress = "10.127.134.121"

# GRE Connection configuration
$greConnection = New-Object Microsoft.Windows.NetworkController.NetworkConnection
$greConnection.ResourceId = "Contoso_GreGW"

$greConnection.Properties = New-Object Microsoft.Windows.NetworkController.NetworkConnectionProperties
$greConnection.Properties.ConnectionType = "GRE"
$greConnection.Properties.OutboundKiloBitsPerSecond = 10000
$greConnection.Properties.InboundKiloBitsPerSecond = 10000

$greConnection.Properties.GreConfiguration = New-Object Microsoft.Windows.NetworkController.GreConfiguration
$greConnection.Properties.GreConfiguration.GreKey = 1234

$greConnection.Properties.IPAddresses = @()
$greConnection.Properties.PeerIPAddresses = @()

$greConnection.Properties.Routes = @()

$ipv4Route = New-Object Microsoft.Windows.NetworkController.RouteInfo
$ipv4Route.DestinationPrefix = "14.2.20.1/32"
$ipv4Route.metric = 10
$greConnection.Properties.Routes += $ipv4Route

$greConnection.Properties.DestinationIPAddress = "10.127.134.122"

$greConnection.Properties.L3Configuration = New-Object Microsoft.Windows.NetworkController.L3Configuration

# L3 Forwarding connection configuration
$l3Connection = New-Object Microsoft.Windows.NetworkController.NetworkConnection
$l3Connection.ResourceId = "Contoso_L3GW"

$l3Connection.Properties = New-Object Microsoft.Windows.NetworkController.NetworkConnectionProperties
$l3Connection.Properties.ConnectionType = "L3"
$l3Connection.Properties.OutboundKiloBitsPerSecond = 10000
$l3Connection.Properties.InboundKiloBitsPerSecond = 10000

$l3Connection.Properties.GreConfiguration = New-Object Microsoft.Windows.NetworkController.GreConfiguration
$l3Connection.Properties.L3Configuration = New-Object Microsoft.Windows.NetworkController.L3Configuration
$l3Connection.Properties.L3Configuration.VlanSubnet = $vlanNetwork.properties.Subnets[0]

$l3Connection.Properties.IPAddresses = @()
$localIPAddress = New-Object Microsoft.Windows.NetworkController.CidrIPAddress
$localIPAddress.IPAddress = "10.127.134.55"
$localIPAddress.PrefixLength = 25
$l3Connection.Properties.IPAddresses += $localIPAddress

$l3Connection.Properties.PeerIPAddresses = @("10.127.134.65")

$l3Connection.Properties.Routes = @()
$ipv4Route = New-Object Microsoft.Windows.NetworkController.RouteInfo
$ipv4Route.DestinationPrefix = "14.2.20.1/32"
$ipv4Route.metric = 10
$l3Connection.Properties.Routes += $ipv4Route

# Update BGP Router Object
$VirtualGWProperties.BgpRouters = @()

$bgpRouter = New-Object Microsoft.Windows.NetworkController.VGwBgpRouter
$bgpRouter.ResourceId = "Contoso_BgpRouter1"
$bgpRouter.Properties = New-Object Microsoft.Windows.NetworkController.VGwBgpRouterProperties

$bgpRouter.Properties.ExtAsNumber = "0.64512"
$bgpRouter.Properties.BgpPeers = @()

# Create BGP Peer Object(s)
# BGP Peer for IPSec Connection
$bgpPeer_IPSec = New-Object Microsoft.Windows.NetworkController.VGwBgpPeer
$bgpPeer_IPSec.ResourceId = "Contoso_IPSec_Peer"

$bgpPeer_IPSec.Properties = New-Object Microsoft.Windows.NetworkController.VGwBgpPeerProperties
$bgpPeer_IPSec.Properties.PeerIpAddress = "14.1.10.1"
$bgpPeer_IPSec.Properties.AsNumber = 64521
$bgpPeer_IPSec.Properties.ExtAsNumber = "0.64521"

$bgpRouter.Properties.BgpPeers += $bgpPeer_IPSec

# BGP Peer for GRE Connection
$bgpPeer_Gre = New-Object Microsoft.Windows.NetworkController.VGwBgpPeer
$bgpPeer_Gre.ResourceId = "Contoso_Gre_Peer"

$bgpPeer_Gre.Properties = New-Object Microsoft.Windows.NetworkController.VGwBgpPeerProperties
$bgpPeer_Gre.Properties.PeerIpAddress = "14.2.20.1"
$bgpPeer_Gre.Properties.AsNumber = 64522
$bgpPeer_Gre.Properties.ExtAsNumber = "0.64522"

$bgpRouter.Properties.BgpPeers += $bgpPeer_Gre

# BGP Peer for L3 Connection
$bgpPeer_L3 = New-Object Microsoft.Windows.NetworkController.VGwBgpPeer
$bgpPeer_L3.ResourceId = "Contoso_L3_Peer"

$bgpPeer_L3.Properties = New-Object Microsoft.Windows.NetworkController.VGwBgpPeerProperties
$bgpPeer_L3.Properties.PeerIpAddress = "14.3.30.1"
$bgpPeer_L3.Properties.AsNumber = 64523
$bgpPeer_L3.Properties.ExtAsNumber = "0.64523"

$bgpRouter.Properties.BgpPeers += $bgpPeer_L3

$VirtualGWProperties.BgpRouters += $bgpRouter

# Finally Add the new Virtual Gateway for tenant
New-NetworkControllerVirtualGateway -ConnectionUri $uri  -ResourceId "Contoso_VirtualGW" -Properties $VirtualGWProperties -Force

가상 네트워크의 게이트웨이 수정

구성 요소 구성을 검색하고 이를 변수로 저장

$nwConnection = Get-NetworkControllerVirtualGatewayNetworkConnection -ConnectionUri $uri -VirtualGatewayId "Contoso_VirtualGW" -ResourceId "Contoso_IPSecGW"

변수 구조를 탐색하여 필수 속성에 연결하고 이를 업데이트 값으로 설정

$nwConnection.properties.IpSecConfiguration.SharedSecret = "C0mplexP@ssW0rd"

수정된 구성을 추가하여 네트워크 컨트롤러의 이전 구성 바꾸기

New-NetworkControllerVirtualGatewayNetworkConnection -ConnectionUri $uri -VirtualGatewayId "Contoso_VirtualGW" -ResourceId $nwConnection.ResourceId -Properties $nwConnection.Properties -Force

가상 네트워크에서 게이트웨이 제거

다음 Windows PowerShell 명령을 사용하여 개별 게이트웨이 기능 또는 전체 게이트웨이를 제거할 수 있습니다.

네트워크 연결 제거

Remove-NetworkControllerVirtualGatewayNetworkConnection -ConnectionUri $uri -VirtualGatewayId "Contoso_VirtualGW" -ResourceId "Contoso_IPSecGW" -Force

BGP 피어 제거

Remove-NetworkControllerVirtualGatewayBgpPeer -ConnectionUri $uri -VirtualGatewayId "Contoso_VirtualGW" -BgpRouterName "Contoso_BgpRouter1" -ResourceId "Contoso_IPSec_Peer" -Force

BGP 라우터 제거

Remove-NetworkControllerVirtualGatewayBgpRouter -ConnectionUri $uri -VirtualGatewayId "Contoso_VirtualGW" -ResourceId "Contoso_BgpRouter1" -Force

게이트웨이 제거

Remove-NetworkControllerVirtualGateway -ConnectionUri $uri -ResourceId "Contoso_VirtualGW" -Force