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

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.

主站蜘蛛池模板: 边坝县| 江孜县| 安阳市| 淮安市| 祥云县| 香格里拉县| 萝北县| 繁峙县| 嘉祥县| 广昌县| 铜梁县| 马公市| 兴化市| 茶陵县| 天等县| 来凤县| 西华县| 广东省| 宾阳县| 连平县| 绥棱县| 玉环县| 韶关市| 大洼县| 陇西县| 三穗县| 延津县| 阿拉尔市| 凤山市| 遂平县| 江华| 赣州市| 鞍山市| 元谋县| 靖安县| 丹巴县| 宜城市| 蚌埠市| 普格县| 长武县| 黎城县|