Pasting from clipboard to Firewall Rule IP

113 views
Skip to first unread message

Anita Wong

unread,
Oct 26, 2017, 1:23:15 AM10/26/17
to gce-discussion
Hi, 

I found a problem, when I try to enable firewall rule to let Stackdriver access 1 of my ports, I found that I can only paste the IPs one-by one to the source filter.

I've tried using the following delimiters to see if I can copy and paste those IPs in batch, but all failed:
  • line break
  • comma
  • comma + line break
  • comma + space
  • semi-colon
Is it possible to copy and paste those IPs in batch?

Thanks.

Dinesh (Google Platform Support)

unread,
Oct 26, 2017, 4:02:00 PM10/26/17
to gce-discussion

Hello Anita,


You can’t paste multiple IP addresses at GCE console. Alternatively, you can use gcloud command in GCE to create firewall rule with multiple source IP addresses.


For example: Following command create a firewall rule(weeefr313) that allow tcp port 8080 for four source ip addresses.

gcloud compute firewall-rules create weeefr313  --allow tcp:8080 --source-ranges=172.168.1.5,172.168.1.6,172.168.1.9,125.123.123.3;


Moreover, if you want to mention IP address in the range, you have to use CIDR (Classless Inter-Domain Routing) format and enter lowest IP address in the subnet with the netmask.  For example, if you want to add IP range from 192.168.2.1 to 192.168.2.254, you have to enter in source IP range 192.168.2.0/24 (network ID along with netmask).You can calculate IP min and IP max from this link for given network IP and netmask.
Reply all
Reply to author
Forward
0 new messages