Skip to content

Latest commit

 

History

History
79 lines (53 loc) · 3.19 KB

File metadata and controls

79 lines (53 loc) · 3.19 KB

GSP211 - Multiple VPC Networks

Task 1. Create custom mode VPC networks with firewall rules

  1. Create the managementnet network

    gcloud compute networks create managementnet --project=qwiklabs-gcp-00-5b3087332df1 --subnet-mode=custom --mtu=1460 --bgp-routing-mode=regional
    gcloud compute networks subnets create managementsubnet-us --project=qwiklabs-gcp-00-5b3087332df1 --range=10.130.0.0/20 --stack-type=IPV4_ONLY --network=managementnet --region=us-east1
  2. Buat privatenet network

    gcloud compute networks create privatenet --subnet-mode=custom
    gcloud compute networks subnets create privatesubnet-us --network=privatenet --region=us-east1 --range=172.16.0.0/24
    gcloud compute networks subnets create privatesubnet-eu --network=privatenet --region=europe-west1 --range=172.20.0.0/20
  3. List networks

    gcloud compute networks list
    gcloud compute networks subnets list --sort-by=NETWORK
  4. Create firewall rules managementnet

    gcloud compute --project=qwiklabs-gcp-00-5b3087332df1 firewall-rules create managementnet-allow-icmp-ssh-rdp --direction=INGRESS --priority=1000 --network=managementnet --action=ALLOW --rules=tcp:22,tcp:3389,icmp --source-ranges=0.0.0.0/0
  5. Create firewall rules privatenet

    gcloud compute firewall-rules create privatenet-allow-icmp-ssh-rdp --direction=INGRESS --priority=1000 --network=privatenet --action=ALLOW --rules=icmp,tcp:22,tcp:3389 --source-ranges=0.0.0.0/0
  6. List firewall rule

    gcloud compute firewall-rules list --sort-by=NETWORK

Task 2. Create VM instances

  1. Create managementnet-us-vm in managementsubnet-us

    gcloud compute instances create managementnet-us-vm --project=qwiklabs-gcp-00-5b3087332df1 --zone=us-east1-b --machine-type=e2-micro --network-interface=network-tier=PREMIUM,stack-type=IPV4_ONLY,subnet=managementsubnet-us --metadata=enable-oslogin=true --maintenance-policy=MIGRATE --provisioning-model=STANDARD --service-account=215804974768-compute@developer.gserviceaccount.com --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append --create-disk=auto-delete=yes,boot=yes,device-name=managementnet-us-vm,image=projects/debian-cloud/global/images/debian-11-bullseye-v20230509,mode=rw,size=10,type=projects/qwiklabs-gcp-00-5b3087332df1/zones/us-east1-b/diskTypes/pd-balanced --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --labels=goog-ec-src=vm_add-gcloud --reservation-affinity=any
  2. Create privatenet-us-vm instance

    gcloud compute instances create privatenet-us-vm --zone="us-east1-b" --machine-type=e2-micro --subnet=privatesubnet-us
  3. List all vm instances

    gcloud compute instances list --sort-by=ZONE

Task 3. Explore the connectivity between VM instances

Task 4. Create a VM instance with multiple network interfaces