Organízate con las colecciones
Guarda y clasifica el contenido según tus preferencias.
Identificar las reglas de cortafuegos necesarias
Tus estaciones de trabajo se conectan al plano de control a través de Private Service Connect. En las siguientes subsecciones se proporcionan ejemplos de comandos de la CLI de gcloud para permitir el tráfico de entrada y salida.
Para obtener más información sobre estos comandos, consulta la información de referencia de gcloud compute firewall-rules.
Permitir el tráfico de entrada
Para que la conexión se realice correctamente, crea una regla de cortafuegos que permita el acceso a la dirección IP del plano de control desde las VMs de la estación de trabajo. Cloud Workstations aplica automáticamente la etiqueta de red cloud-workstations-instance a las VMs de la estación de trabajo, que se puede usar al crear reglas de cortafuegos que se apliquen a las VMs de la estación de trabajo. Consulta el siguiente ejemplo de comando gcloud de la CLI:
CLUSTER: el ID del clúster o el identificador completo del clúster.
PROJECT: el proyecto que aloja el clúster de estaciones de trabajo.
REGION: la ubicación de la región de la estación de trabajo. Por ejemplo, us-central1.
Permitir salida
También necesitas reglas de cortafuegos que permitan el tráfico saliente a la dirección IP del plano de control desde las VMs con la etiqueta cloud-workstations-instance para el protocolo TCP en los puertos 980 y 443, tal como se muestra en el siguiente comando de la CLI gcloud:
Añadir reglas de cortafuegos con etiquetas de red personalizadas
Puedes configurar etiquetas de red personalizadas para tus máquinas virtuales de estación de trabajo en laGoogle Cloud consola. Cuando crees o edites una configuración de estación de trabajo, actualiza la configuración de tu máquina para incluir tus etiquetas de red en el campo Etiquetas de red. Para obtener información sobre cómo añadir etiquetas de red, consulta las instrucciones para especificar opciones avanzadas al crear la configuración de tu máquina.
Si usa la API, puede aplicar etiquetas de red personalizadas mediante la opción host.gceInstance.tags del recurso de configuración de la estación de trabajo.
Para obtener más información sobre las reglas de cortafuegos de la nube privada virtual (VPC) enGoogle Cloud, consulta el artículo Crear reglas de cortafuegos de VPC de la documentación de VPC.
[[["Es fácil de entender","easyToUnderstand","thumb-up"],["Me ofreció una solución al problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Es difícil de entender","hardToUnderstand","thumb-down"],["La información o el código de muestra no son correctos","incorrectInformationOrSampleCode","thumb-down"],["Me faltan las muestras o la información que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-08-21 (UTC)."],[],[],null,["# Configure firewall rules\n\nIdentify firewall rules needed\n------------------------------\n\nYour workstations connect to the control plane through\nPrivate Service Connect. The following subsections provide example\n`gcloud` CLI commands to allow ingress and egress.\nFor more information about these commands, see the\n[`gcloud compute firewall-rules`](/sdk/gcloud/reference/compute/firewall-rules/create)\nreference information.\n\n### Allow ingress\n\nFor the connection to succeed, create a firewall rule to allow ingress to the control plane\nIP address from the workstation VMs. Cloud Workstations automatically applies\nthe `cloud-workstations-instance` network tag to the workstation VMs, which can\nbe used when creating firewall rules that apply to workstation VMs. See the\nfollowing example `gcloud` CLI command: \n\n gcloud compute firewall-rules create \u003cvar translate=\"no\"\u003eRULE_NAME\u003c/var\u003e \\\n --action=ALLOW \\\n --direction=INGRESS \\\n --network=\u003cvar translate=\"no\"\u003eNETWORK\u003c/var\u003e \\\n --rules=tcp\\\n --source-tags=cloud-workstations-instance \\\n --destination-ranges=\u003cvar translate=\"no\"\u003eCONTROL_PLANE_IP\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eRULE_NAME\u003c/var\u003e: the name of the firewall rule to create\n- \u003cvar translate=\"no\"\u003eNETWORK\u003c/var\u003e: the network specified on the workstation cluster resource\n- \u003cvar translate=\"no\"\u003eCONTROL_PLANE_IP\u003c/var\u003e: the internal IP address of the control\n plane for the workstation cluster.\n\n To find this IP address, run the following command: \n\n gcloud workstations clusters describe \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eCLUSTER\u003c/span\u003e\u003c/var\u003e --project=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePROJECT\u003c/span\u003e\u003c/var\u003e --region=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eREGION\u003c/span\u003e\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLUSTER\u003c/var\u003e: the ID of the cluster or fully qualified identifier for the cluster.\n - \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e: the project hosting the workstation cluster.\n - \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region location of the workstation---for example, `us-central1`.\n\n### Allow egress\n\nYou also need firewall rules that allow egress to the control plane IP address\nfrom VMs with the `cloud-workstations-instance` tag for the TCP protocol on\nports `980` and `443` as shown in the following `gcloud` CLI command: \n\n gcloud compute firewall-rules create \u003cvar translate=\"no\"\u003eRULE_NAME\u003c/var\u003e \\\n --action=ALLOW \\\n --direction=EGRESS \\\n --network=\u003cvar translate=\"no\"\u003eNETWORK\u003c/var\u003e \\\n --rules=tcp:980,tcp:443 \\\n --target-tags=cloud-workstations-instance \\\n --destination-ranges=\u003cvar translate=\"no\"\u003eCONTROL_PLANE_IP\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eRULE_NAME\u003c/var\u003e: the name of the firewall rule to create\n- \u003cvar translate=\"no\"\u003eNETWORK\u003c/var\u003e: the network to which this rule is attached. If omitted, the rule attaches to the default network.\n- \u003cvar translate=\"no\"\u003eCONTROL_PLANE_IP\u003c/var\u003e: the internal IP address of the control\n plane for the workstation cluster.\n\n To find this IP address, run the following command: \n\n gcloud workstations clusters describe \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eCLUSTER\u003c/span\u003e\u003c/var\u003e --project=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePROJECT\u003c/span\u003e\u003c/var\u003e --region=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eREGION\u003c/span\u003e\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLUSTER\u003c/var\u003e: the ID of the cluster or fully qualified identifier for the cluster.\n - \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e: the project hosting the workstation cluster.\n - \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region location of the workstation---for example, `us-central1`.\n\nFor more information, see also the following topics:\n\n- [WorkstationCluster](/workstations/docs/reference/rest/v1/projects.locations.workstationClusters)\n REST API\n\n- [Allow internal ingress connections between VMs](/vpc/docs/using-firewalls#common-use-cases-allow-internal)\n\nAdd firewall rules using custom network tags\n--------------------------------------------\n\nYou can configure custom network tags for your workstation VMs in the\nGoogle Cloud console. When you create or edit a workstation configuration, update\nyour machine configuration to include your network tags in the **Network tags**\nfield. For details on how to add **Network tags** , see the instructions for\nspecifying **Advanced options** when [creating your machine\nconfiguration](/workstations/docs/create-configuration#create_a_machine_configuration).\nAlternatively, when using the API, apply custom network tags through the\n`host.gceInstance.tags` option on the workstation configuration resource.\n\nFor more information about Virtual Private Cloud (VPC) firewall rules in\nGoogle Cloud, see\n[Create VPC firewall rules](/vpc/docs/using-firewalls#creating_firewall_rules)\nin the VPC documentation."]]