Create a firewall rule on GCP Cloud from command line

+2 votes

Hi Guys,

I have created one VPC on GCP Cloud from the command line. I want to add one firewall rule to this VPC. Can anyone tell me how can I create a firewall rule from the command line?

Aug 24, 2020 in GCP by akhtar
• 38,260 points
2,274 views

1 answer to this question.

0 votes

Hi@akhtar,

You need to configure GCP Cloud SDK in your command line. It will connect to your GCP Cloud API. After that, you can use the below command to create a firewall rule to your VPC.

$ gcloud compute --project=nadeem-gcp-123456 firewall-rules create NAME --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=PROTOCOL:PORT


Hope this helps!!

If you need to know more about Google Cloud, It's recommended to go for Google Cloud architect certification course.

Thanks!

answered Aug 24, 2020 by MD
• 95,460 points

Related Questions In GCP

0 votes
1 answer
+2 votes
1 answer

How to launch one instance on GCP Cloud from command line?

Hi@akhtar, You can compute service in GCP to launch ...READ MORE

answered Aug 24, 2020 in GCP by MD
• 95,460 points
1,027 views
+1 vote
1 answer

Create a Cloud Filestiore instance on GCP.

You could create a cloud filestore instance ...READ MORE

answered Nov 22, 2019 in GCP by Sirajul
• 59,230 points
743 views
+2 votes
1 answer

How to create a project from GCP Cloud Shell?

Hi@akhtar, GCP shell has a command named gcloud. ...READ MORE

answered Aug 23, 2020 in GCP by MD
• 95,460 points
2,002 views
0 votes
1 answer

Does Google cloud platform (GCP) offer IaaS ? Or just PaaS?

GCP provides IaaS as well, although it ...READ MORE

answered Sep 20, 2019 in GCP by Sirajul
• 59,230 points
7,001 views
0 votes
1 answer

How do I create a Google Cloud Platform (GCP) account?

In order to access the services provided ...READ MORE

answered Sep 20, 2019 in GCP by Sirajul
• 59,230 points
2,740 views
0 votes
1 answer

How do I create a VPCN (Virtual private cloud network) on Google Cloud?

You can connect various GCP resources to each ...READ MORE

answered Sep 23, 2019 in GCP by Sirajul
• 59,230 points
1,811 views
0 votes
1 answer

Cloud SQL of google cloud is IaaS or PaaS?

Cloud SQL is PAAS (Plaform As A ...READ MORE

answered Sep 23, 2019 in GCP by Sirajul
• 59,230 points
3,973 views
+2 votes
1 answer

How to create a VPC on GCP from command line?

Hi@akhtar, To create a personal network, you need ...READ MORE

answered Aug 24, 2020 in GCP by MD
• 95,460 points
1,467 views
+2 votes
1 answer

How to create a firewall rule in GCP Cloud?

Hi@akhtar, If you are using the default VPC ...READ MORE

answered Aug 23, 2020 in GCP by MD
• 95,460 points
1,612 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP