Search code examples
google-cloud-platformgoogle-vpc

Inter-subnet communication within the same VPC - GCP


I am fairly new to GCP networking and I could use some guidance. I'm sure there is a simple explanation for what I'd like to accomplish.  I believe its just a simple firewall rule but I'm not sure how to configure the rule.

I current have 3 subnets in the same VPC network. I'd like subnet-a to be a "jump-network" for admins doing work on compute instances in subnet-b and subnet-c over various ports. i.e. 22, 3389, 80, 443 etc etc. Admins will work on a jump VM (windows) in subnet-a and access compute instances (both windows/linux) in subnet-b and subnet-c. (using private IP addresses)

I'm sure there are simple firewall rules to allow connectivity between subnets inside the same VPC. Can someone help me? What are the firewall rules? 

Thanks. Any and all input from the community is greatly appreciated.  

Ive tried several firewall rules from various google searches, but I don't want to leave my network open to the malicious threat actors by incorrectly configuring the firewall.


Solution

  • As answered by @JohnHanley in another post

    VPC subnets within the same VPC can communicate with each other. The VPC Firewall rule default-allow-internal allows all TCP, UDP, and ICMP traffic between resources within the same VPC. The key is to use the internal (private) IP address.

    When creating VPC Networks, you have the option to automatically create default firewall rules such as default-allow-internal which allows connectivity between instances on any port. As mentioned, you'll just have to use the Internal IP address of the instance(s) that you are trying to connect to

    You may refer to this documentation as a helpful guide for creating simple Firewall rules for your use case.