網頁

2023/6/4

GCP gcloud CLI 查看IP address

GCP gcloud CLI查看project下的IP address的方式如下。


範例環境:

  • Google Cloud SDK 417.0.1

在命令列輸入gcloud compute addresses list可顯示project下的所有IP位址。

~% gcloud compute addresses list
NAME                                      ADDRESS/RANGE    TYPE      PURPOSE      NETWORK                                       REGION           SUBNET  STATUS
test-ip                                   10.88.88.0/24    INTERNAL  VPC_PEERING  network-72f85edb-5f29-4a33-af9e-dd9070c1ca29                           RESERVED
my-ip-range                               10.100.16.0/20   INTERNAL  VPC_PEERING  my-api                                                                 RESERVED
eip-75e41a4a-044d-4429-bcf6-de69b5837070  34.81.5.53       EXTERNAL                                                             asia-east1               IN_USE
eip-03641977-fbe2-4825-a91e-c4203bc93ba3  34.150.22.82     EXTERNAL                                                             asia-east2               IN_USE

後面加上--regions=<region1>,<region2>...可查看指定region的IP位址。

~% gcloud compute addresses list --regions=asia-east1,asia-east2
NAME                                      ADDRESS/RANGE   TYPE      PURPOSE  NETWORK  REGION      SUBNET  STATUS
eip-75e41a4a-044d-4429-bcf6-de69b5837070  34.81.5.53      EXTERNAL                    asia-east1          IN_USE
eip-03641977-fbe2-4825-a91e-c4203bc93ba3  34.150.22.82    EXTERNAL                    asia-east2          IN_USE

沒有留言:

張貼留言