delete Google VPC networks and subnets

Google Virtual Private Cloud (VPC) Networks Lab Exercise

The objective of the VPC networks lab exercise is to learn custom networks and auto networks creation and configuration.

Like we discussed in the previous article GCP Virtual Private Networks Fundamentals each project starts with default network (a auto mode network). When auto mode network is created, one subnet in each region is automatically created within the network.

When a custom mode network is created, no subnets are created automatically and you can have a complete control over custom network’s subnets and IP ranges.

VPC Networks Lab Exercise:

vpc networks lab excercise

Create Custom VPC Network

Specify name, description and subnet creation mode

create custom vpc networks

Specify subnet, region, IP address range, private Google access

create custom vpc networks subnet

Create another subnet ‘subnet-2’ in a similar way in different region within the same network ‘learn-custom’. You should see the following under VPC networks once you are done.

gcp custom networks

Create Auto Network

Specify name, description, subnet creation mode

create auto vpc networks

Go to VPC networks tab and verify whether subnets are automatically created in each region within the network

vpc auto networks

Create Firewall Rules

Create firewall rules for learn-custom and learn-auto networks.

Firewall rule to allow ingress tcp:22

firewall rule ingress tcp 22

Specify target tag, source IP ranges, protocols and ports.

firewall rule ingress tcp 22

Firewall rule to allow ingress icmp

firewall rule ingress icmp

Specify targets, source IP ranges, protocols and ports.

firewall rule ingress icmp

Verify whether firewall rules are successfully created.

custom vpc networks firewall rules

similarly create firewall rules for ‘learn-auto’ network also and verify yourself.

Create Compute Engine Virtual Machine Instances

Create two VM instances within custom network (learn-custom) in different zones and one VM instance in different network (learn-auto) as shown below.

vpc networks demo vm instances

Try the following
  • SSH and ping between VM in Zone A and VM in Zone B.
  • SSH and ping between VM in Zone A and VM in Zone C.
Observations
  • You would be able to ping between VMs in Zone A and Zone B through their internal IP addresses.
  • You won’t be able to ping between VMs in Zone A and Zone C through their internal IP addresses.
Reserve Static IP address

So what you need to do is reserve an external IP address (public IP) and attach to ‘vm-instance-3’ so that you could ping between VMs in Zone A and Zone C through internet.

reserve static ip address

reserve static ip address

vm reserve external ip

Now you should be able to ping between VM’s in Zone A and Zone C through external ip address or internet

vpc networks demo

Reference

Leave a Reply

avatar
  Subscribe  
Notify of