How to block the traffic come from Australia and China

735 views
Skip to first unread message

Bridger Hung

unread,
Feb 15, 2021, 12:58:11 PM2/15/21
to gce-discussion
How to set up the Firewall in GCP efficiently?


I looked up, still don't know how to do
How to avoid the cost? 

螢幕擷取畫面 2021-02-14 221710.jpg

Fady (Google Cloud Platform)

unread,
Feb 15, 2021, 9:39:40 PM2/15/21
to gce-discussion

It seems that the last answer in the post is the most efficient way to add firewall rules with that many IP ranges, and using this gcloud command. Generally, here is a good document on using firewall rules that should help. 

There are too many IP ranges for any given country to try to efficiently add them to a deny firewall rule. Maybe using Cloud Armor would be a good alternative as the security policy can be configured for a region. Though, you may need to verify the cost of the solution if it would be beneficial for your use-case. 


Zach Hanna

unread,
Feb 16, 2021, 11:12:34 AM2/16/21
to Fady (Google Cloud Platform), gce-discussion
Consider using Cloud Armor instead and putting your instances behind a GCLB. 
There is no reason to have a public IP on an instance for things like SSH. 

On Mon, Feb 15, 2021 at 7:39 PM 'Fady (Google Cloud Platform)' via gce-discussion <gce-dis...@googlegroups.com> wrote:

It seems that the last answer in the post is the most efficient way to add firewall rules with that many IP ranges, and using this gcloud command. Generally, here is a good document on using firewall rules that should help. 

There are too many IP ranges for any given country to try to efficiently add them to a deny firewall rule. Maybe using Cloud Armor would be a good alternative as the security policy can be configured for a region. Though, you may need to verify the cost of the solution if it would be beneficial for your use-case. 


--
© 2018 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-discussio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/593c4fbe-ff84-4406-b562-46852233973fn%40googlegroups.com.

Fady (Google Cloud Platform)

unread,
Feb 16, 2021, 8:16:56 PM2/16/21
to gce-discussion

Concerning the Private message about the syntax error “ bash No such file ..” when using the gcloud command, you would need to remove the characters < > in the project ID such as:

gcloud compute --project=projectID … 

The SDK does not consider the operators as part of the project ID and throws the error. This is mainly because it expects the project ID to start with a letter. This is explained in this document. I hope this helps.


Reply all
Reply to author
Forward
0 new messages