새로운 AWS EC2 아웃바운드 트래픽 문제가 있습니까?

새로운 AWS EC2 아웃바운드 트래픽 문제가 있습니까?

저는 LinuxAcademy의 튜토리얼을 따라 VPC 및 EC2 인스턴스를 설정했습니다. 모든 작업을 올바르게 수행하고 인스턴스를 시작한 다음 ssh로 인스턴스를 시작한 다음 yum을 업데이트하려고 시도했는데 다음 오류가 발생했습니다.

Could not retrieve mirrorlist http://repo.us-east-2.amazonaws.com/latest/main/mirror.list error was
12: Timeout on http://repo.us-east-2.amazonaws.com/latest/main/mirror.list: (28, 'Connection timed out after 5001 milliseconds')


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>

     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: amzn-main/latest

그래서 다음 사항을 다시 확인했습니다.

  • 공개 탄력적 IP 보유

  • IGW 설정

  • 퍼블릭 서브넷 설정 및 ACL에는 0.0.0.0/0에서 모든 아웃바운드 트래픽이 허용됩니다.

  • 보안 그룹이 모든 아웃바운드 트래픽을 허용하고 있습니다.

마지막으로, 이러한 설정을 보는 동안 인스턴스에 불만이 있었고 이제 SSH로 다시 연결하려고 하면 시간이 초과되고 원격으로 IP를 핑할 수도 없습니다.

인스턴스 재부팅도 시도했지만 도움이 되지 않았습니다.

편집: 여기 내 스크린샷과 내가 설정하려는 튜토리얼의 다이어그램이 있습니다.

초_g1

sec_g2

sec_g3

NACL1

NACL2

NACL3

도표

답변1

귀하의 문제는 NACL에 있습니다. 포트 22/tcp 및 80/tcp에서만 인바운드를 허용합니다.

웹 연결을 하면 포트 80 또는 443에서 아웃바운드되지만 임의의 높은 포트로 돌아옵니다. 보안 그룹은 일종의 상태 저장이며 반환 연결을 허용하지만 네트워크 ACL은 허용하지 않습니다.

1024-65535/tcp를 허용하면 웹 연결이 작동합니다.

관련 정보