Reputation: 11
Looking for a gcloud command that will return all external IPs of the instances currently active.
I understand gcloud compute addresses list returns a list of all instances but is there a way to filter out certain information to just return external IPS.
Thanks! :)
Upvotes: 0
Views: 2037
Reputation: 152
If an address is internal, then the "addressType" field will specify INTERNAL. Otherwise, it defaults to EXTERNAL. So, to list external IPs, you can use this command:
$ gcloud compute addresses list --filter "NOT addressType:INTERNAL"
Reference: https://cloud.google.com/compute/docs/reference/rest/v1/addresses
Upvotes: 3