Tuesday, 7 May 2013

EC2 server to VPC private instance via VPC NAT instance


  1. iptables -t nat -A PREROUTING -s 23.23.23.23/32 -d 10.0.0.254/32 -i eth0 -p tcp -m tcp --sport 1024:65535 --dport 3306 -j DNAT --to-destination 10.0.12.10:3306
    1. 23.23.23.23 is your external server's public IP address
    2. 10.0.0.254 is your VPC NAT instance's IP address in the public subnet
    3. 10.0.12.10 is the VPC IP address of your server in a private subnet
    4. 3306 is the port your service is listening on

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Interview questions: 2020-12

Terraform provider vs provisioner Load balancing Network Load Balancer vs Application Load Balancer  Networking Layer 1 vs Layer 4 haproxy u...