官术网_书友最值得收藏!

Creating virtual network peering using PowerShell

First off, you need to retrieve the virtual network information and store it in a variable using the following cmdlet:

$VNet1 = Get-AzureRmVirtualNetwork -ResourceGroupName PacktPub -Name PSVNet 
$VNet2 = Get-AzureRmVirtualNetwork -ResourceGroupName PacktPub -Name PSVNet2

Then, you will add the peer from vnet1 to vnet2 by running the following cmdlet:

Add-AzureRmVirtualNetworkPeering -Name PSVNetPeer -VirtualNetwork $vnet1 -RemoteVirtualNetworkId $vnet2.Id

After that, you will add the peer from vnet2 to vnet1 by running the following cmdlet:

Add-AzureRmVirtualNetworkPeering -Name PSVNetPeer -VirtualNetwork $vnet2 -RemoteVirtualNetworkId $vnet1.Id

Now, you are done and have the peer in a connected state.

主站蜘蛛池模板: 南汇区| 高淳县| 青海省| 沂南县| 萍乡市| 涞源县| 哈尔滨市| 文水县| 南和县| 长丰县| 静海县| 乐山市| 鄢陵县| 凭祥市| 桓仁| 冷水江市| 隆化县| 长沙县| 西藏| 民权县| 靖西县| 山阳县| 康平县| 新兴县| 察隅县| 阿图什市| 宜兴市| 修武县| 阳朔县| 新和县| 新源县| 斗六市| 南川市| 东兴市| 普定县| 北海市| 浮梁县| 探索| 黄梅县| 肇庆市| 德惠市|