Home > Back-end >  my ec2 linux is not connect to the internet?
my ec2 linux is not connect to the internet?

Time:11-15

when I ran $ git clone https://github.com/aliscie/autodox it took too long to respond to this command and then it shows fatal: unable to access 'https://github.com/<whatever>': Failed to connect to github.com port 443: Connection timed out. Also, when I tried sudo yum install docker I got the same issue but different error message

https://amazonlinux-2-repos-eu-west-1.s3.eu-west-1.amazonaws.com/2/extras/docker/stable/x86_64/9273ea3ff10ea479755a952f9b7816de5808a0
9ab6d2cf7c7f56ea422962d7ac/repodata/repomd.xml?instance_id=i-0baa228b430689a3b&region=eu-west-1: [Errno 12] Timeout on https://amazon
linux-2-repos-eu-west-1.s3.eu-west-1.amazonaws.com/2/extras/docker/stable/x86_64/9273ea3ff10ea479755a952f9b7816de5808a09ab6d2cf7c7f56
ea422962d7ac/repodata/repomd.xml?instance_id=i-0baa228b430689a3b&region=eu-west-1: (28, 'Connection timed out after 5000 milliseconds
')
Trying other mirror.
  • I tried
  1. aws configure but I did not provide AWS Access Key ID because I don't
  2. I tried to flow the article Troubleshoot EC2 instance internet gateway but it was useless for me
  3. in security groups I setted Inbound and Outbound rules to allow all trafices anywhere.

CodePudding user response:

In general, Security groups should be configured with:

  • Inbound rules that permit access to the desired ports (eg port 80 for HTTP, port 443 for HTTPS, port 22 for SSH) from as few IP addresses as possible. For example, HTTP would be open to the Internet (0.0.0.0/0) but while SSH should be open only to your IP address
  • Outbound rules that "Allow All" outbound access because you can typically trust what is running on your own instance

In general, Network Access Control Lists (NACLS) should never be changed from their default "Allow All" state unless you have a very specific networking requirement (eg creating a DMZ). Security Groups are sufficient for controlling access.

  • Related