I have no idea if this information is relevant, but when you ping you are using ICMP, and when you Curl you are using TCP.
In Oracle Cloud all traffic, except on port 22, is blocked by default, inside the instance, egress and ingress. But I never experienced such a thing in AWS, either in EC2 or Lightsail.
About the Network ACLs: I’ve never dealt with them! Did you edit them somehow? Are you aware that they are stateless, and can this fact somehow have something to do with your issue? I believe you should set the Network ACL back to its defaults and use Security Groups only, but this argument is more based on ignorance than on anything else.
Hey. Edu thank you very much for your help : but On Centos 8 : Apparently the ping (ICMP ) doesn’t use the ipv6 … however the curl does it !
So I went ahead and I disabled ipv6. and everything works as expected. .. I was kinda looking on aws security groups and acls etc. but the problem was within the system itself …
ps : I could have fixed that by configuring the ipv6 in the networking on aws.
Keep in mind when you set up that EC2 instance, you have to supply rules for port 443 and for ICMP in the security group it’s attached to. Just clicking new instance and banging on the next button until one gets to the finish button isn’t good enough.
So when your instance makes a connection, it sets the source port to a random high port, say 40000, and the destination port to 443. When the internet server responds, its source port is 443 and it’s destination port is 40000. This is blocked by your network ACL.
Reverse your config. Leave network ACL wide open, and use restrictive security groups (which are stateful and allow return traffic).