aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
  • Engineering

IP Addressing Options In Google Cloud: Networking Basics

  • aster.cloud
  • April 12, 2022
  • 5 minute read

In this blog we’ll be visiting the topics of IP addresses and subnetting on Google Cloud. IP addressing and subnetting can be confusing to many, but addressing is a very important requirement in your network.

An IP address is a unique identifier for a network and a host. To separate an IP address into network and host segments a subnet mask is used. You can compare this to a city block which has a street and buildings with numbers. The IP addresses and city block analogy can be mapped as follows:


Partner with aster.cloud
for your next big idea.
Let us know here.



From our partners:

CITI.IO :: Business. Institutions. Society. Global Political Economy.
CYBERPOGO.COM :: For the Arts, Sciences, and Technology.
DADAHACKS.COM :: Parenting For The Rest Of Us.
ZEDISTA.COM :: Entertainment. Sports. Culture. Escape.
TAKUMAKU.COM :: For The Hearth And Home.
ASTER.CLOUD :: From The Cloud And Beyond.
LIWAIWAI.COM :: Intelligence, Inside and Outside.
GLOBALCLOUDPLATFORMS.COM :: For The World's Computing Needs.
FIREGULAMAN.COM :: For The Fire In The Belly Of The Coder.
ASTERCASTER.COM :: Supra Astra. Beyond The Stars.
BARTDAY.COM :: Prosperity For Everyone.

  • Network portion – This would be equivalent to the street address. One street may have many buildings on it. e.g 192.168.10.20/24 the 192.168.10 represents the network and the /24 represent the subnet mask (this will be explained in a later section).
  • The host portion – This is equivalent to the building number. This is where the building is located on the street. E.g. 192.168.10.20/24 the .20 represents the host on the network.

 

There are two versions of IP, IPv4 and IPv6 each with different address formats. IPV6 addressing was created due to limitations in the amount of available IPv4 addresses. One of the main drivers for increased consumption of IPv4 addressing was the growth of the internet.

  • An IPV4 address consists of 32 binary bits, divided into 4 octets. This can be written in dotted decimal format. eg. 192.168.20.1 or binary.
  • An IPV6 address consists of 128 bits, divided into 16 bit hexadecimal fields. Example of IPV6 address is 2001:DB8:7654:3210:FEDC:BA98:764:3203

IP addresses exist both on-prem and in the cloud. Let’s explore a few IP options like private, secondary, external and Bring your own IP (BYOIP) that can be used in Google Cloud.

 

Private addresses (RFC 1918)

Private IP addresses are taken from a reserved block of address that can be used internally within a network. This range is defined as a Request For Comments (RFC) standard RFC1918. These private address ranges are not unique to Google Cloud and can be used by any enterprise. Private IP addresses are non internet routable, meaning they cannot connect directly to the internet. The private IP ranges are:

  • 10.0.0.0 -10.255.255.255 (/8)
  • 172.16.0.0 – 172.31.255.255 (/12)
  • 192.168.0.0 -192.168.255.255 (/16)
Read More  Developer Research Deep Dive: Let’s Build Faster Together

Default Reserved IP addresses

In Google Cloud primary subnets, 4 IP addresses are automatically reserved. These Reserved IP addresses are:

  • Network address
  • Default gateway
  • Second-to-last address
  • Broadcast address

 

To help make this clearer let’s look at the same 192.168.10.20 network with a /24 subnet.

  • The /24 means 24 bits out of the 32 bits will be used by the network.
  • The remaining 8 bits will be used by the host. To determine the total amount of addresses we can use the formula 28 = 256.
  • In a standard network the first address and last address is reserved. These are known as the network address and the broadcast address. e.g.  192.168.10.0 and 192.168.10.255.
  • Because of this reservation the formula for available host addresses is 2n – 2. This would be 28 – 2 = 254

In Google Cloud because 4 addresses are reserved the formula becomes 28 – 4 so a /24 network would have 252 addresses available for hosts.

Address assignment

Ephemeral IP addresses are assigned automatically to your VMs and services in Google Cloud. This is done via DHCP.  You can also manually assign a reserved static internal IP address to your VMs if stable addresses are required.

Subnet limitations

The smallest subnet available in GCP is /29 which means 4 hosts or 23 – 4. This is different from on-prem private addresses in which the smallest subnet can be a /30 or /31 for point-to-point links. Please keep this in mind when assigning address subnets.

Privately used public IP (PUPI) addresses

These are addresses that would under normal circumstances be routable on the internet. When used in your VPC they are treated as private addresses and not advertised to the internet routing table. PUPI addresses can be used in Google Kubeternes Engine (GKE) as in this  example.

Read More  Launching New Feature Or Games On Existing Cloud Spanner Database With Load Generator Tool

Secondary addresses

Secondary IP Addresses are additional addresses that can be assigned to your virtual machines. An example of this would be assigning an alias IP address to your VM from the secondary IP address range for use by a particular service running on the VM.

External Addresses

External IP addresses are internet routable and allow direct communication to the internet. Just like private IP addresses, ephemeral external IP addresses can be automatically assigned or you can reserve static external IP addresses to use on your VMs, load balancers, and other services where they can be applied.

External IPv4 addresses are a limited resource and should be used with care. Both static and ephemeral external IP addresses incur cost. If you reserve a static external IP address and do not assign it to a resource, you will be charged at a higher rate than for static and ephemeral external IP addresses that are in use.

Bring your own IP (BYOIP)

With this catchy name it accurately describes that you can bring public IP addresses that you own to use on your Google Cloud resources. This requires a little process that you can read more about in the VPC BYOIP documentation .

