Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Erforderliche Firewallregeln identifizieren
Ihre Workstations stellen über Private Service Connect eine Verbindung zur Steuerungsebene her. In den folgenden Abschnitten finden Sie Beispiele für gcloud-Befehle, mit denen ein- und ausgehender Traffic zugelassen wird.
Weitere Informationen zu diesen Befehlen finden Sie in der Referenz zu gcloud compute firewall-rules.
Ingress zulassen
Damit die Verbindung erfolgreich ist, müssen Sie eine Firewallregel erstellen, die den Zugriff auf die IP-Adresse der Steuerungsebene von den Workstation-VMs zulässt. Bei Cloud Workstations wird das Netzwerk-Tag cloud-workstations-instance automatisch auf die Workstation-VMs angewendet. Dieses Tag kann beim Erstellen von Firewallregeln verwendet werden, die für Workstation-VMs gelten. Hier ein Beispiel für einen gcloud-Befehl:
CLUSTER: die ID des Clusters oder eine voll qualifizierte Kennzeichnung für den Cluster.
PROJECT: das Projekt, in dem der Workstation-Cluster gehostet wird.
REGION: der Standort der Workstation, z. B. us-central1.
Ausgehende Verbindungen zulassen
Außerdem benötigen Sie Firewallregeln, die ausgehenden Traffic von VMs mit dem cloud-workstations-instance-Tag für das TCP-Protokoll auf den Ports 980 und 443 zur IP-Adresse der Steuerungsebene zulassen, wie im folgenden gcloud-Befehl gezeigt:
Firewallregeln mit benutzerdefinierten Netzwerk-Tags hinzufügen
Sie können benutzerdefinierte Netzwerk-Tags für Ihre Workstation-VMs in derGoogle Cloud -Konsole konfigurieren. Wenn Sie eine Workstationkonfiguration erstellen oder bearbeiten, aktualisieren Sie die Maschinenkonfiguration, indem Sie Ihre Netzwerk-Tags in das Feld Netzwerk-Tags einfügen. Weitere Informationen zum Hinzufügen von Netzwerk-Tags finden Sie in der Anleitung zum Angeben von erweiterten Optionen beim Erstellen der Maschinenkonfiguration.
Alternativ können Sie bei Verwendung der API benutzerdefinierte Netzwerk-Tags über die Option host.gceInstance.tags auf die Workstation-Konfigurationsressource anwenden.
Weitere Informationen zu VPC-Firewallregeln (Virtual Private Cloud) inGoogle Cloudfinden Sie in der VPC-Dokumentation unter VPC-Firewallregeln erstellen.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-11 (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."]]