Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Creare e gestire i criteri di rete
Questo documento descrive come utilizzare i criteri di rete per controllare se i workload VMware possono accedere a internet o essere accessibili da internet.
Ogni criterio di rete è associato a una rete VMware Engine e le reti VMware Engine possono essere regionali o globali. Le reti VMware Engine standard sono risorse globali, mentre le reti VMware Engine legacy sono regionali.
Un criterio di rete si applica a tutti i cloud privati associati alla rete VMware Engine. Per le reti precedenti, se hai cloud privati implementati in più regioni e vuoi attivare l'accesso a internet o il servizio di indirizzo IP esterno, devi creare un criterio di rete in ogni regione.
Crea un criterio di rete
Crea un criterio di rete utilizzando la console, gcloud o l'API.
Console
Per creare un nuovo criterio di rete utilizzando la Google Cloud console:
Nella Google Cloud console, vai alla pagina Criteri di rete.
Fai clic su Seleziona un progetto e poi seleziona l'organizzazione, la cartella o il progetto che contiene la rete VMware Engine a cui vuoi associare il criterio di rete.
Fai clic su Crea.
Fornisci informazioni sul nuovo criterio di rete:
Nome del criterio di rete:un nome per identificare il criterio di rete
Descrizione del criterio di rete:una descrizione del criterio di rete
Rete VMware Engine:la rete VMware Engine a cui associare il criterio
Regione:la regione in cui vuoi applicare le norme della rete
Nella sezione Dettagli criteri, attiva o disattiva i servizi di rete:
Servizio di accesso a internet: se abilitato, VMware Engine consente il traffico in uscita dagli indirizzi IP interni a internet.
Servizio di indirizzi IP esterni:se abilitato, VMware Engine consente di prenotare indirizzi IP esterni per gli indirizzi IP interni nel cloud privato associato. Gli indirizzi IP
esterni forniscono l'accesso al traffico in entrata agli indirizzi IP interni da internet.
Questo servizio può essere attivato solo se è attivo anche il servizio di accesso a internet.
Nel campo Intervallo di indirizzi dei servizi perimetrali, inserisci l'intervallo di indirizzi IP da utilizzare per indirizzare il gateway IP pubblico di VMware Engine (intervallo di indirizzi /26).
Fai clic su Crea. VMware Engine inizia a creare la nuova rete
policy.
NETWORK_POLICY_ID: un nome per questo criterio di rete
LOCATION: la posizione di questo criterio di rete; deve corrispondere alla rete VMware Engine
NETWORK_ID: il nome della rete VMware Engine
EDGE_SERVICES_CIDR: l'intervallo di indirizzi IP da utilizzare per indirizzare il gateway IP pubblico di VMware Engine (intervallo di indirizzi /26).
--external-ip-access: indica se abilitare l'assegnazione di indirizzi IP esterni ai carichi di lavoro VMware. Deve inoltre essere attivato
--internet-access.
--internet-access: indica se i carichi di lavoro VMware possono accedere a internet
LOCATION: la posizione di questo criterio di rete; deve corrispondere alla rete VMware Engine
NETWORK_POLICY_ID: un nome per questo criterio di rete
INTERNET_ACCESS: indica se i carichi di lavoro VMWare possono accedere a internet. Imposta questo valore su true o false
EXTERNAL_IP: indica se abilitare l'assegnazione di indirizzi IP esterni ai carichi di lavoro VMware. Deve essere attivo anche il valore internetAccess, impostato su true o false.
NETWORK_ID: il nome della rete VMware Engine
EDGE_SERVICES_CIDR: l'intervallo di indirizzi IP da usare per indirizzare il gateway IP pubblico di VMware Engine (intervallo di indirizzi /26).
Modificare un criterio di rete
Console
Per modificare un criterio di rete esistente utilizzando la Google Cloud console, segui questi passaggi:
Nella Google Cloud console, vai alla pagina Criteri di rete.
Fai clic su Seleziona un progetto e poi seleziona l'organizzazione, la cartella o il progetto contenente la rete VMware Engine per cui vuoi modificare il criterio di rete.
Nell'elenco dei criteri di rete, trova il criterio di rete che vuoi modificare.
Fai clic sull'icona Altromore_vert alla fine di una riga e seleziona Modifica.
Nella pagina visualizzata, modifica il criterio di rete in base alle tue esigenze.
EDGE_SERVICES_CIDR: l'intervallo di indirizzi IP da usare per indirizzare il gateway IP pubblico di VMware Engine (intervallo di indirizzi /26).
--external-ip-access: indica se abilitare l'assegnazione di indirizzi IP esterni ai carichi di lavoro VMware. Deve inoltre essere attivato
--internet-access.
--internet-access: indica se i carichi di lavoro VMware possono accedere a internet
API
Nell'API, effettua una richiesta PATCH:
POST https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/networkPolicies?networkPolicyId=NETWORK_POLICY_ID
'{
"internetAccess": INTERNET_ACCESS,
"externalIp": EXTERNAL_IP,
"edgeServicesCidr": "EDGE_SERVICES_CIDR"
}'
Sostituisci quanto segue:
PROJECT_ID: il progetto per questa richiesta
LOCATION: la posizione di questo criterio di rete
NETWORK_POLICY_ID: il nome di questo criterio di rete
INTERNET_ACCESS: indica se i carichi di lavoro VMWare possono accedere a internet. Imposta questo valore su true o false
EXTERNAL_IP: indica se abilitare l'assegnazione di indirizzi IP esterni ai carichi di lavoro VMware. Deve essere attivo anche il valore internetAccess, impostato su true o false.
EDGE_SERVICES_CIDR: l'intervallo di indirizzi IP da usare per indirizzare il gateway IP pubblico di VMware Engine (intervallo di indirizzi /26).
Eliminare un criterio di rete
Per eliminare un criterio di rete esistente:
Console
Nella Google Cloud console, vai alla pagina Criteri di rete.
Fai clic su Seleziona un progetto e poi seleziona l'organizzazione, la cartella o il progetto
che contiene la rete VMware Engine per cui vuoi eliminare il criterio di rete.
Nell'elenco dei criteri di rete, trova il criterio di rete che vuoi eliminare.
Fai clic sull'icona Altromore_vert
alla fine di una riga e seleziona Elimina.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[],[],null,["# Create and manage network policies\n==================================\n\nThis document describes how to use network policies to control whether your\nVMware workloads can access or be accessed from the internet.\n\nEach network policy is associated with a VMware Engine network, and\nVMware Engine networks can be either regional or global. *Standard VMware Engine Networks* are global resources, while *Legacy VMware Engine Networks* are regional.\n\nA network policy applies to all private clouds associated with the\nVMware Engine network. For legacy networks, if you have private clouds\ndeployed in more than one region and you want to enable internet access or the\nexternal IP address service, you must create a network policy in each region.\n\nCreate a network policy\n-----------------------\n\nCreate a network policy using the console, `gcloud`, or the API. \n\n### Console\n\nTo create a new network policy using the Google Cloud console:\n\n1. In the Google Cloud console, go to the **Network policies** page.\n\n [Go to Network policies](https://console.cloud.google.com/vmwareengine/network-policies)\n2. Click **Select a project** and then select the organization, folder, or project\n that contains the VMware Engine network you want to associate the\n network policy with.\n\n3. Click **Create**.\n\n4. Provide information about the new network policy:\n\n - **Network policy name:** a name to identify the network policy\n - **Network policy description:** a description of the network policy\n - **VMware Engine network:** the VMware Engine network to associate the policy with\n - **Region:** the region where you want the network policy to apply\n5. In the **Policy details** section, enable or disable network services:\n\n - **Internet access service:** When enabled, VMware Engine allows outbound traffic from internal IP addresses to the internet.\n - **External IP address service:** When enabled, VMware Engine\n lets you [reserve external IP addresses](/vmware-engine/docs/preview/networking/howto-allocate-external-ip) for\n internal IP addresses in the associated private cloud. External IP\n addresses provide inbound traffic access to internal IP addresses from the\n internet.\n\n This service can only be enabled when the internet access service is also\n enabled.\n | **Note:** If you enable internet access and leave the external IP address service disabled, you won't be able to reserve external IP addresses for internal IP addresses covered by this network policy.\n6. In the **Edge services address range** field, enter the IP address range to\n use when addressing the VMware Engine public IP gateway (*/26*\n address range).\n\n7. Click **Create**. VMware Engine begins creating your new network\n policy.\n\n### gcloud\n\nIn `gcloud`, run the [`network-policies create`](/sdk/gcloud/reference/vmware/network-policies/create)\ncommand: \n\n```\ngcloud vmware network-policies create NETWORK_POLICY_ID \\\n --location LOCATION --vmware-engine-network NETWORK_ID \\\n --edge-services-cidr=EDGE_SERVICES_CIDR [--external-ip-access] \\\n [--internet-access]\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eNETWORK_POLICY_ID\u003c/var\u003e: a name for this network policy\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location of this network policy; this must match the VMware Engine network\n- \u003cvar translate=\"no\"\u003eNETWORK_ID\u003cvar translate=\"no\"\u003e\u003c/var\u003e\u003c/var\u003e: the VMware Engine network name\n- \u003cvar translate=\"no\"\u003eEDGE_SERVICES_CIDR\u003c/var\u003e: the IP address range to use when addressing the VMware Engine public IP gateway (*/26* address range)\n- `--external-ip-access`: whether to enable external IP addresses to be assigned to VMware workloads. Must also have `--internet-access` enabled.\n- `--internet-access`: whether VMWare workloads can access the internet\n\n### API\n\nIn the API, make a `POST` request: \n\n```\nPOST https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/networkPolicies?networkPolicyId=NETWORK_POLICY_ID\n\n'{\n \"internetAccess\": INTERNET_ACCESS,\n \"externalIp\": EXTERNAL_IP,\n \"vmwareEngineNetwork\": \"projects/PROJECT_ID/locations/LOCATION/vmwareEngineNetworks/NETWORK_ID\"\n \"edgeServicesCidr\": \"EDGE_SERVICES_CIDR\"\n}'\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project for this request\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location of this network policy; this must match the VMware Engine network\n- \u003cvar translate=\"no\"\u003eNETWORK_POLICY_ID\u003c/var\u003e: a name for this network policy\n- \u003cvar translate=\"no\"\u003eINTERNET_ACCESS\u003c/var\u003e: whether VMWare workloads can access the internet; set this to `true` or `false`\n- \u003cvar translate=\"no\"\u003eEXTERNAL_IP\u003c/var\u003e: whether to enable external IP addresses to be assigned to VMware workloads. Must also have `internetAccess` enabled; set this to `true` or `false`.\n- \u003cvar translate=\"no\"\u003eNETWORK_ID\u003cvar translate=\"no\"\u003e\u003c/var\u003e\u003c/var\u003e: the VMware Engine network name\n- \u003cvar translate=\"no\"\u003eEDGE_SERVICES_CIDR\u003c/var\u003e: the IP address range to use when addressing the VMware Engine public IP gateway (*/26* address range)\n\nEdit a network policy\n---------------------\n\n### Console\n\nTo edit an existing network policy using the Google Cloud console, do the following:\n\n1. In the Google Cloud console, go to the **Network policies** page.\n\n [Go to Network policies](https://console.cloud.google.com/vmwareengine/network-policies)\n2. Click **Select a project** and then select the organization, folder, or project\n that contains the VMware Engine network you want to edit the network policy for.\n\n3. In the list of network policies, find the network policy that you want to\n edit.\n\n4. Click the **More** more_vert\n icon at the end of a row and select **Edit**.\n\n5. On the page that appears, adjust the network policy as you need.\n\n6. Click **Save**.\n\n### gcloud\n\nTo update a network policy, use the [`network-policies update` command](/sdk/gcloud/reference/vmware/network-policies/update): \n\n```\ngcloud vmware network-policies update NETWORK_POLICY_ID \\\n --location LOCATION \\\n --edge-services-cidr=EDGE_SERVICES_CIDR [--external-ip-access] \\\n [--internet-access]\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eNETWORK_POLICY_ID\u003c/var\u003e: the name of the network policy\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location of this network policy\n- \u003cvar translate=\"no\"\u003eEDGE_SERVICES_CIDR\u003c/var\u003e: the IP address range to use when addressing the VMware Engine public IP gateway (*/26* address range)\n- `--external-ip-access`: whether to enable external IP addresses to be assigned to VMware workloads. Must also have `--internet-access` enabled.\n- `--internet-access`: whether VMWare workloads can access the internet\n\n### API\n\nIn the API, make a `PATCH` request: \n\n```\nPOST https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/networkPolicies?networkPolicyId=NETWORK_POLICY_ID\n\n'{\n \"internetAccess\": INTERNET_ACCESS,\n \"externalIp\": EXTERNAL_IP,\n \"edgeServicesCidr\": \"EDGE_SERVICES_CIDR\"\n}'\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project for this request\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location of this network policy\n- \u003cvar translate=\"no\"\u003eNETWORK_POLICY_ID\u003c/var\u003e: the name of this network policy\n- \u003cvar translate=\"no\"\u003eINTERNET_ACCESS\u003c/var\u003e: whether VMWare workloads can access the internet; set this to `true` or `false`\n- \u003cvar translate=\"no\"\u003eEXTERNAL_IP\u003c/var\u003e: whether to enable external IP addresses to be assigned to VMware workloads. Must also have `internetAccess` enabled; set this to `true` or `false`.\n- \u003cvar translate=\"no\"\u003eEDGE_SERVICES_CIDR\u003c/var\u003e: the IP address range to use when addressing the VMware Engine public IP gateway (*/26* address range)\n\nDelete a network policy\n-----------------------\n\nTo delete an existing network policy, take the following steps. \n\n### Console\n\n1. In the Google Cloud console, go to the **Network policies** page.\n\n [Go to Network policies](https://console.cloud.google.com/vmwareengine/network-policies)\n2. Click **Select a project** and then select the organization, folder, or project\n that contains the VMware Engine network you want to delete the network policy for.\n\n3. In the list of network policies, find the network policy that you want to\n delete.\n\n4. Click the **More** more_vert\n icon at the end of a row and select **Delete**.\n\n### gcloud\n\nIn `gcloud`, use the [`network-policies delete` command](/sdk/gcloud/reference/vmware/network-policies/delete): \n\n```\ngcloud vmware network-policies delete NETWORK_POLICY_ID\n```\n\nReplace \u003cvar translate=\"no\"\u003eNETWORK_POLICY_ID\u003c/var\u003e with the name of the network\npolicy to delete.\n\n### API\n\nMake a `DELETE` request to the network policy resource: \n\n```\nDELETE https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/networkPolicies/NETWORK_POLICY_ID\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project for this request\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location of this network policy\n- \u003cvar translate=\"no\"\u003eNETWORK_POLICY_ID\u003c/var\u003e: the name of this network policy\n\nWhat's next\n-----------\n\n- [Manage your private cloud resources and activity](/vmware-engine/docs/private-clouds/howto-manage-private-cloud)."]]