Search code examples
google-cloud-platformgoogle-cloud-networking

Restore Google Cloud default network


I was trying to automatically bring up and down a GCP network along with some other components(instances, volumes, firewall-rules etc.). Unfortunately I deleted some firewall-rules and some other components of default network unintentionally. Now I want to restore the default network to it's previous state. Is there a way to do it automatically?


Solution

  • There is no way to automatically recover any network. But if you create a new VPC network, use the Automatic mode under 'Subnet creation mode' you can see the firewall rules there so you can copy them to be added manually, and if you finish the process you will have the same subnets that the original 'default' had and you can also manually add the subnets.

    But if you do not have any resources using the 'default' network, you can delete it, and create a new VPC network with the mentioned 'Automatic' setup, call it 'default', and there you will have the default network again.