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:
To create an HTTP protocol with port 80, click the Create Firewall Rule menu, the firewall creation page will appear as follows.
Name : enter the name of the rule to be created, allow-all-http
Direction of traffic: select ingress, Action on match: select allow
Recommended by LinkedIn
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.
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.
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 👌