Today i think i did a mistake, i wanted to recreate my VPC to use 2 subnets (private and public) because i want to setup a RDS database. i already had a vpc with an ec2 instance running, i could access it visa my elastic ip. I created a snapshot of my instance then deleted everything (VPC, EC2 instances) but i kept the ip because i want to reuse it (DNS are configured with this ip, cpanel licence too...).

So I create a VPC with the VPC WIZARD tool (Public and Private subnet). I assigned an elastic IP to the NAT interface.

Then i created a new EC2 instance.

How to access the EC2 instance via the elastic ip assigned to the NAT interface (the one i used when i created the VPC) ?

How to access the EC2 instance via the elastic ip assigned to the NAT interface (the one i used when i created the VPC) ?

You cannot. NAT gateways are for outgoing traffic only. Your NAT gateway should be used only from your private subnet. For outside access to instances in your public subnet, attach an internet gateway, assign EIPs to the server's, and set routing rules accordingly.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.