AdSense

網頁

2023/4/19

GCP gcloud CLI 建立VPC network

GCP gcloud cli建立VPC network


範例環境:

  • Google Cloud SDK 417.0.1

在命令列輸入gcloud compute networks create demo-vpc-001 --project=<project> --subnet-mode=custom --mtu=1460 --bgp-routing-mode=regional如下。<project>為project名稱。

~% gcloud compute networks create demo-vpc-001 --project=project-id-1 --subnet-mode=custom --mtu=1460 --bgp-routing-mode=regional
Created [https://www.googleapis.com/compute/v1/projects/project-id-1/global/networks/demo-vpc-001].
NAME          SUBNET_MODE  BGP_ROUTING_MODE  IPV4_RANGE  GATEWAY_IPV4
demo-vpc-001  CUSTOM       REGIONAL


Instances on this network will not be reachable until firewall rules
are created. As an example, you can allow all internal traffic between
instances as well as SSH, RDP, and ICMP by running:

$ gcloud compute firewall-rules create <FIREWALL_NAME> --network demo-vpc-001 --allow tcp,udp,icmp --source-ranges <IP_RANGE>
$ gcloud compute firewall-rules create <FIREWALL_NAME> --network demo-vpc-001 --allow tcp:22,tcp:3389,icmp

建立好的結果同此篇


沒有留言:

AdSense