Creare e configurare una rete logica e il Pool di indirizzi IP (Script)

 

Data di pubblicazione: luglio 2016

Si applica a: System Center 2012 R2 Virtual Machine Manager, System Center 2012 - Virtual Machine Manager

Le reti logiche consentono agli amministratori di rete al modello di rete in base alle categorie riconoscibile allineate a business è raggruppare insieme le subnet e VLAN. Dopo aver creato una nuova rete logica, utilizzare la definizione della rete logica, anche denominata sito di rete, per assegnare subnet IP e VLAN per la rete logica.

È possibile creare un pool di indirizzi IP statici e associarlo a uno o più gruppi host. Dopo aver creato un pool di indirizzi IP statici, è possibile aggiungere a tale server DNS tramite il Set-SCStaticIPAddressPool cmdlet.

Per ulteriori informazioni sulla configurazione delle reti System Center 2012 – Virtual Machine Manager (VMM), vedere configurazione di rete in VMM.

Dichiarazione di non responsabilità

Lo script seguente crea e configura una rete logica e un pool di indirizzi IP statici. Lo script si presuppone che è già stato creato un gruppo host denominato Seattle.

  
# Description:   This script creates a logical network and then creates a logical   
#                network definition that it applies it to the logical network.  
#                The script then creates a static IP address pool, associates   
#                the pool with a host group, and adds DNS servers.   
  
# Create a logical network.  
$LogicalNetwork = New-SCLogicalNetwork -Name "FrontEnd"  
  
# Create a logical network definition and associate it with the new logical network.  
$HostGroup = Get-SCVMHostGroup | where { $_.Path -eq "All Hosts\Seattle" }  
$SubnetVLAN = New-SCSubnetVLAN -Subnet "10.0.0.1/24" -VLAN 25  
$LogNetDef = New-SCLogicalNetworkDefinition -Name "Logical Network Definition for Seattle" -LogicalNetwork $LogicalNetwork -VMHostGroup $HostGroup -SubnetVLAN $SubnetVLAN  
  
# Create a static IP address pool and associate it with a host group.  
$HostGroup = Get-SCVMHostGroup | where { $_.Path -eq "All Hosts\New York\Production" }  
$DefaultGateway = New-SCDefaultGateway -IPAddress "10.0.0.1" -Metric 10  
$IPPool = New-SCStaticIPAddressPool -LogicalNetworkDefinition $LogNetDef -Name "Production IP Address Pool" -Description "This IP address pool is for production use in Seattle." -Subnet "10.0.0.0/24" -IPAddressRangeStart "10.0.0.10" -IPAddressRangeEnd "10.0.0.99" -IPAddressReservedSet "10.0.0.25-10.0.0.35, 10.0.0.38" -VIPAddressSet "10.0.0.95-10.0.0.99" -DNSSuffix "domain.contoso.com" -DNSSearchSuffix domain1.contoso.com, domain2.contoso.com -DNSServer "10.0.0.1", "10.0.0.2" -WINSServer "10.0.0.1", "10.0.0.2" -DefaultGateway $DefaultGateway -EnableNetBIOS $True  
  
# Add DNS servers to the static IP address pool.  
$DNSServerIPAddress = $IPPool.DNSServers  
$DNSServerIPAddress += "10.0.0.5"  
Set-SCStaticIPAddressPool -StaticIPAddressPool $IPPool -DNSServer $DNSServerIPAddress  
  

Vedere anche

Nuovo SCLogicalNetwork
Nuovo SCLogicalNetworkDefinition
Nuovo SCStaticIPAddressPool
Set-SCStaticIPAddressPool