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

Comments

Popular posts from this blog

Openvpn and unbound combined break dig command

Stress Linux system: stress-ng

Google Nexus 4: permanent back panel glass repair for less than a penny