admin管理员组文章数量:1333442
I have 3 EC2 instances (Amazon-Linux AMI) within same VPC (custom) and same AZ. All using the same security group and same ACL.
"A" & "B" are under public subnet whose route table has an entry for IGW and "C" under private subnet whose route table contains an entry for NAT Gateway. "A" has public IP but "B" & "C" don't have any public IP. "A" is used for SSH into "B" & "C". "sudo yum update" command works in "A" & "C" but getting timeout error in B.
Is this the expected behavior or am I doing something wrong.
Security Group:
Type Protocol Port Source/Destination
---------------------------------------------------------
Inbound rule: All Traffic All All Security Group itself
SSH TCP 22 Anywhere
Outbound rule: All Traffic All All Anywhere
ACL (both Inbound & Outbound)
Type Protocol Port Source/Destination Allow/Deny
-------------------------------------------------------------
All Traffic All All Anywhere Allow
I have 3 EC2 instances (Amazon-Linux AMI) within same VPC (custom) and same AZ. All using the same security group and same ACL.
"A" & "B" are under public subnet whose route table has an entry for IGW and "C" under private subnet whose route table contains an entry for NAT Gateway. "A" has public IP but "B" & "C" don't have any public IP. "A" is used for SSH into "B" & "C". "sudo yum update" command works in "A" & "C" but getting timeout error in B.
Is this the expected behavior or am I doing something wrong.
Security Group:
Type Protocol Port Source/Destination
---------------------------------------------------------
Inbound rule: All Traffic All All Security Group itself
SSH TCP 22 Anywhere
Outbound rule: All Traffic All All Anywhere
ACL (both Inbound & Outbound)
Type Protocol Port Source/Destination Allow/Deny
-------------------------------------------------------------
All Traffic All All Anywhere Allow
Share
Improve this question
asked Nov 20, 2024 at 15:08
Poulami RoyChowdhuryPoulami RoyChowdhury
134 bronze badges
2 Answers
Reset to default 1Instance “B” resides in the public subnet but does not have a public IP address. Therefore, it cannot communicate directly with the internet for updates unless it uses an intermediary like Instance “A” as a NAT instance (not mentioned in your setup). To get rid of that error you need to assign a public IP to “B” if it needs direct internet access.
If Instance “B” lacks a public IP, it won’t be able to use the IGW, even though the route table is correct.
Or you can configure instance A as a proxy or NAT instance to allow B to access the internet without the need of a public IP.
and Ensure “A” has IP forwarding enabled and correct routing setup.
(even if instance in the public subnet, if it doesn't have a public IP you need to treat it the same way as an instance in the private subnet)
It works on instance A because it is in a subnet with a direct route to an Internet Gateway, and it has a public IP address.
It works on instance C because it is in a subnet with a route to a NAT Gateway or NAT Instance of some kind.
It does not work on instance B, because it is in a subnet with a direct route to an Internet Gateway, and it does not have a public IP address. A public IP address is required, in order to directly use an Internet Gateway.
本文标签:
版权声明:本文标题:amazon web services - EC2, belongs to public subnet, having internet access issue if no public IP assigned - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742351418a2458571.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论