|
| 1 | +--- |
| 2 | +title: Google Cloud VPN |
| 3 | +description: Connect to your private Dragonfly Cloud instance using Google Cloud VPN |
| 4 | +sidebar_position: 2 |
| 5 | +slug: /cloud/connect/vpn/gcp |
| 6 | +--- |
| 7 | + |
| 8 | +# Google Cloud VPN |
| 9 | + |
| 10 | +This guide shows how to connect to your private Dragonfly Cloud instance using Google Cloud VPN. |
| 11 | + |
| 12 | +## Prerequisites |
| 13 | + |
| 14 | +- A Google Cloud account with appropriate permissions |
| 15 | +- A Dragonfly Cloud instance deployed in Google Cloud with a private endpoint |
| 16 | +- [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) installed on your machine |
| 17 | +- OpenVPN client software installed on your local machine |
| 18 | + |
| 19 | +## Setting Up Cloud VPN |
| 20 | + |
| 21 | +### Step 1: Create a VPN Gateway |
| 22 | + |
| 23 | +1. Navigate to the [VPN page](https://console.cloud.google.com/networking/vpn/list) in the Google Cloud Console |
| 24 | +2. Click on "Create VPN Connection" and select "HA VPN" |
| 25 | +3. Enter a name for your VPN gateway |
| 26 | +4. Select the same region as your Dragonfly Cloud instance |
| 27 | +5. Click "Create" |
| 28 | + |
| 29 | +### Step 2: Create a Cloud Router |
| 30 | + |
| 31 | +1. Click "Create Cloud Router" |
| 32 | +2. Enter a name for your router |
| 33 | +3. Select the same region as your VPN gateway |
| 34 | +4. Choose a Google ASN (Autonomous System Number) |
| 35 | +5. Click "Create" |
| 36 | + |
| 37 | +### Step 3: Create External VPN Gateway |
| 38 | + |
| 39 | +1. Navigate to "External VPN gateways" in the left menu |
| 40 | +2. Click "Create external VPN gateway" |
| 41 | +3. Enter a name and the appropriate interface IP addresses |
| 42 | +4. Click "Create" |
| 43 | + |
| 44 | +### Step 4: Create VPN Tunnels |
| 45 | + |
| 46 | +1. Return to the HA VPN gateways page |
| 47 | +2. Click on your newly created gateway |
| 48 | +3. Click "Create VPN tunnel" |
| 49 | +4. Configure the tunnel settings to match your network requirements |
| 50 | +5. Create a second tunnel for high availability |
| 51 | +6. Configure BGP sessions for each tunnel |
| 52 | + |
| 53 | +### Step 5: Configure Client VPN |
| 54 | + |
| 55 | +1. Download the OpenVPN configuration file from the Google Cloud Console |
| 56 | +2. Import the configuration into your OpenVPN client |
| 57 | +3. Connect to your VPN using your credentials |
| 58 | + |
| 59 | +## Connecting to Dragonfly Cloud |
| 60 | + |
| 61 | +Once your VPN connection is established: |
| 62 | + |
| 63 | +1. Use your standard Dragonfly client with the private endpoint address |
| 64 | +2. Your connection is now securely tunneled through the VPN |
| 65 | + |
| 66 | +```python |
| 67 | +import dragonfly |
| 68 | + |
| 69 | +# Connect to your private Dragonfly Cloud instance through VPN |
| 70 | +client = dragonfly.connect( |
| 71 | + host='your-private-endpoint.internal', |
| 72 | + port=6379 |
| 73 | +) |
| 74 | + |
| 75 | +# Now you can interact with your Dragonfly instance |
| 76 | +client.set('key', 'value') |
| 77 | +result = client.get('key') |
| 78 | +print(result) # Outputs: 'value' |
| 79 | +``` |
| 80 | + |
| 81 | +## Troubleshooting |
| 82 | + |
| 83 | +If you encounter connectivity issues: |
| 84 | + |
| 85 | +1. Verify your VPN connection is active |
| 86 | +2. Check that your VPN routes include the subnet of your Dragonfly instance |
| 87 | +3. Ensure your firewall rules allow traffic to the Dragonfly port |
| 88 | +4. Confirm your Dragonfly instance's network policy allows your VPN subnet |
| 89 | + |
| 90 | +For additional assistance, please contact Dragonfly Cloud support. |
0 commit comments