- Newest
- Most votes
- Most comments
To fix your issue connecting to ElastiCache Redis through VPN, you need to check several aspects of your setup:
- VPC Peering and Routing: While you've added routes in your VPC, ensure that:
- Routes have been added in both VPCs' route tables to direct traffic between the VPC CIDRs through the peering connection
- The VPN server is properly configured to route traffic to the secondary VPC where your Redis cluster is located
- VPN Configuration: Your OpenVPN server needs to be configured to allow access to the Redis cluster:
- Add the CIDR of the secondary VPC (where Redis is located) to your VPN server's private subnet list
- Restart the VPN server after making these changes
- Ensure the VPN server is configured to NAT client IP addresses to its own private IP
- Security Group Requirements: Even though you mentioned you don't have a security group for Redis, ElastiCache Redis requires security group configuration:
- Create a security group for your Redis cluster if one doesn't exist
- Configure it to allow inbound access on port 6379 (and port 6380 if using ElastiCache Serverless)
- Allow traffic from the VPN server's private IP or security group
- If using Redis in cluster mode, you may also need to open ports 16379-16380
-
Network ACLs: Check if there are any network ACLs in the Redis subnet that might be blocking the connection.
-
Redis Cluster Mode: If your Redis cluster is in cluster mode, ensure your client is cluster-aware to handle the connection properly.
Since you can connect to EC2 instances but not to Redis, this suggests the issue is specific to the Redis configuration rather than the basic VPN connectivity.
Sources
Accessing RDS instance in peered VPC through VPN | AWS re:Post
ElastiCache Redis connectivity error redis.exceptions.ResponseError: MOVED 4720 | AWS re:Post
Common troubleshooting steps and best practices with ElastiCache - Amazon ElastiCache
answered a year ago
Relevant content
asked 2 years ago
asked 4 years ago
asked 2 years ago
asked 5 years ago
