The ec2 instance can't access internet in a public subnet without a elastic ip address?

后端 未结 2 935
刺人心
刺人心 2021-02-04 05:16

I working on aws. I created a public subnet which has a network ACL allows all net traffic, and associated with a internet gateway in the route table.

And then I create

2条回答
  •  -上瘾入骨i
    2021-02-04 06:01

    For accessing internet from EC2 instance in public subnet using Internet Gateway, the instance needs to have public IP address. Either one can configure the instance to have public IP address or attach EIP.

    Reference: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Internet_Gateway.html

    If you do not want to attach public IP address for instances with Internet access (consider private subnets), NAT instance and NAT gateway can help.

    Reference: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat.html

提交回复
热议问题