Prohibited subnet ranges

There are certain ranges that are prohibited from being assigned to your Google Cloud resources. You can get a list of these ranges here.

IPv6 addresses

IPv6 can be enabled in certain regions. Some on the basic steps to enable IPv6 address are:

  • Create a custom VPC and add a subnet in any of the following regions
    • asia-east1
    • asia-south1
    • europe-west2
    • us-west2
  • Next enable IPv6 on the subnet.
Read More  Transforming the Developer Experience for Every Engineering Role

 

gcloud compute networks subnets update SUBNET \
    --stack-type=IPV4_IPV6 \
    --ipv6-access-type=EXTERNAL \
    --region=REGION

 

  • Next you create or enable IPv6 on an existing VM in the applicable region
  • Next you can also create an IPv6 instance template

 

gcloud compute instance-templates create NAME \
  --ipv6-network-tier=PREMIUM \
  --stack-type=IPV4_IPV6 \
  --subnet=SUBNET \
  --region=REGION \
  --tags=TAGS \
  --image=IMAGENAME

 

Common Google Cloud services that use IP addressing

There are several services that use IP addressing. These are the most common, but this is not a complete list:

  • VMs
  • Databases
  • Load Balancers
  • Google Kubernetes Engine (Containers, Clusters, Pods, Services, Ingress)

Some helpful advice

Google Cloud helps you by handling a lot of the standard issues with IP addressing so that you can create a project and begin building. As your enterprises and projects evolve you may want to connect to on-prem facilities, other projects, and other clouds. To save yourself a bunch of headaches, spend some time planning your IP address assignments.

This is especially relevant so that you can avoid the problem of overlapping IP addresses. Take time to consider the following as you plan:

  • Estimated growth plans
  • Upcoming expansions
  • Existing subnets in other environments
  • Scaling requirements
  • Possibility of acquisitions

To learn more about IP addressing on Google Cloud, check the following links:

  • Documentation: IP Addressing
  • Blog post: Understanding IP address management in GKE
  • Video: IP addressing in the cloud
  • Video: BYOIP on Google Cloud
  • Git:  IPAM Autopilot
  • Floating IP addresses in Compute Engine

Want to ask a question, find out more or share a thought? Please connect with me on Twitter or Linkedin and send me a message.

 

 

By: Ammett Williams (Developer Relations Engineer)
Source: Google Cloud Blog


For enquiries, product placements, sponsorships, and collaborations, connect with us at [email protected]. We'd love to hear from you!

Our humans need coffee too! Your support is highly appreciated, thank you!

aster.cloud

Related Topics
  • Development
  • Google Cloud
  • Networking
You May Also Like
View Post
  • Engineering

Just make it scale: An Aurora DSQL story

  • May 29, 2025
View Post
  • Engineering
  • Technology

Guide: Our top four AI Hypercomputer use cases, reference architectures and tutorials

  • March 9, 2025
View Post
  • Computing
  • Engineering

Why a decades old architecture decision is impeding the power of AI computing

  • February 19, 2025
View Post
  • Engineering
  • Software Engineering

This Month in Julia World

  • January 17, 2025
View Post
  • Engineering
  • Software Engineering

Google Summer of Code 2025 is here!

  • January 17, 2025
View Post
  • Data
  • Engineering

Hiding in Plain Site: Attackers Sneaking Malware into Images on Websites

  • January 16, 2025
View Post
  • Computing
  • Design
  • Engineering
  • Technology

Here’s why it’s important to build long-term cryptographic resilience

  • December 24, 2024
IBM and Ferrari Premium Partner
View Post
  • Data
  • Engineering

IBM Selected as Official Fan Engagement and Data Analytics Partner for Scuderia Ferrari HP

  • November 7, 2024

Stay Connected!
LATEST
  • 1
    Just make it scale: An Aurora DSQL story
    • May 29, 2025
  • 2
    Reliance on US tech providers is making IT leaders skittish
    • May 28, 2025
  • Examine the 4 types of edge computing, with examples
    • May 28, 2025
  • AI and private cloud: 2 lessons from Dell Tech World 2025
    • May 28, 2025
  • 5
    TD Synnex named as UK distributor for Cohesity
    • May 28, 2025
  • Weigh these 6 enterprise advantages of storage as a service
    • May 28, 2025
  • 7
    Broadcom’s ‘harsh’ VMware contracts are costing customers up to 1,500% more
    • May 28, 2025
  • 8
    Pulsant targets partner diversity with new IaaS solution
    • May 23, 2025
  • 9
    Growing AI workloads are causing hybrid cloud headaches
    • May 23, 2025
  • Gemma 3n 10
    Announcing Gemma 3n preview: powerful, efficient, mobile-first AI
    • May 22, 2025
about
Hello World!

We are aster.cloud. We’re created by programmers for programmers.

Our site aims to provide guides, programming tips, reviews, and interesting materials for tech people and those who want to learn in general.

We would like to hear from you.

If you have any feedback, enquiries, or sponsorship request, kindly reach out to us at:

[email protected]
Most Popular
  • Understand how Windows Server 2025 PAYG licensing works
    • May 20, 2025
  • By the numbers: How upskilling fills the IT skills gap
    • May 21, 2025
  • 3
    Cloud adoption isn’t all it’s cut out to be as enterprises report growing dissatisfaction
    • May 15, 2025
  • 4
    Hybrid cloud is complicated – Red Hat’s new AI assistant wants to solve that
    • May 20, 2025
  • 5
    Google is getting serious on cloud sovereignty
    • May 22, 2025
  • /
  • Technology
  • Tools
  • About
  • Contact Us

Input your search keywords and press Enter.