Reputation: 1
Is it possible to have a public ip with direct access instead of being in NAT in a google compute engine virtual machine?
Thank you in advance.
Upvotes: 0
Views: 781
Reputation: 2880
You can have an external IP but by default the instance will have a NAT policy. If you need non-NAT'ed traffic, what you are looking for is a target instance because as stated in the documentation:
Target instances do not have a NAT policy applied to them.
After that, you can create forwarding rules to send traffic to your instance.
I hope it helps.
Upvotes: 3
Reputation: 1660
Static external IP addresses can be assigned to a compute engine VM.
You reserve a static external IP address in gcloud or through the API. After reserving the address, assign it to an instance during instance creation or to an existing instance. You will have to update the firewall to allow traffic on the port you want.
More info in the docs at: https://cloud.google.com/compute/docs/instances-and-network#reservedaddress
Upvotes: 1