What is a Forwarding Rule?
In Cloud Computing and specifically focusing on Google Cloud Platform, a Forwarding Rule is set up to allow incoming traffic and direct it from individual ports within a specific range to particular ports on user VM’s on Google Cloud Platform. This range of ports can be opened on the public IP Address by using firewall rules. A Forwarding Rule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple. The main application of these
Forwarding Rules is in the Load Balancers of GCP which are responsible to distribute your network’s traffic and autoscale it as up or down with respect to your network’s availability. Now, each of these forwarding rules referred to an IP address and one or more ports on which the load balancer accepts traffic. With some of the Google Cloud Load Balancers you can limit the number of your predefined set of ports and for others, you are allowed to specify arbitrary ports.
Also, you cannot use port forwarding to open ports for an elastic IP address. When elastic IP is used, outside access is instead controlled through the use of security groups. You can also specify an IP protocol for a forwarding rule which is always either TCP or UDP protocol for Google Cloud load balancers