Home > Enterprise >  How to connect to EC2 in private VPC?
How to connect to EC2 in private VPC?

Time:12-09

I create a VPC, and try to connect to a EC2 by connecting to AWS Ubuntu.

But when I go to the page of connecting, it showed me this

The instance does not have a public IPv4 address
To connect using the EC2 Instance Connect browser-based client, the instance must have a public IPv4 address.

What I've tried

In EC2 Panel > Action > Networks > Manage IP Address > Ipv4 Addresses > Assign New IP Address(only available for priate IP Address, but I couldn't do anything in section of pubilc IP Address)

CodePudding user response:

Follow the AWS link instruction.

https://aws.amazon.com/premiumsupport/knowledge-center/ec2-associate-static-public-ip/

CodePudding user response:

Go to the EC2 dashboard, on the left panel, open Network & Security -> Elastic IPs

Allocate an elastic IP, and click Actions dropdown. Click `Associate Elastic IP address.

You can connect the elastic IP to your instance or Network interfaces of the instance.

CodePudding user response:

First, do you mean Private Subnet? Also ensure port 22 is open from correct ip. Private EC2 can't be accessed from public internet. To connect with EC2 in private subnet you need a bastion host & NAT gateway attached. Refer this link for more info.

  • Related