- Hands-On Networking with Azure
- Mohamed Waly
- 150字
- 2021-06-24 18:41:22
Creating a virtual network in Azure portal using PowerShell
To be able to run your PowerShell cmdlets against Azure successfully, you need to log in first to Azure using the following cmdlet:
Login-AzureRMAccount
Then, you will be prompted to enter the credentials of your Azure account. Voila! You are logged in and you can run Azure PowerShell cmdlets successfully.
To create an Azure VNet, you first need to create the subnets that will be attached to this virtual network. Therefore, let's get started by creating the subnets:
$NSubnet = New-AzureRMVirtualNetworkSubnetConfig –Name NSubnet -AddressPrefix 192.168.1.0/24
$GWSubnet = New-AzureRMVirtualNetworkSubnetConfig –Name GatewaySubnet -AddressPrefix 192.168.2.0/27
Now you are ready to create a virtual network by triggering the following cmdlet:
New-AzureRMVirtualNetwork -ResourceGroupName PacktPub -Location WestEurope -Name PSVNet -AddressPrefix 192.168.0.0/16 -Subnet $NSubnet,$GWSubnet
Congratulations! You have your virtual network up and running with two subnets associated to it, one of them is a gateway subnet.
推薦閱讀
- 安全之美
- Learn pfSense 2.4
- CSS + DIV網(wǎng)頁樣式布局實(shí)戰(zhàn)從入門到精通
- HBase不睡覺書
- 矛與盾:黑客就這幾招
- Getting Started with Ghost
- PWA實(shí)戰(zhàn):面向下一代的Progressive Web APP
- 思科軟件定義訪問:實(shí)現(xiàn)基于業(yè)務(wù)意圖的園區(qū)網(wǎng)絡(luò)
- 綜合布線實(shí)訓(xùn)教程(第2版)
- 深度學(xué)習(xí):主流框架和編程實(shí)戰(zhàn)
- 云原生應(yīng)用管理:原理與實(shí)踐
- 現(xiàn)代網(wǎng)絡(luò)新技術(shù)概論(精裝版)
- 阿里云運(yùn)維架構(gòu)實(shí)踐秘籍
- Mastering SaltStack
- 交互式Web前端開發(fā)實(shí)踐