EC2 t2.micro 实例没有公共 DNS [英] EC2 t2.micro instance has no public DNS

查看:34
本文介绍了EC2 t2.micro 实例没有公共 DNS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我启动了一个 Amazon Web Service (AWS) EC2 实例 t2.micro,它必须启动到 VPC 中.

I launched an Amazon Web Service (AWS) EC2 Instance, t2.micro, which must be launched into a VPC.

VPC 已将自动分配公共 IP 设置为是.

The VPC has Auto-assign Public IP set to Yes.

DNS 解析:是

DNS 主机名:是

但是在 EC2 Dashboard 上,实例仍然有一个空白的公共 DNS 和公共 IP.我多次尝试重新启动该实例,但仍未为它分配公共 IP.我们的 AWS 账户附带的 5 个弹性 IP 已经使用.是否可以在不使用弹性 IP 的情况下获得分配给 t2.micro 实例的公共 IP?

But on the EC2 Dashboard, the instance still has a blank Public DNS and Public IP. I have tried to restart the instance several times, but it still has not been assigned a Public IP. The 5 Elastic IPs that came with our AWS account have already been used. Is it possible to get a Public IP assigned to a t2.micro instance without using Elastic IP?

我已阅读帖子:EC2 实例没有公共 DNS,但我没有能够添加评论的声誉点,所以我将此作为新问题发布.

I have read the post: EC2 instance has no public DNS, but I do not have reputation points to be able to add a comment, so I am posting this as new question.

推荐答案

EC2 实例没有公有 IP 地址的最常见原因是您在私有子网中启动 EC2 实例.私有子网意味着位于该子网中的任何 EC2 实例都不能从公共 Internet 直接寻址.换言之,根据定义,私有子网中的 EC2 实例不能拥有公共 IP 地址.

The most common cause of no public IP address for your EC2 instance is that you're launching your EC2 instance in a private subnet. A private subnet means that any EC2 instances located in that subnet are not directly addressable from the public Internet. In other words, by definition, EC2 instances in a private subnet cannot have a public IP address.

这将解释为什么检查公共 IP 地址"无效,以及您无法分配弹性 IP 地址的原因.

This would explain why checking "public IP address" has no effect, and why you're unable to assign an Elastic IP address.

您不能只是将实例从一个子网迁移到另一个子网.如果您需要这样做,您可以为您的实例创建一个 AMI(右键单击 EC2 实例并单击 create image),然后从该 AMI 的不同子网中启动一个新实例.

You can't just relocate an instance from one subnet to another. If you need to do that, you can create an AMI of your instance (right-click on the EC2 instance and click create image), and then launch a new instance from that AMI in a different subnet.

要确定您的子网是否为私有子网,请查看路由表,看看您是否有互联网网关路由.转至 VPC >子网 >选择子网 >路由表标签.查找类似于 igw-*** 的条目.如果你看到这个,它是一个公共子网.如果您看到类似 eni-***/i-*** 的内容,则它是一个私有子网.

To determine if your subnet is private, look at the Route Table and see if you have an Internet Gateway route. Go to VPC > Subnets > Select a Subnet > Route Table tab. Look for an entry that has something like igw-***. If you see this, it's a public subnet. If you see something like eni-*** / i-***, it's a private subnet.

这篇关于EC2 t2.micro 实例没有公共 DNS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