Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



gcloud compute forwarding-rules create

NAME
gcloud-compute-forwarding-rules-create - Create a forwarding rule to direct network traffic to a load balancer
SYNOPSIS
gcloud compute forwarding-rules create
  NAME
  [--address ADDRESS]
  [--description DESCRIPTION]
  [--format FORMAT]
  [--help]
  [--ip-protocol IP_PROTOCOL]
  [--port-range [PORT | PORT-PORT]]
  [--project PROJECT]
  [--quiet, -q]
  [--global | --region REGION]
  [--target-http-proxy TARGET_HTTP_PROXY | --target-instance TARGET_INSTANCE | --target-pool TARGET_POOL]
  [--target-instance-zone TARGET_INSTANCE_ZONE]
  [-h]
DESCRIPTION
gcloud compute forwarding-rules create is used to create a forwarding rule. Forwarding rules match and direct certain types of traffic to a load balancer which is controlled by a target pool, a target instance, or a target HTTP proxy. Target pools and target instances perform load balancing at the layer 3 of the OSI networking model ( http://en.wikipedia.org/wiki/Network_layer ). Target HTTP proxies perform load balancing at layer 7.
Forwarding rules can be either regional or global. They are regional if they point to a target pool or a target instance and global if they point to a target HTTP proxy.
For more information on load balancing, see https://developers.google.com/compute/docs/load-balancing/ .
When creating a forwarding rule, exactly one of “--target-instance” “--target-pool”, and “--target-http-proxy” must be specified.
POSITIONAL ARGUMENTS
NAME
The name of the forwarding rule.
FLAGS
--address ADDRESS
The external IP address that the forwarding rule will serve. All traffic sent to this IP address is directed to the target pointed to by the forwarding rule. If the address is reserved, it must either (1) reside in the global scope if the forwarding rule is being configured to point to a target HTTP proxy or (2) reside in the same region as the forwarding rule if the forwarding rule is being configured to point to a target pool or target instance. If this flag is omitted, an ephemeral IP address is assigned.
--description DESCRIPTION
An optional textual description for the forwarding rule.
--format FORMAT
Specify a format for printed output. By default, a command-specific human-friendly output format is used. Setting this flag to one of the available options will serialize the result of the command in the chosen format and print it to stdout. Supported formats are: "json", "text", "yaml".
--global
If provided, assume the forwarding rules are global. A forwarding rule is global if it references a target HTTP proxy.
--help
Display detailed help.
--ip-protocol IP_PROTOCOL
The IP protocol that the rule will serve. If left empty, TCP is used. Supported protocols are: AH, ESP, SCTP, TCP, UDP.
--port-range [PORT | PORT-PORT]
If specified, only packets addressed to ports in the specified range will be forwarded. If not specified for regional forwarding rules, all ports are matched. This flag is required for global forwarding rules.
--project PROJECT
Google Cloud Platform project to use for this invocation.
--quiet
Disable all interactive prompts when running gcloud commands. If input is required, defaults will be used, or an error will be raised.
--region REGION
The region of the forwarding rule to operate on. If not specified, you will be prompted to select a region.
To avoid prompting when this flag is omitted, you can set the “compute/region” property:
gcloud config set compute/region REGION
A list of regions can fetched by running:
gcloud compute regions list
To unset the property, run:
gcloud config unset compute/region
Alternatively, the region can be stored in the environment variable “CLOUDSDK_COMPUTE_REGION”.
--target-http-proxy TARGET_HTTP_PROXY
The target HTTP proxy that will receive the traffic.
--target-instance TARGET_INSTANCE
The name of the target instance that will receive the traffic. The target instance must be in a zone that’s in the forwarding rule’s region. Global forwarding rules may not direct traffic to target instances. If not specified, you will be prompted to select a zone.
To avoid prompting when this flag is omitted, you can set the “compute/zone” property:
gcloud config set compute/zone ZONE
A list of zones can fetched by running:
gcloud compute zones list
To unset the property, run:
gcloud config unset compute/zone
Alternatively, the zone can be stored in the environment variable “CLOUDSDK_COMPUTE_ZONE”.
--target-instance-zone TARGET_INSTANCE_ZONE
The zone of the target instance.
--target-pool TARGET_POOL
The target pool that will receive the traffic. The target pool must be in the same region as the forwarding rule. Global forwarding rules may not direct traffic to target pools.
-h
Print a summary help and exit.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.