Loading...
No results found.

Google Cloud Skills Boost

Apply your skills in Google Cloud console

04

Gemini for Network Engineers

Get access to 700+ labs and courses

Creating a VPC Network with Gemini

Lab 45 minutes universal_currency_alt 5 Credits show_chart Introductory
info This lab may incorporate AI tools to support your learning.
Get access to 700+ labs and courses

Overview

Gemini for Google Cloud is an always-on AI collaborator that provides help to users of all skill levels where they need it. In this lab, you use Gemini to get information you need to create a VPC network with a dual-stack subnet. You use this information to create the VPC network.

Note: Duet AI was renamed to Gemini, our next-generation model. This lab has been updated to reflect this change. Any references to Duet AI in the user interface or documentation should be treated as equivalent to Gemini while following the lab instructions. Note: As an early-stage technology, Gemini can generate output that seems plausible but is factually incorrect. We recommend that you validate all output from Gemini before you use it. For more information, see Gemini for Google Cloud and responsible AI.

Objectives

In this lab, you learn how to perform the following tasks:

  • Enable Gemini.
  • With help from Gemini, create a VPC network.
  • With help from Gemini, verify that the VPC network was created.

Setup and requirements

For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.

  1. Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is the Lab Details panel with the following:

    • The Open Google Cloud console button
    • Time remaining
    • The temporary credentials that you must use for this lab
    • Other information, if needed, to step through this lab
  2. Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).

    The lab spins up resources, and then opens another tab that shows the Sign in page.

    Tip: Arrange the tabs in separate windows, side-by-side.

    Note: If you see the Choose an account dialog, click Use Another Account.
  3. If necessary, copy the Username below and paste it into the Sign in dialog.

    {{{user_0.username | "Username"}}}

    You can also find the Username in the Lab Details panel.

  4. Click Next.

  5. Copy the Password below and paste it into the Welcome dialog.

    {{{user_0.password | "Password"}}}

    You can also find the Password in the Lab Details panel.

  6. Click Next.

    Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials. Note: Using your own Google Cloud account for this lab may incur extra charges.
  7. Click through the subsequent pages:

    • Accept the terms and conditions.
    • Do not add recovery options or two-factor authentication (because this is a temporary account).
    • Do not sign up for free trials.

After a few moments, the Google Cloud console opens in this tab.

Note: To view a menu with a list of Google Cloud products and services, click the Navigation menu at the top-left, or type the service or product name in the Search field.

Task 1. Enable Gemini

In this task, you enable Gemini and its API.

  1. To set your project ID and region environment variables, in Cloud Shell, run the following commands:

    PROJECT_ID=$(gcloud config get-value project) REGION={{{project_0.default_region|set at lab start}}} echo "PROJECT_ID=${PROJECT_ID}" echo "REGION=${REGION}"
  2. To store the signed-in Google user account in an environment variable, run the following command:

    USER=$(gcloud config get-value account 2> /dev/null) echo "USER=${USER}"
  3. Enable the Cloud AI Companion API for Gemini:

    gcloud services enable cloudaicompanion.googleapis.com --project ${PROJECT_ID}
  4. To use Gemini, grant the necessary IAM roles to your Google Cloud Qwiklabs user account:

    gcloud projects add-iam-policy-binding ${PROJECT_ID} --member user:${USER} --role=roles/cloudaicompanion.user gcloud projects add-iam-policy-binding ${PROJECT_ID} --member user:${USER} --role=roles/serviceusage.serviceUsageViewer

    Adding these roles lets the user use Gemini assistance.

  5. Refresh the browser window.

    On the upper right of the browser window, you should now see the Gemini icon ().

Click Check my progress to verify the objective. Enable Gemini

Task 2. Use Gemini to learn about Google Cloud networking.

In this task, you use Gemini to get the information you need to create a VPC network.

Learn about IP address configuration

  1. Click the Gemini icon ().

  2. To begin using Gemini, click Start Chatting.

  3. In the prompt box, type this query: Explain IP addressing setup in Google Cloud, and then, and press the Enter key.

    Gemini responds with general information about creating IP addresses. Read the response.

  4. In the prompt box, type this query: How can I create a network that uses IPv4 and IPv6 addresses, and then, press the Enter key.

    Gemini responds with general information about creating a dual-stack subnet. A dual-stack subnet can contain both IPv4 and IPv6 addresses.

  5. In the response, click Show related content.

    Gemini responds with information to create a dual-stack subnet, including a link to the Google Cloud documentation.

  6. Optional: In the response, click the documentation link, and then use the Google Cloud documentation to see more information about creating a dual-stack subnet.

