This page provides an overview of how to create a Secure Web Proxy policy and then explains how to configure next hop routing for your Secure Web Proxy instance. In addition, this page describes how to configure either static routing or policy-based routing for your next hop.
By default, SecureWebProxy instances have a RoutingMode value of
EXPLICIT_ROUTING_MODE, which means that you must configure your workloads to
explicitly send HTTP(S) traffic to Secure Web Proxy. Instead of
configuring individual clients to point to your Secure Web Proxy instance, you
can set your Secure Web Proxy instance's RoutingMode as
NEXT_HOP_ROUTING_MODE, which lets you define routes that direct traffic to
your Secure Web Proxy instance.
When deploying your Secure Web Proxy instance as next
hop, you can enable the gateway to listen on all ports
(from 1 to 65535), simplifying the configuration for dynamic environments or
services that use multiple ports.
Configure next hop routing for Secure Web Proxy
This section describes the steps to create a Secure Web Proxy policy and the procedure to deploy your Secure Web Proxy instance as next hop.
Create a Secure Web Proxy policy
- Complete all the required prerequisite steps.
- Create a Secure Web Proxy policy.
- Create Secure Web Proxy rules.
Deploy your Secure Web Proxy instance as next hop
Console
In the Google Cloud console, go to the Web Proxies page.
Click Create a secure web proxy.
Enter a name for the web proxy that you want to create, such as
myswp.Enter a description of the web proxy, such as
My new swp.For Routing mode, select the Next hop option.
In the Regions list, select the region where you want to create the web proxy.
In the Network list, select the network where you want to create the web proxy.
In the Subnetwork list, select the subnetwork where you want to create the web proxy.
Optional: Enter the Secure Web Proxy IP address. You can enter an IP address from the range of Secure Web Proxy IP addresses that reside in the subnetwork you created in the previous step. If you don't enter the IP address, then your Secure Web Proxy instance automatically chooses an IP address from the selected subnetwork.
In the Certificate list, select the certificate that you want to use to create the web proxy.
In the Policy list, select the policy that you created to associate the web proxy with.
Click Create.
Cloud Shell
Use a text editor to create a
gateway.yamlfile.Add the following code to the
gateway.yamlfile:name: projects/PROJECT_ID/locations/REGION/gateways/swp1 type: SECURE_WEB_GATEWAY addresses: ["IP_ADDRESS"] ports: [443, 80] gatewaySecurityPolicy: projects/PROJECT_ID/locations/REGION/gatewaySecurityPolicies/policy1 network: projects/PROJECT_ID/global/networks/NETWORK subnetwork: projects/PROJECT_ID/regions/REGION/subnetworks/SUBNETWORK routingMode: NEXT_HOP_ROUTING_MODEOptional: To configure the gateway to listen on all ports (from
1to65535), add theall_portsfield in thegateway.yamlfile and set it totrue. This feature is supported in Preview.For information about the limitations related to using the
all_portsfeature, see Limitations.name: projects/PROJECT_ID/locations/REGION/gateways/swp1 type: