STEPHANIE WONG: If you've ever used a static route
to define how traffic can move between private networks,
then you probably know how vulnerable
it is to things like component failures,
or the wind, or squirrels.
In this episode of "Cloud Networking,"
I'll show you how to leverage cloud router
to create dynamic routing and not
have to worry about cute, fuzzy networking hazards.
[MUSIC PLAYING]
Imagine you have a VPC setup with multiple VMs in a subnet.
Each VM's traffic is directed through static routes
to a cloud VPN gateway encrypting traffic
to and from your on-premise network.
This is fine, as long as you're on-prem network
has a firewall and router which know how to send traffic
to your cloud VPN gateway.
Now, what happens if you have two networks on premise?
This would require you to manually add
static routes in Google Cloud that expand each VMs routing
table to include new network paths on premise.
And you need to reconfigure your VPN
on both ends, which causes it to drop [RASPBERRY]
and re-establish.
This isn't exactly fun, especially
for larger organizations who turn up new testing networks
several times a week or more.
Static routes in this case can be
painful for a number of reasons.
A topology change on either network
requires you to manually update static routes.
Also, static routes can't automatically reroute traffic
if a link fails.
What we want is a solution where our networks can automatically
and rapidly discover topology changes and then route traffic
accordingly so our users don't sense disruptions.
This is exactly what dynamic routing
does, which Google Cloud Platform offers
as Cloud Router.
Now, if a link fails, Cloud Router
can automatically reroute traffic
if another path is possible.
It works like this.
When you extend your on-prem network to Google Cloud,
Cloud Router peers with your on-prem VPN gateway or router.
The routers exchange topology information
through border gateway protocol, BGP.
Cloud Router advertises subnets from its VPC network
to the on-premise gateway via BGP.
Then topology changes automatically propagate
between your VPC and on-prem network.
A great side effect can be lower latency
because Cloud Router learns the on-premise routes through BGP
and lets the network infrastructure pick the best
route to reach the destination.
If you're using Cloud Router with VPN,
it frees you from management headache
for a number of reasons.
You don't need to statically manage subnets,
like adding and removing static routes for your VPN.
It scales with your traffic because it's not
a physical device that might cause a bottleneck.
And the BGP session informs each router of local changes,
meaning any new subnets you add are seamlessly
advertised between networks.
No downtime or manual changes to routing tables.
Let's walk through Cloud Router setup.
If you remember from my last episode,
I had a static route VPN setup.
Let's create a dynamic router for this VPN setup in US East
by going to the Cloud Router page.
Here, I'll give it a name.
Select the VPC network that contains the instances
that you want to reach.
Choose a region where you want to locate the Cloud Router.
It advertises all subnets in the region where it's located.
Pick a Google ASN you're not using
anywhere else in your network.
An ASN uniquely identifies each network
on the internet for BGP sessions.
Choose whether to advertise all subnets visible to the Cloud
Router or create custom routes.
Next, you can add a tunnel to each VPN gateway
and establish BGP sessions between the two cloud routers
or with your on-premise router, which you can check out
in the documentation below.
Cloud Router is the orchestral conductor
for traffic between your on-prem and the cloud,
like when using VPN and Cloud Interconnect.
It helps a growing network continue
to function in the face of failures and other furry
rodents to support scalability and adaptability.
Stay tuned for more.
And remember, optimizing your network
means freeing up your bandwidth.
[MUSIC PLAYING]