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

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.

主站蜘蛛池模板: 肇庆市| 肇庆市| 建瓯市| 临武县| 清徐县| 韶山市| 吉木乃县| 寿光市| 云浮市| 蒙自县| 迁安市| 偃师市| 肥城市| 巴东县| 灵山县| 凤台县| 岳西县| 保德县| 三河市| 依安县| 永年县| 牟定县| 长宁县| 治县。| 高雄市| 谢通门县| 南皮县| 全州县| 兰坪| 伊通| 永福县| 二手房| 偃师市| 沧州市| 宣威市| 余干县| 天等县| 东乌珠穆沁旗| 广西| 夏河县| 兴隆县|