AWS Redis connects externally

Is there a way to connect a Redis instance hosted on AWS from the AWS network side? I have one Windows based EC2 instance running on AWS and the other a Redis node cache.

I know this question has been asked, but the answer is in the context of a Linux based system, but my Windows based server is on AWS. I don't have enough points to comment on existing questions. Here is a link to an existing question on Stack Overflow:

Can you connect to Amazon Elasticache Redis outside of Amazon

+3


source to share


1 answer


Steps to access Elasticache Redis from outside AWS.

1) Create an EC2 instance on the same VPC as redache redis, but on a public subnet. Make sure IP forwarding is enabled:

cat / proc / sys / net / ipv4 / ip_forward

Ip_forward = 1 indicates forwarding is enabled



Make sure Masquerading is enabled: iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

2) Create a security group with an inbound connection to the port you are going to forward (say 6379 in this case). Specify the source CIDR block for the incoming connection. Make sure the outbound rule allows you to connect to the redis cluster on the correct port (the default redis port is 6379)

3) Add IP table rule to allow forwarding rule from EC2 instance to elastic iptables -t nat -A PREROUTING -i eth0 -p tcp -dport 11211 -j DNAT -to: 6379

source

+1


source







All Articles