gclouddnsmanaged-zonescreateZONE_NAME\--visibility=private\--networks=https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/networks/NETWORK_NAME\--dns-name=tunnel.cloudproxy.app\--description="Description of your managed zone"
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eThis page explains how to use VPC Service Controls to safeguard IAP for TCP forwarding, including using IAP for TCP forwarding within a VPC Service Controls perimeter.\u003c/p\u003e\n"],["\u003cp\u003eA service perimeter can be created to protect Google-managed resources, and when doing so, the project with the Compute Engine instance must be added, as well as Identity-Aware Proxy TCP API.\u003c/p\u003e\n"],["\u003cp\u003eDNS records need to be configured for IAP for TCP if the client runs inside a perimeter, ensuring that the VPC network properly handles requests to non-\u003ccode\u003egoogleapis.com\u003c/code\u003e domains, especially \u003ccode\u003etunnel.cloudproxy.app\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo configure DNS, a private managed zone is created for \u003ccode\u003etunnel.cloudproxy.app\u003c/code\u003e, with DNS A and CNAME records added to reroute traffic to Google's restricted VIP or the private VIP, depending on network configuration.\u003c/p\u003e\n"],["\u003cp\u003eWhen utilizing a shared VPC, it's essential to include both the host and service projects within the service perimeter to maintain proper access control.\u003c/p\u003e\n"]]],[],null,["# Securing IAP for TCP forwarding with VPC Service Controls\n\nThis page describes how to use VPC Service Controls to protect\nIAP for TCP forwarding, and how to use IAP\nfor TCP forwarding within a VPC Service Controls perimeter.\n\nBefore you begin\n----------------\n\n1. Read the [Overview of\n VPC Service Controls](/vpc-service-controls/docs/overview).\n\n2. [Set up](/iap/docs/using-tcp-forwarding) usage of IAP TCP\n forwarding without a service perimeter.\n\n3. [Create a service perimeter using\n VPC Service Controls](/vpc-service-controls/docs/create-service-perimeters).\n This service perimeter protects the Google-managed resources of services\n that you specify. When you create your service perimeter, do the following:\n\n 1. Add the project that contains the Compute Engine instance you want to\n connect to with IAP to the projects within your\n service perimeter. If you are running an IAP for TCP\n client on a Compute Engine instance, also put the project\n containing this instance into the perimeter.\n\n 2. Add **Identity-Aware Proxy TCP API** to the list of services protected by your\n service perimeter.\n\n If you created your service perimeter without adding the projects and\n services you need, see\n [Managing service\n perimeters](/vpc-service-controls/docs/manage-service-perimeters)\n to learn how to update your service perimeter.\n\nConfigure your DNS records using Cloud DNS\n------------------------------------------\n\nIf your IAP for TCP client, which is likely the\n[Google Cloud CLI](/sdk/gcloud), is not running inside any perimeter, then\nyou can skip this step. On the other hand, if you run the client inside a\nperimeter, you must configure DNS records for IAP for TCP.\n\nIAP for TCP uses domains that are not subdomains of\n`googleapis.com`. Using Cloud DNS, add DNS records to ensure that your\nVPC network correctly handles requests sent to those domains. To\nlearn more about VPC routes, read the\n[Routes overview](/vpc/docs/routes).\n\nUse the following steps to create a [managed zone](/dns/zones) for a domain, add\nDNS records to route requests, and execute the transaction. You can use the\ngcloud CLI with your preferred terminal or use\n[Cloud Shell](/shell/docs/using-cloud-shell), which has the\ngcloud CLI preinstalled.\n\n1. [Configure](/vpc-service-controls/docs/set-up-private-connectivity#configuring_dns_with)\n the `*.googleapis.com` DNS as is typical for VPC Service Controls\n integrations.\n\n2. Collect this information to use when configuring your DNS records:\n\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is the ID of the project that hosts your\n VPC network.\n\n - \u003cvar translate=\"no\"\u003eNETWORK_NAME\u003c/var\u003e is the name of the VPC network in\n which you are running your IAP for TCP client.\n\n - \u003cvar translate=\"no\"\u003eZONE_NAME\u003c/var\u003e is a name for the zone that you are creating. For\n example, `iap-tcp-zone`.\n\n3. Create a private managed zone for the domain `tunnel.cloudproxy.app` so the\n VPC network can handle it.\n\n ```bash\n gcloud dns managed-zones create ZONE_NAME \\\n --visibility=private \\\n --networks=https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/networks/NETWORK_NAME \\\n --dns-name=tunnel.cloudproxy.app \\\n --description=\"Description of your managed zone\"\n ```\n4. Start a transaction.\n\n ```bash\n gcloud dns record-sets transaction start --zone=ZONE_NAME\n ```\n5. Add the following DNS A record. This reroutes traffic to Google's\n [restricted VIP](/vpc-service-controls/docs/set-up-private-connectivity)\n (virtual IP address).\n\n ```bash\n gcloud dns record-sets transaction add \\\n --name=tunnel.cloudproxy.app. \\\n --type=A 199.36.153.4 199.36.153.5 199.36.153.6 199.36.153.7 \\\n --zone=ZONE_NAME \\\n --ttl=300\n ```\n6. Add the following DNS CNAME record to point to the A record that you just\n added. This redirects all traffic matching the domain to the IP addresses\n listed in the previous step.\n\n ```bash\n gcloud dns record-sets transaction add \\\n --name=\"*.tunnel.cloudproxy.app.\" \\\n --type=CNAME tunnel.cloudproxy.app. \\\n --zone=ZONE_NAME \\\n --ttl=300\n ```\n7. Execute the transaction.\n\n ```bash\n gcloud dns record-sets transaction execute --zone=ZONE_NAME\n ```\n\n### Configuring DNS with BIND\n\nInstead of using Cloud DNS, you can use\n[BIND](https://www.wikipedia.org/wiki/BIND). In that case,\nfollow the directions for\n[configuring DNS with\nBIND](/vpc-service-controls/docs/set-up-private-connectivity#configuring_dns_with_bind),\nbut use the IAP for TCP domains instead of the general\n`googleapis.com` domains.\n\n### Using the private VIP\n\nInstead of using the restricted VIP, it might be possible to use the\n[private VIP](/vpc/docs/configure-private-google-access-hybrid#config-choose-domain),\ndepending on how you've configured your perimeter and network. If you prefer to\ndo that, then use\n\n`199.36.153.8 199.36.153.9 199.36.153.10 199.36.153.11`\n\nin place of\n\n`199.36.153.4 199.36.153.5 199.36.153.6 199.36.153.7`\n\nin the instructions for configuring your DNS records.\n\nUsing a shared VPC\n------------------\n\nIf you're using a [shared VPC](/vpc/docs/shared-vpc),\nyou must add the host and the service projects to the service perimeter. See\n[Managing service\nperimeters](/vpc-service-controls/docs/manage-service-perimeters).\n\nWhat's next\n-----------\n\n- See [Managing service\n perimeters](/vpc-service-controls/docs/manage-service-perimeters) to add more resources to your service perimeter."]]