'How to connect to a GCP (Google Cloud Platform) Cloud SQL instance from an IPV6 address?

I am trying to reach our Postgres SQL server running as a GCP Cloud SQL instance from the PgAdmin 4 tool on desktop. For that you have to whitelist your IP address. Until this point it was working fine, the whole team used IPV4 addresses, but I moved to a new country where my new ISP assigned an IPV6 address to me, and it seems like GCP doesn't allow IPV6 addesses to be whitelisted, thus you can't use them to connect.

Here's a picture of the Connections/Allowed Networks tab: enter image description here

Is there any kind of solution to this? Or do they expect me to only have ISPs who assign IPV4 addesses to me?

Thank you.



Solution 1:[1]

Alternatively, you could just use the Cloud SQL Auth Proxy directly. You'll have to run an instance of it on your local machine and then PgAdmin can connect to the proxy on localhost.

Solution 2:[2]

Yes, there is a workaround for this but not using the UI, instead you need to use the Cloud SDK.

This has recently been added to cloud SDK beta. So as you can see in the documentation for gcloud sql connect:

If you're connecting from an IPv6 address, or are constrained by certain organization policies (restrictPublicIP, restrictAuthorizedNetworks), consider running the beta version of this command to avoid error by connecting through the Cloud SQL proxy: gcloud beta sql connect.

I couldn't find any Feature Requests for this being implemented into the UI at the moment, so if you'd like to have this changed I would suggest you to open one in Google's Issue Tracker system.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 enocom
Solution 2 Ralemos