I am building an application in GCP using CentOS7. The CentOS7 server has a GRE tunnel (gre1) to a server on premise.
Out of the box, the CentOS7 instance comes with a default route via eth0. To make my application work correctly I modify the CentOS route table.
ip route x.x.x.x/32 (my public) via 10.0.0.1 dev eth0 ip route default replace 0.0.0.0/0 via 172.16.0.1 dev gre1
These new routes allow me to maintain an ssh connection with the server while the server it's has a default route sending all traffic down the GRE tunnel. This works great... until I reboot.
When I reboot I lose all network connectivity to/from the CentOS7 instance.
This approach works fine on AWS and Azure servers, but GCP seems to be different
How can I change the default route on a GCP CentOS7 instance?
Thank you.