How to do it...

We'll create a web server whose public web traffic (data) will be served by the beta-data network and the SSH into the web server would be via the alpha-mgmt network:

  1. Firstly, we'll set up some firewall rules to the alpha and beta networks. In the alpha-mgmt network, open the SSH port 22 to all servers with the network tag alpha-server:
gcloud compute --project=<project id> firewall-rules createallow-ssh-alpha-servers --description="Allow ssh access to all servers with network tag alpha-server" --direction=INGRESS --priority=1000 --network=alpha-mgmt--action=ALLOW --rules=tcp:22 --source-ranges=0.0.0.0/0--target-tags=alpha-server

The created rule on the Console will be similar to the following screenshot:

  1. In the beta network, ...

Get Google Cloud Platform Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.