Open In App

Internal/External Forwarding Rule in GCP

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

Classification :



Basic difference :

Internal Forwarding Rule External Forwarding Rule
It is mainly applied to forward traffic that originates inside a Google Cloud network It is used for forwarding traffic that originates from the internet, outside of your VPC network.
For an internal forwarding rule, you need to have the clients in the same Virtual Private Cloud Network as a backend service, or in a connected network For an external forwarding rule, you are allowed to have the clients globally located outside the scope of your VPC network.

Use of Internal/External forwarding rules :
Internal Forwarding Rules are used by two types of Google Cloud load balancers:

Whereas, External forwarding rules are used by the following Google Cloud load balancers:

Article Tags :