Learn about Cloud Firewall

  1. In the prompt box, type this query: Tell me about Cloud Firewalls, and then, press the Enter key.

    Gemini responds with general information about Cloud Firewalls and a link to the Google Cloud documentation.

  2. Optional: Read the response.

    To learn more about Cloud Firewall, click the documentation link.

Learn about Cloud NAT and private networking

  1. In the prompt box, type this query: What are the best practices for a private network, and then, press the Enter key.

    Gemini responds with a list of best practices. Read the response containing the list of private network best practices.

  2. In the prompt box, type this query: How does NAT work in Google Cloud, and press the Enter key.

    Gemini responds with a description of Cloud NAT.

  3. Optional: read the response, and click the link to the Google Cloud documentation.

Learn about BGP (Border Gateway Protocol)

  1. In the prompt box, type this query: Does Google Cloud use BGP, and then, press the Enter key.

    Gemini responds with general information about how Google Cloud uses BGP.

  2. Optional: read the response, and click the link to the Google Cloud documentation.

Learn about creating a VPC network

  1. In the prompt box, type this query: Provide documentation to create a VPC network, and then, press the Enter key.

    Gemini responds with general information about creating a VPC network.

  2. In the response, click Show related content.

    Gemini responds with links to the Google Cloud documentation about creating a VPC network.

  3. In the response, click a link that shows you how to create and use a VPC network, and then read through the steps for how to create a custom mode VPC network with a dual-stack subnet.

  4. Minimize the Gemini panel.

Task 3. Create the privatenet VPC network.

You apply what you learned in the previous task to create the privatenet VPC network.

  1. On the Navigation menu, click VPC network > VPC Networks.

  2. Click Create VPC network.

  3. For Name, type privatenet.

  4. For Subnet creation mode, click Custom.

  5. For Configure a ULA internal IPv6 range for this VPC network, click Enabled.

  6. For New subnet, specify the following, and leave the remaining settings as their defaults:

    Property Value (type value or select option as specified)
    Name privatenet-subnet-us
    Region
    IP stack type IPv4 and IPv6 (dual-stack)
    IPv4 range 10.130.0.0/20
    IPv6 access type Internal
  7. Click Done.

  8. Scroll to Firewall rules, and then, on the IPv4 firewall rules tab, select all rules.

  9. Click the IPv6_firewall_rules tab, and then select all rules.

  10. Click Create. When the VPC network is created, it appears under VPC Networks in the console.

Click Check my progress to verify the objective. Configuring the privatenet VPC network

Task 4. List all available VPC networks.

In this task, you use Gemini to learn how to use the gcloud CLI to view information about all the VPC networks in your Google Cloud project.

  1. In the Google Cloud console title bar, click the Open Gemini icon ().

    The Gemini frame appears on the right side of the console.

  2. In the prompt box in the Gemini frame, enter How do I check my networks in Google Cloud using gcloud CLI commands and press Enter.

    The response contains information about getting network information and should include the this command:

    gcloud compute networks list
  3. From Gemini, or from the code box in the previous step, copy the gcloud compute networks list command.

  4. In the console, click Activate Cloud Shell ().

  5. If prompted, click Continue.

  6. At the command prompt, paste the gcloud CLI command you copied previously and press Enter to execute the command.

  7. If prompted, click Authorize.

You should see this result:

NAME: default SUBNET_MODE: AUTO BGP_ROUTING_MODE: REGIONAL IPV4_RANGE: GATEWAY_IPV4: NAME: privatenet SUBNET_MODE: CUSTOM BGP_ROUTING_MODE: REGIONAL IPV4_RANGE:

Review

In this lab, you enabled Gemini and used it to learn how to create a VPC network with a dual-stack subnet.

End your lab

When you have completed your lab, click End Lab. Qwiklabs removes the resources you’ve used and cleans the account for you.

You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.

The number of stars indicates the following:

  • 1 star = Very dissatisfied
  • 2 stars = Dissatisfied
  • 3 stars = Neutral
  • 4 stars = Satisfied
  • 5 stars = Very satisfied

You can close the dialog box if you don't want to provide feedback.

For feedback, suggestions, or corrections, please use the Support tab.

Copyright 2024 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.

Previous Next

Before you begin

  1. Labs create a Google Cloud project and resources for a fixed time
  2. Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
  3. On the top left of your screen, click Start lab to begin

This content is not currently available

We will notify you via email when it becomes available

Great!

We will contact you via email if it becomes available

One lab at a time

Confirm to end all existing labs and start this one

Use private browsing to run the lab

Use an Incognito or private browser window to run this lab. This prevents any conflicts between your personal account and the Student account, which may cause extra charges incurred to your personal account.
Preview