Can't communicate between two ec2 instances in the same security group via public ip address?

送分小仙女□ 提交于 2019-12-24 10:18:08

问题


I can't connect to another ec2 instance in the same security group using public ip. If i try to connect using public DNS name and private ip, it is WORKING FINE. What i have done so far: * created two ec2 public instances. * attached both instances to security group sg-12345 * added inbound rules - all traffic,source=sg-12345 - SSH port=22,source= MY ip(this is to login into my ec2 instance from my desktop) Thanks in Advance.


回答1:


When you use public IP the traffic exits your VPC and comes back in, at which point it is no longer identified as coming from that security group. It looks just like random Internet traffic at that point. Stick to using private IP for both security and speed.



来源:https://stackoverflow.com/questions/44660616/cant-communicate-between-two-ec2-instances-in-the-same-security-group-via-publi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!