Stabilire una connessione di accesso privato ai servizi
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina spiega come stabilire una connessione di accesso privato ai servizi per una rete. La creazione di una connessione di accesso privato ai servizi per una rete è un prerequisito per la creazione di un'istanza Redis con la modalità di connessione di accesso privato ai servizi designata per quella rete. Per maggiori dettagli, consulta Networking.
Istruzioni per la configurazione dell'accesso privato ai servizi
Per configurare una connessione di accesso a servizi privati per la tua rete:
Nel comando precedente, la lunghezza del prefisso CIDR è impostata su 24. Questo valore deve essere pari o inferiore a 24. Ad esempio, 23 è un prefisso accettabile. Tieni conto che i prefissi CIDR più piccoli creano intervalli di indirizzi IP più ampi.
Fai clic sul nome della tua rete. Di solito si chiama "predefinito".
Fai clic su Accesso ai servizi privati.
Fai clic su Assegna intervalli IP per i servizi.
Fai clic su Assegna intervallo IP.
Inserisci un nome per l'intervallo, ad esempio "intervallo-accesso-servizi-privati".
Inserisci una descrizione per l'intervallo, ad esempio "Intervallo di indirizzi IP da utilizzare per la connessione di accesso privato ai servizi".
Seleziona Automatico se vuoi che sia Google a scegliere l'intervallo per te.
Inserisci un prefisso CIDR di massimo /24. Ad esempio, /23 è un prefisso accettabile. Tieni presente che i prefissi CIDR più piccoli creano intervalli di indirizzi IP più grandi.
Seleziona Personalizzato se vuoi scegliere tu l'intervallo.
Inserisci l'intervallo desiderato con un prefisso CIDR di massimo /24.
Fai clic su Assegna.
Fai clic su Connessioni private ai servizi.
Fai clic sul pulsante Crea connessione.
Nel menu a discesa Allocazione assegnata, seleziona l'intervallo appena creato nei passaggi precedenti.
Fai clic su Ok.
Fai clic su Connetti.
Aggiorna la pagina per visualizzare la nuova connessione nella scheda Connessioni private ai servizi.
Fai clic sul pulsante Configura connessione nel riquadro Connessione
a servizi privati. Si aprirà un riquadro scorrevole per configurare l'accesso ai servizi privati.
Assegna un intervallo IP utilizzando uno dei seguenti metodi:
Seleziona un intervallo IP esistente.
Alloca un nuovo intervallo IP.
Inserisci un nome per l'intervallo.
Inserisci un intervallo CIDR valido con una dimensione del blocco di /24. Ad esempio:
10.0.0.0/24.
Utilizza un intervallo IP allocato automaticamente.
[[["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-05 UTC."],[],[],null,["# Establish a private services access connection\n\nThis page explains how to establish a [private services access](/vpc/docs/private-services-access) connection for a network. Establishing a private services access\nconnection for a network is a prerequisite for creating a Redis instance with\nthe private services access connection mode designated for that network. For\nmore details, see [Networking](/memorystore/docs/redis/networking).\n| **Note:** We recommend that your organization's networking team / networking admin manage these steps for setting up a private services access connection. \n|\n| If you are an application developer, usually your networking team should manage establishing a private services access connection. For more details, see [Communicating networking requirements](/memorystore/docs/redis/networking#communicating_networking_requirements).\n\nPrivate services access setup instructions\n------------------------------------------\n\nFollow these steps to setup a private services access connection for your\nnetwork: \n\n### gcloud\n\n1. Enable the Service Networking API:\n\n [Enable the Service Networking API](https://console.cloud.google.com/apis/library/servicenetworking.googleapis.com)\n\n If you are using Shared VPC, enable the API in both the Service Project\n and the Host Project.\n2. [Check to see](/memorystore/docs/redis/verifying-connection) if\n a private service access connection has been established for your network.\n\n - If the connection has already been established, then see [Creating a Redis instance that uses a centralized IP address range](/memorystore/docs/redis/create-manage-instances#creating_a_redis_instance_that_uses_a_centralized_ip_address_range) for instructions on how to create a Redis instance.\n3. Open a terminal window.\n\n4. Set your default project by running the following command, replacing\n \u003cvar translate=\"no\"\u003evariables\u003c/var\u003e with appropriate values:\n\n ```\n gcloud config set core/project project-id\n ```\n5. Reserve an IP address range in your network by running the following command:\n\n ```\n gcloud compute addresses create reserved-range-name --global --prefix-length=24 --description=description --network=vpc-network --purpose=vpc_peering\n ```\n - In the command above, the CIDR prefix length is set to `24`. This value\n must be `24` or less. For example, `23` is an acceptable prefix. Note\n that smaller CIDR prefixes create larger IP address ranges.\n\n - For information on managing private services access, see [Configuring private services access](/vpc/docs/configure-private-services-access).\n\n6. Create a [private connection](/vpc/docs/configure-private-services-access#creating-connection)\n between your network and the private services access network by running the\n following command:\n\n ```\n gcloud services vpc-peerings connect --service=servicenetworking.googleapis.com --ranges=reserved-range-name --network=vpc-network --project=project-id\n ```\n\n### Console: VPC network\n\n1. Enable the Service Networking API:\n\n [Enable the Service Networking API](https://console.cloud.google.com/apis/library/servicenetworking.googleapis.com)\n\n If you are using Shared VPC, enable the API in both the Service Project\n and the Host Project.\n2. [Check to see](/memorystore/docs/redis/verifying-connection) if\n a private service access connection has been established for your network.\n\n - If the connection has already been established, then see [Creating a Redis instance that uses a centralized IP address range](/memorystore/docs/redis/create-manage-instances#creating_a_redis_instance_that_uses_a_centralized_ip_address_range) for instructions on how to create a Redis instance.\n3. Go to the VPC Networks page in the Google Cloud console.\n\n [Go to the VPC networks page](https://console.cloud.google.com/networking/networks/list?) \n\n4. Click the name of your network. Usually it is named \"default\".\n\n5. Click **Private services access**.\n\n6. Click **Allocate IP ranges for services**.\n\n7. Click **Allocate IP range**.\n\n - Enter a name for your range, such as \"private-services-access-range\".\n - Enter a description for your range, such as \"Range of IP addresses to be used for the Private services access connection\".\n - Select **Automatic** if you want Google to choose your range for you.\n 1. Enter a CIDR prefix of `/24` or less. For example, `/23` is an acceptable prefix. Note that smaller CIDR prefixes create larger IP address ranges.\n - Select **Custom** if you want to choose the range yourself.\n 1. Enter your desired range with a CIDR prefix of `/24` or less.\n - Click **Allocate**.\n8. Click **Private connections to services**.\n\n9. Click the **Create connection** button.\n\n10. Under the **Assigned allocation** dropdown, select the range you just\n created in the steps above.\n\n11. Click **Ok**.\n\n12. Click **Connect**.\n\n13. Refresh the page to see your new connection listed under the **Private\n connections to services** tab.\n\n### Console: Redis\n\n1. Enable the Service Networking API:\n\n [Enable the Service Networking API](https://console.cloud.google.com/apis/library/servicenetworking.googleapis.com)\n\n If you are using Shared VPC, enable the API in both the Service Project\n and the Host Project.\n2. Follow the steps at [Creating a Redis instance on a VPC network](/memorystore/docs/redis/create-manage-instances#creating_a_redis_instance_on_a_vpc_network)\n until you see the **Advanced network options** expander, and open it.\n\n | **Note:** If you see the **Private service connection required** panel, a private services access connection has not been established yet. If you do not see this panel, the connection has already been established for your network, and any Redis instance created with this network uses the [private services access connection mode](/memorystore/docs/redis/networking#connection_modes).\n3. Click the **Set Up Connection** button in the **Private service\n connection** panel. Doing so opens a slide-out panel for setting up\n private services access.\n\n4. Allocate an IP range using one of the following methods:\n\n - Select an existing IP range.\n - Allocate a new IP range.\n - Enter a **name** for your range.\n - Enter a valid CIDR range with a block size of `/24`. For example: `10.0.0.0/24`.\n - Use an automatically allocated IP range.\n5. Click the **Create Connection** button."]]