tuhinkumar
tuhinkumar

Reputation: 11

Public IPv4 communication within VPC in GCP

In Google Cloud Platform, a subnet contains two VMs;
If VM "A" has a public IPv4 address, can another VM in the same subnet reach it using A's public IPv4 address?

Upvotes: 0

Views: 179

Answers (2)

Priya Gaikwad
Priya Gaikwad

Reputation: 495

Generally, a VM cannot ping a public IP address that is attached to another VM in the same environment. To communicate between instances on the same Virtual Private Cloud (VPC) network, you can use the internal IP address for the instance.

It’s important to know that you don't need public IP address per each VM within same VPC to communicate and this will really help network performance. On the other hand, if you need VM to be communicate with internet or with any VM in different VPC network, your VM has to have an public IP address unless you setup certain proxy or VPN in other network.

Upvotes: 0

Arnau Senserrich
Arnau Senserrich

Reputation: 431

It won't leave Google's internal network, but if your firewall rules allow it (as you're asking about vm to vm), it will be reachable.

Upvotes: 1

Related Questions