Overview
AWS Traffic Mirroring allows you to copy network traffic from:- EC2 Instances - Individual virtual machines
- ECS Services - Containerized applications
- Network Interfaces - Elastic Network Interfaces (ENIs)
- Load Balancers - Application and Network Load Balancers
Prerequisites
- AWS account with appropriate permissions
- VPC with source resources to mirror
- Metlo collector deployed (or will be deployed by the CLI)
- AWS CLI configured with credentials
- Metlo CLI installed
Installation
Install the Metlo CLI:Setup Traffic Mirroring
Run Metlo CLI setup
Execute the AWS traffic mirroring setup command:The CLI will guide you through an interactive setup process.
Select specific source
Choose the specific instance, interface, or service to mirror:For EC2 instances:
Configure mirror target
The CLI will create or select a mirror target (the Metlo collector instance).If no collector exists, it will create:
- Network Load Balancer for the mirror target
- Target group
- Mirror session
Source Types
EC2 Instance
Mirror traffic from a specific EC2 instance:- Captures all traffic from all network interfaces attached to the instance
- Useful for monitoring individual application servers
- Supports instances with multiple ENIs
Network Interface
Mirror traffic from a specific ENI:- Fine-grained control over which traffic is captured
- Useful for complex networking setups
- Can mirror interfaces from instances, load balancers, or other resources
ECS Service
Mirror traffic from ECS tasks:- Automatically discovers ENIs from ECS tasks
- Monitors containerized applications
- Supports both EC2 and Fargate launch types
Load Balancer
Mirror traffic from Application or Network Load Balancers:- Captures all traffic passing through the load balancer
- Ideal for monitoring API gateways
- Mirrors from load balancer ENIs
Mirror Session Configuration
The Metlo CLI automatically creates:Mirror Filter
- Protocol: All traffic or specific protocols (TCP, UDP)
- Direction: Ingress, egress, or both
- Port ranges: Optional filtering by port
Mirror Target
- Network Load Balancer receiving mirrored traffic
- Forwards traffic to Metlo collector instances
- Configured with appropriate target groups
Mirror Session
- Links source (your resources) to target (Metlo collector)
- Configurable session number (1-32766)
- VNI (Virtual Network Identifier) for packet encapsulation
Traffic Filtering
By default, Metlo mirrors all traffic. You can filter to reduce volume:Filtering options are configured through the CLI’s interactive prompts or by modifying the setup parameters.
List Mirror Sessions
View all active mirror sessions:- Session ID
- Source type and ID
- Target information
- Mirror status
Remove Mirror Session
Delete a specific mirror session:Architecture
Supported Instance Types
Not all EC2 instance types support traffic mirroring. Supported types include:- C5, C5n, C6i, C6in
- M5, M5n, M6i, M6in
- R5, R5n, R6i, R6in
- T3 (with some limitations)
- And more…
Pricing Considerations
Estimate costs before deployment, especially for high-traffic environments.Troubleshooting
Traffic not appearing in Metlo
Traffic not appearing in Metlo
Check:
- Mirror session status is “active”
- Metlo collector instance is running
- Security groups allow VXLAN traffic (UDP port 4789)
- Source instance type supports traffic mirroring
- Network ACLs don’t block mirrored traffic
CLI can't find instances
CLI can't find instances
Verify:
- AWS credentials are configured correctly
- You have permissions to describe EC2 instances
- You’re in the correct AWS region
- Resources exist in the selected VPC
Mirror target creation failed
Mirror target creation failed
Ensure:
- You have permissions to create NLB and target groups
- VPC has available IP addresses
- Subnet configuration is correct
- Service quotas allow additional resources
High costs
High costs
To reduce costs:
- Use traffic filtering to capture only API traffic
- Mirror only production-critical resources
- Monitor data transfer volumes
- Consider using on-demand instead of continuous mirroring
Security Considerations
- Encrypted traffic: Mirrored TLS/SSL traffic is still encrypted; Metlo analyzes metadata
- Sensitive data: Ensure Metlo collector has appropriate security controls
- Network isolation: Deploy collector in a secure subnet with restricted access
- IAM permissions: Use least-privilege IAM policies for CLI operations
Required IAM Permissions
The AWS account used by the CLI needs:Next Steps
GCP Mirroring
Set up traffic mirroring on Google Cloud Platform
View API Inventory
Explore APIs discovered through traffic mirroring