Name: deactivate_tunnel
Owner: Google Cloud Platform
Description: Deactivates a VPN tunnel on the Google Cloud Platform.
Created: 2015-04-22 21:14:46.0
Updated: 2018-01-22 18:45:55.0
Pushed: 2015-04-27 17:08:33.0
Homepage: null
Size: 136
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This python command-line application that uses the Google Python API Client Library to deactivate a VPN tunnel. This is done as follows:
Traffic should then move to routes with a higher priority over a different tunnel. Routes on the other side of the tunnel will need to be similarly deprioritized in order for prevent incoming traffic from passing through the tunnel (through a similar process scripted against that specific gateway).
Once this occurs, there is no longer any traffic flowing over this tunnel and it can be considered deactivated for the purposes of maintenance or other changes.
After maintenance has been performed this application can be used to restore the routes on this tunnel back to their original name and priority. (Routes on the other side of the tunnel can be restored as well).
https://sdk.cloud.google.com | bash
ud auth login
ud config set project your-project-id
install -r requirements.txt
on deactivate_tunnel.py
e: deactivate_tunnel.py [-h] --project PROJECT_ID --region REGION_NAME
--tunnel TUNNEL_NAME [--priority PRIORITY]
[--sleep SLEEP] [--restore] [--noop] [--v]
tivates a VPN tunnel on the Google Cloud Platform
onal arguments:
, --help show this help message and exit
project PROJECT_ID Required - Google Cloud Platform project ID to use for
this invocation.
region REGION_NAME Required - Region name to use for this invocation.
tunnel TUNNEL_NAME Required - Tunnel name to use for this invocation.
priority PRIORITY The priority to set the new routes it creates. The
default is 2000.
sleep SLEEP Seconds to sleep before removing old routes.
restore Restores any routes previously deactivated by this
script.
noop Shows what would happen but does not actually create
or delete routes.
v Displays verbose output and debugging.
The application will deactivate the tunnel as follows:
--project
, --region
and --tunnel
.--priority
.--sleep
time that was provided.--sleep
time that was provided.To reactivate the tunnel the application can be used as follows:
--restore
option can then be used to reactivate a tunnel by reverting
the cloned routes back to their original name an priority and then deleting
the clones.