Configure Firewall Rules For HTTP and HTTPS in GCP

Configure Firewall Rules For HTTP and HTTPS in GCP

By default the firewall settings in Google Cloud Platform block outside traffic leading to the VM instance or VPS. Ingress is traffic entering the network VM instance and Egress is traffic leaving the network VM instance. There are 4 settings or default firewall rules provided, namely:

  • default-allow-ssh: allows traffic to SSH port 22.
  • default-allow-icmp: allows ICMP protocol traffic, the protocol used by the PING program.
  • default-allow-rdp: allows traffic to RDP (Remote Desktop Protocol) port 3389.
  • default-allow-internal : allows internal network traffic or private networks.

Article content

To create an HTTP protocol with port 80, click the Create Firewall Rule menu, the firewall creation page will appear as follows.

Article content

Name : enter the name of the rule to be created, allow-all-http

Article content

Direction of traffic: select ingress, Action on match: select allow

Article content

Target : if your VM instance has a certain tag, select Specified target tags and fill in the Target tags, but if it doesn't have a tag, select All instances in the network. Source filter : select ipv4 ranges. Source IPv4 ranges : enter the IP address range of the traffic source, fill in 0.0.0.0/0, meaning from any IP address.

Article content

Protocols and ports are the protocol and port numbers you want to filter, select Specified protocols and ports, fill in TCP Ports: 80 and click the create button to save the results of the HTTP protocol configuration.

To create an HTTPS protocol, the method is almost the same as creating HTTP, the only difference is in TCP Ports, for TCP Ports use ports: 443.

If everything has been completed then the firewall rules for HTTP and HTTPS already exist, the results can be seen on the main Firewall Rule page as shown in the image below.

Article content

That's it for this post about creating firewall rules on the Google Cloud platform. So, Don't hesitate to ask me if you are missing or you want to add something that I might be missing in this post. Thank you for your time reading this 👌

To view or add a comment, sign in

More articles by Hasbullah Dedat Hasbala M

Others also viewed

Explore content categories