Overview
GCP Packet Mirroring allows you to copy network traffic from:- Instances - Individual Compute Engine VMs
- Subnets - All traffic within a subnet
- Tags - Instances matching specific network tags
Prerequisites
- GCP project with Compute Engine enabled
- Service account with appropriate permissions
- VPC network with resources to mirror
- Metlo collector (deployed manually or by CLI)
- Metlo CLI installed
Installation
Install the Metlo CLI:Setup Packet Mirroring
Prepare GCP credentials
Create a service account key file with required permissions:Download the JSON key file to use in the next step.
Run Metlo CLI setup
Execute the GCP packet mirroring setup command:The CLI will guide you through an interactive setup.
Configure collector
The CLI will create or use an existing Metlo collector instance and configure:
- Collector instance
- Internal Load Balancer
- Packet mirroring policy
Source Types
Instance-Based Mirroring
Mirror traffic from a specific Compute Engine instance:- Captures all traffic to/from the instance
- Includes all network interfaces
- Best for monitoring specific applications
Subnet-Based Mirroring
Mirror all traffic within a subnet:- Captures traffic from all instances in the subnet
- Useful for monitoring entire network segments
- Scales automatically as instances are added/removed
Tag-Based Mirroring
Mirror traffic from instances with a specific network tag:- Dynamic source selection based on tags
- Automatically includes new instances with the tag
- Ideal for monitoring application tiers
Mirror Configuration
The Metlo CLI automatically creates:Packet Mirroring Policy
Defines:- Source: Instance, subnet, or tag
- Collector: Internal Load Balancer forwarding to Metlo
- Filter: Optional protocol/CIDR filtering
- Mirrored traffic: Can be sampled or full capture
Internal Load Balancer
Configured with:- Backend service: Points to Metlo collector instances
- Forwarding rule: Receives mirrored packets
- Protocol: TCP/UDP load balancing
Collector Instance
The Metlo collector:- Receives mirrored packets via ILB
- Processes and analyzes API traffic
- Sends data to Metlo backend
List Packet Mirroring Policies
View active policies:- Policy name
- Source configuration
- Collector details
- Status
Remove Packet Mirroring
Delete a packet mirroring policy:- List existing policies
- Prompt you to select one to remove
- Delete the policy
- Optionally clean up associated resources
Cleanup
Remove all Metlo resources:- Packet mirroring policies
- Collector instances
- Load balancers
- Firewall rules (created by Metlo)
Architecture
Network Requirements
Firewall Rules
Ensure the collector can:- Receive mirrored traffic from the ILB
- Communicate with Metlo backend
- Allow health checks from GCP load balancer health checkers
VPC Configuration
- Source and collector must be in the same VPC
- Subnet IP ranges must not conflict
- Private Google Access may be required for API calls
Pricing Considerations
Costs vary by:- Volume of mirrored traffic
- Instance types used
- Data transfer between zones/regions
Supported Regions
Metlo supports packet mirroring in all GCP regions, including:- us-central1
- us-east1, us-east4
- us-west1, us-west2, us-west3, us-west4
- europe-west1, europe-west2, europe-west3, europe-west4
- asia-east1, asia-east2
- asia-northeast1, asia-northeast2, asia-northeast3
- asia-south1, asia-southeast1, asia-southeast2
- australia-southeast1
Required IAM Permissions
The service account needs:Troubleshooting
Traffic not appearing in Metlo
Traffic not appearing in Metlo
Check:
- Packet mirroring policy status is “ACTIVE”
- Collector instance is running
- ILB health checks are passing
- Firewall rules allow mirrored traffic
- Source instance/subnet/tag configuration is correct
Authentication failed
Authentication failed
Verify:
- Service account key file is valid
- Key file path is correct
- Service account has required permissions
- Project ID is correct
Cannot find zone/network
Cannot find zone/network
Ensure:
- Zone name is spelled correctly (e.g., “us-central1-a”)
- Network name is correct (usually “default”)
- You have access to the specified project
- Compute Engine API is enabled
Collector instance creation failed
Collector instance creation failed
Check:
- Project quotas for instances and IPs
- Zone has available resources
- Service account can create instances
- Network and subnet exist
Security Considerations
- Encrypted traffic: Mirrored TLS traffic remains encrypted; Metlo analyzes packet metadata
- Data privacy: Ensure collector is in a secure subnet with restricted access
- Service account security: Use least-privilege IAM roles
- Network isolation: Deploy collector in a dedicated subnet
Performance Impact
Packet mirroring has minimal impact on source instances:- No additional latency on mirrored traffic
- Source instance performance unaffected
- Network bandwidth not impacted (mirroring uses separate path)
Limitations
- Maximum mirrored sources per policy: Check current GCP limits
- Cannot mirror traffic between instances in the same policy
- Some instance types may have restrictions
- Cross-region mirroring not supported
Next Steps
AWS Mirroring
Set up traffic mirroring on AWS
API Inventory
View APIs discovered from mirrored traffic