I have a IPSec tunnel from my on-prem network ( to a Google VPC network, for example It looks like this:

[] <-- IPSec (routers, gateways, etc.) --> []

I setup routing properly, I can reach both networks both ways. Now the question is: can I route all my on-prem Internet traffic through VPC network?

Google's VPC networks are special in the way they have routing rules created for them. I created all sorts of custom routes trying to route my packets (for example on my on-prem router: via, the default gateway for the network; the VPC knows how to route back to, but won't ). I also tested a lot of different cases.

Is it possible at all? What one have to do to make ping works from on-prem machine with all traffic pushed through the tunnel? Help please.

Best Regards, K.


You can access to the internet from your on premise network through the VPC network by setting up a GCE instance configured as a NAT-Gateway. You will find the information on how to set this up at this link.

Once you have set up and configured the instance you will need to add The default route that sends all traffic to the internet ( to the NAT-gateway instance.

Then you should add a route with low priority route that applies only to the NAT-gateway instance, using network tags and make the next hop the default Internet gateway.

You will need to configure IP range on the on-premise network through your cloud VPN tunnel, so it sends all traffic through the tunnel to the NAT gateway in the VPC network which will then send all the packets to the internet. You can find details on networks and VPN tunnel routing at this link2.

I hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.