演習 - Azure 仮想ネットワークの IP アドレス指定を設計して実装する
これで、設計に基づき IP アドレスを使用して仮想ネットワークを作成し、デプロイする準備ができました。
このユニットでは、3 つの仮想ネットワークとサブネットをデプロイして、それらの仮想ネットワーク内のリソースをサポートします。
注記
この演習は省略してもかまいません。 この演習を完了する場合は、開始する前に Azure サブスクリプションを作成する必要があります。 Azure アカウントを持っていない場合、または現時点で作成したくない場合は、指示を読んで、提示されている情報を理解することができます。
注記
この演習の手順を完了するには、リソース グループを使用する必要があります。 既に作成したリソース グループを使用することも、この演習専用の新しいリソース グループを作成することもできます。 新しいリソース グループを作成する場合は、演習を完了するときに作成したリソースを簡単にクリーンアップできます。 既存のリソース グループがない場合、またはこの演習専用の新しいリソース グループを作成する場合は、「 Azure portal と Azure Resource Manager を使用してリソース グループを管理し、Azure portal を使用してリソース グループを作成する」の手順に従うか、「Azure CLI を使用して Azure リソース グループを管理して Azure CLI を使用して リソース グループを作成する」の手順に従うことができます。
注記
この演習全体を通して、例の myResourceGroupName を 既存のリソース グループの名前、またはこの演習用に作成したリソース グループの名前に置き換えます。
CoreServicesVnet 仮想ネットワークは、米国西部リージョンにデプロイします。 この仮想ネットワークには、最も多くのリソースを配置します。 VPN 接続を介してオンプレミス ネットワークに接続されます。 このネットワークには、ビジネスの運営にとって重要な Web サービス、データベース、その他のシステムが含まれます。 ドメイン コントローラーやドメイン ネーム システム (DNS) などの共有サービスもここに配置されます。 大きく成長することが見込まれるため、この仮想ネットワークには大きなアドレス空間が必要です。
ManufacturingVnet 仮想ネットワークは、組織の製造施設がある場所に近い北ヨーロッパ リージョンにデプロイされます。 この仮想ネットワークには、製造施設の運用に使用するシステムが含まれます。 組織では、システムでのデータ (温度など) の取得元として、多数の内部接続デバイスを予想しており、拡張のための IP アドレス空間が必要になります。
ResearchVnet 仮想ネットワークは、この仮想ネットワークを使用する組織の研究開発チームの所在地に近いインド西部リージョンにデプロイされます。 チームのリソース セットは小規模で安定しており、今後拡大することはないと予想されます。 チームは作業用に、少数の仮想マシンに対して少数の IP アドレス空間が必要です。
次のようなリソースを作成します。
| 仮想ネットワーク | リージョン | 仮想ネットワークのアドレス空間 | サブネット | サブネットのアドレス空間 |
|---|---|---|---|---|
| CoreServicesVnet | 米国西部 | 10.20.0.0/16 | - | - |
| GatewaySubnet | 10.20.0.0/27 | |||
| 共有サービスサブネット (SharedServicesSubnet) | 10.20.10.0/24 | |||
| DatabaseSubnet | 10.20.20.0/24 | |||
| パブリックウェブサービスサブネット | 10.20.30.0/24 | |||
| ManufacturingVnet | 北ヨーロッパ | 10.30.0.0/16 | - | - |
| マニュファクチャリングシステムサブネット | 10.30.10.0/24 | |||
| SensorSubnet1 | 10.30.20.0/24 | |||
| SensorSubnet2 | 10.30.21.0/24 | |||
| SensorSubnet3 | 10.30.22.0/24 | |||
| ResearchVnet | インド西部 | 10.40.40.0/24 | - | - |
| ResearchSystemSubnet | 10.40.40.0/24 | |||
これらの仮想ネットワークとサブネットは、既存のリソースに対応しながら、予想される成長にも対応できるような構造になっています。 これらの仮想ネットワークとサブネットを作成して、ネットワーク インフラストラクチャの基盤を構築してみましょう。
CoreServicesVnet 仮想ネットワークを作成する
Azure Cloud Shell で次のコマンドを実行して、CoreServicesVnet 仮想ネットワークを作成します。
az network vnet create \ --resource-group "myResourceGroupName" \ --name CoreServicesVnet \ --address-prefixes 10.20.0.0/16 \ --location westus注記
myResourceGroupName をリソース グループの名前に置き換えます。
次に、その仮想ネットワークに計画されているリソースに必要なサブネットを作成しましょう。
az network vnet subnet create \ --resource-group "myResourceGroupName" \ --vnet-name CoreServicesVnet \ --name GatewaySubnet \ --address-prefixes 10.20.0.0/27 az network vnet subnet create \ --resource-group "myResourceGroupName" \ --vnet-name CoreServicesVnet \ --name SharedServicesSubnet \ --address-prefixes 10.20.10.0/24 az network vnet subnet create \ --resource-group "myResourceGroupName" \ --vnet-name CoreServicesVnet \ --name DatabaseSubnet \ --address-prefixes 10.20.20.0/24 az network vnet subnet create \ --resource-group "myResourceGroupName" \ --vnet-name CoreServicesVnet \ --name PublicWebServiceSubnet \ --address-prefixes 10.20.30.0/24作成されたリソースを見てみましょう。 次のコマンドを実行して、構成したすべてのサブネットを表示します。
az network vnet subnet list \ --resource-group "myResourceGroupName" \ --vnet-name CoreServicesVnet \ --output table次のサブネットが一覧表示されるはずです。
AddressPrefix Name PrivateEndpointNetworkPolicies PrivateLinkServiceNetworkPolicies ProvisioningState ResourceGroup --------------- ---------------------- -------------------------------- ----------------------------------- ------------------- ------------------------------------------- 10.20.0.0/27 GatewaySubnet Enabled Enabled Succeeded myResourceGroupName 10.20.10.0/24 SharedServicesSubnet Enabled Enabled Succeeded myResourceGroupName 10.20.20.0/24 DatabaseSubnet Enabled Enabled Succeeded myResourceGroupName 10.20.30.0/24 PublicWebServiceSubnet Enabled Enabled Succeeded myResourceGroupName
ManufacturingVnet 仮想ネットワークを作成する
Cloud Shell で次のコマンドを実行して、ManufacturingVnet 仮想ネットワークを作成します。
az network vnet create \ --resource-group "myResourceGroupName" \ --name ManufacturingVnet \ --address-prefixes 10.30.0.0/16 \ --location northeurope次に、その仮想ネットワークに計画されているリソースに必要なサブネットを作成しましょう。
az network vnet subnet create \ --resource-group "myResourceGroupName" \ --vnet-name ManufacturingVnet \ --name ManufacturingSystemSubnet \ --address-prefixes 10.30.10.0/24 az network vnet subnet create \ --resource-group "myResourceGroupName" \ --vnet-name ManufacturingVnet \ --name SensorSubnet1 \ --address-prefixes 10.30.20.0/24 az network vnet subnet create \ --resource-group "myResourceGroupName" \ --vnet-name ManufacturingVnet \ --name SensorSubnet2 \ --address-prefixes 10.30.21.0/24 az network vnet subnet create \ --resource-group "myResourceGroupName" \ --vnet-name ManufacturingVnet \ --name SensorSubnet3 \ --address-prefixes 10.30.22.0/24作成されたリソースを見てみましょう。 次のコマンドを実行して、構成したすべてのサブネットを表示します。
az network vnet subnet list \ --resource-group "myResourceGroupName" \ --vnet-name ManufacturingVnet \ --output table次のサブネットが一覧表示されるはずです。
AddressPrefix Name PrivateEndpointNetworkPolicies PrivateLinkServiceNetworkPolicies ProvisioningState ResourceGroup --------------- ------------------------- -------------------------------- ----------------------------------- ------------------- ------------------------------------------- 10.30.10.0/24 ManufacturingSystemSubnet Enabled Enabled Succeeded myResourceGroupName 10.30.20.0/24 SensorSubnet1 Enabled Enabled Succeeded myResourceGroupName 10.30.21.0/24 SensorSubnet2 Enabled Enabled Succeeded myResourceGroupName 10.30.22.0/24 SensorSubnet3 Enabled Enabled Succeeded myResourceGroupName
ResearchVnet 仮想ネットワークを作成する
Cloud Shell で次のコマンドを実行して、ResearchVnet 仮想ネットワークを作成します。
az network vnet create \ --resource-group "myResourceGroupName" \ --name ResearchVnet \ --address-prefixes 10.40.40.0/24 \ --location westindia次に、その仮想ネットワークに計画されているリソースに必要なサブネットを作成しましょう。
az network vnet subnet create \ --resource-group "myResourceGroupName" \ --vnet-name ResearchVnet \ --name ResearchSystemSubnet \ --address-prefixes 10.40.40.0/24最終的な仮想ネットワークを見てみましょう。 次のコマンドを実行して、構成したすべてのサブネットを表示します。
az network vnet subnet list \ --resource-group "myResourceGroupName" \ --vnet-name ResearchVnet \ --output table次のサブネットが一覧表示されるはずです。
AddressPrefix Name PrivateEndpointNetworkPolicies PrivateLinkServiceNetworkPolicies ProvisioningState ResourceGroup --------------- -------------------- -------------------------------- ----------------------------------- ------------------- ------------------------------------------- 10.40.40.0/24 ResearchSystemSubnet Enabled Enabled Succeeded myResourceGroupName
仮想ネットワークとサブネットが作成され、リソースをデプロイできるインフラストラクチャが完成しました。
これらのネットワークは、仮想ネットワーク ピアリングを通じてさらに統合したり、Azure VPN Gateway を介してオンプレミス ネットワークに接続したりすることができます。 ネットワーク セキュリティ グループを使用して、トラフィックをフィルター処理し、仮想ネットワーク内および仮想ネットワーク間のアクセスを制御することができます。