Step2. Create Firewall Rules

Create firewall rules for the VPC to allow the VPC access to instances.

  1. Go to the Firewall rules page in the Google Cloud Platform Console.
  2. Set Ingress firewall rule for your VPC.
    1. Click Create firewall rule.
    2. Enter a Name for the firewall rule.
      The name must be unique for the project.
    3. Select the Network as your VPC network.
    4. Specify the Priority of the rule.
      The lower the number, the higher the priority.
    5. Set the Direction of traffic to Ingress.
    6. Set the Action on match to Allow.
    7. Set the Targets to All instances in the network.
    8. Set Source filter to IP ranges and type 0.0.0.0/0 in the Source IP ranges field to define the source for incoming traffic from any network.
    9. Set Protocols and ports to Allow all.
    10. Click Create.
  3. Set Egress firewall rule for your VPC.
    1. Click Create firewall rule.
    2. Enter a Name for the firewall rule.
      The name must be unique for the project.
    3. Select the Network as your VPC network.
    4. Specify the Priority of the rule.
      The lower the number, the higher the priority.
    5. Set the Direction of traffic to Egress.
    6. Set the Action on match to Allow.
    7. Set the Targets to All instances in the network.
    8. Set Destination filter to IP ranges and type 0.0.0.0/0 in the Destination IP ranges field to define the destination for outgoing traffic to anywhere.
    9. Set Protocols and ports to Allow all.
    10. Click Create.