O'Reilly logo

Google Cloud Platform Cookbook by Legorie Rajan PS

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required