My company has a Google Compute Engine server hosted in North America. We get so many Chinese IP addresses sending requests to port 11 that it is costing us money for the ingress. Our firewall blocks all connections to China already as they have no business having access to our applications.

Is there a way to completely ignore these connections or have them blocked in such a way that they will not eat up bandwidth?

  • 3
    That's going to be on Google, if they want to support that. You can't control anything on the other side of your ingress ports.
    – Hyppy
    Commented May 28, 2015 at 16:40
  • Why have port 11 open at all?
    – ceejayoz
    Commented May 28, 2015 at 16:49
  • 1
    Google charges you for traffic to blocked ports? Yeesh.
    – ceejayoz
    Commented May 28, 2015 at 17:46
  • 1
    @TomTom According to cloud.google.com/compute/pricing#network ingress traffic is free. As long as the port is closed there shouldn't be any egress to charge.
    – ceejayoz
    Commented May 28, 2015 at 21:03
  • 2
    @josh123a123 did you manage to lower those costs? I'm having the same prblem
    – Fabio
    Commented Oct 26, 2015 at 2:26

3 Answers 3


Firewalls have two main choices when receiving unwanted connection attempts.

  1. REJECT - send a response saying the port/service/etc is closed or
  2. DROP - don't respond and just drop the packets

The words REJECT/DROP aren't standard or used across all firewalls but the difference between the concepts behind the two possible actions will be there. You want to do the equivalent of DROP so there is no outbound traffic. As mentioned by others inbound traffic incurs no charges.


There is no charge for the Google Compute Engine ingress traffic. Take a look at GCE network pricing. If you've been charged for the ingress traffic, you can contact the Cloud billing team to clarify and fix the charge.

Regarding the requests to port 11, as far as this port is blocked in your GCE network's firewall your VM instances should be safe and the requests should not eat up the bandwidth.

I'm curious to know the way in which you monitor these requests.

  • I looked at the bill again and the charge is for egress. I was rejecting the traffic which was where the outgoing bandwidth was getting eaten up. Commented May 29, 2015 at 14:25
  • 7
    Note that there is no REJECT mode/choice for GCE Firewall. The network checks for a firewall rule that permits a connection to the target: if so, it sends it on; if not, it simply drops the packet without informing the sender. For more information you can check out "Who Handles What" part of this article: cloud.google.com/compute/docs/networking#networkingdetails
    – Kamran
    Commented May 29, 2015 at 14:51

Here are the cloud shell commands to add the firewall rules:

gcloud compute firewall-rules create no-china-1 --description="Blocking these Chinese bots that want to rack up my network charges" --direction=INGRESS --priority=100 --network=default --action=DENY --rules=all --source-ranges=,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

gcloud compute firewall-rules create no-china-2 --description=https://www.wizcrafts.net/chinese-blocklist.html --direction=INGRESS --priority=100 --network=default --action=DENY --rules=all --source-ranges=,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

gcloud compute firewall-rules create no-china-3 --description="2 and 3 are both made up of line 2 in the source rules" --direction=INGRESS --priority=100 --network=default --action=DENY --rules=all --source-ranges=,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

gcloud compute firewall-rules create no-china-4 --description="rule 4 is line 3 in source file, as of 2019-09-18" --direction=INGRESS --priority=100 --network=default --action=DENY --rules=all --source-ranges=,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Don't forget to supply your GCP project to these commands, either with the --project flag on each or by using gcloud config set project beforehand.

It has to be split between multiple rules because GCP limits you to 256 IP ranges per firewall rule. IP range source here.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .