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

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.

主站蜘蛛池模板: 淮北市| 龙川县| 吴桥县| 申扎县| 会昌县| 苏尼特左旗| 泾川县| 库伦旗| 洞口县| 双城市| 平阳县| 突泉县| 德格县| 古交市| 潮州市| 舞钢市| 庆阳市| 博乐市| 忻州市| 星子县| 班玛县| 德州市| 岗巴县| 瓦房店市| 宁蒗| 临汾市| 河曲县| 阜阳市| 龙泉市| 阜宁县| 渭南市| 毕节市| 马尔康县| 习水县| 漳州市| 贞丰县| 水城县| 揭东县| 新竹县| 建瓯市| 浙江省|