Every packet that leaves a virtual machine in Google Cloud needs directions. Should it stay inside the network, go out to the internet, or travel through a VPN tunnel to your office? The thing that answers that question is a route. Routes are the rules a Virtual Private Cloud network uses to decide where traffic goes next.
Most of the time you never touch them. Google Cloud creates routes automatically, so your machines can talk to each other and reach the internet from the moment you create a network. Routes matter when your design gets more interesting: sending traffic through a firewall appliance, reaching an on premises network, steering one group of machines differently from another, or blocking the default internet path.
This guide explains what a route is made of, the types you will meet, and how Google Cloud picks one when several match. Then it shows you how to create a custom static route in the console with the original screenshots kept in order, repeats the job with gcloud, and ends with common mistakes and a short FAQ.
A route tells the network that traffic heading for a certain range of addresses should be sent to a certain next hop. Each route has a few fields.
| Field | What it does |
|---|---|
| Destination | The range of IP addresses the route applies to, written in CIDR format such as 10.50.0.0/24 |
| Next hop | Where matching traffic is sent, such as the default internet gateway, a virtual machine, a VPN tunnel or an internal load balancer |
| Priority | A number that breaks ties between routes with the same destination. A lower number wins |
| Network tags | An optional list of tags that limits the route to machines carrying those tags |
| Network | The VPC network the route belongs to |
Several routes can match the same packet, so Google Cloud runs a selection order. Reading Google’s documentation, the main points for a custom route are these:
That explains why the default route is a last resort. Its destination 0.0.0.0/0 is the least specific range possible, so any more specific route wins over it.
Prerequisites:
Menu labels move from time to time, so treat the wording below as a guide.
1. Sign in to the Google Cloud console.
2. Open the navigation menu, choose VPC network and then Routes. This page lists every route in the project, including the automatic ones.

3. Click Create route.

4. Give the route a clear name, such as route-to-appliance, and select the network, either the default network or your own VPC network.

5. Enter the destination IP range for the route in CIDR format. To apply the route only to certain machines, add network tags. Then choose the next hop type and target, and set a priority. The default priority is 1000, and a lower number wins.

6. Click Create. The route appears in the list within a few seconds.
The same route from the command line, using a virtual machine as the next hop:
gcloud compute routes create route-to-appliance –network=default –destination-range=10.50.0.0/24 –next-hop-instance=appliance-vm –next-hop-instance-zone=us-central1-a –priority=900 –tags=app-servers
Machines that carry the app-servers tag will now send traffic for 10.50.0.0/24 to appliance-vm. The next hop machine must have IP forwarding enabled, which you set when you create it:
gcloud compute instances create appliance-vm –zone=us-central1-a –can-ip-forward
List the routes in your network to confirm, and delete the route when you finish:
gcloud compute routes list –filter=”network:default”
gcloud compute routes delete route-to-appliance
Once you understand destination, next hop and priority, Google Cloud routing stops feeling mysterious. Start with a single tagged route to a test machine, confirm it with the routes list, and build up from there.