Tomcat - 외부

tomcat의 private IP addr: 10.10.2.142

  1. [ec2-user@ip-10-10-2-142 ~]$ ping 8.8.8.8

    [ec2-user@ip-10-10-2-142 ~]$ ping 8.8.8.8
    PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
    ^C
    --- 8.8.8.8 ping statistics ---
    4 packets transmitted, 0 received, 100% packet loss, time 3069ms
    
  2. 얺이외않되??

    NAT가 안 되니까 안 됨

    → NAT gateway 연결 ㄱㄱ

NAT gateway

Untitled

왜 안 IGW?

IGW는 outbound만 적용되고 Inbound까지 하려면 NAT GW를 해야 되는 듯

  1. EC2 → Elastic IP 주소 할당

  2. VPC → NAT gateways 생성

    야박한 새기들 ㅠㅠ

  3. rapa-vpc-pri-rt 에 (0.0.0.0/0, nat-gw) 추가

  4. [ec2-user@ip-10-10-2-142 ~]$ ping 8.8.8.8(tomcat에서 외부로 ping)

    [ec2-user@ip-10-10-2-142 ~]$ ping 8.8.8.8
    PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
    64 bytes from 8.8.8.8: icmp_seq=1 ttl=106 time=32.9 ms
    64 bytes from 8.8.8.8: icmp_seq=2 ttl=106 time=31.9 ms
    64 bytes from 8.8.8.8: icmp_seq=3 ttl=106 time=31.8 ms
    64 bytes from 8.8.8.8: icmp_seq=4 ttl=106 time=31.8 ms
    ^C
    --- 8.8.8.8 ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 3003ms
    rtt min/avg/max/mdev = 31.890/32.162/32.927/0.476 ms
    

    예아 베이베

  5. 삭제는 역순으로

    1. Routing table의 NAT GW 연결 제거

      Untitled

    2. NAT GW 삭제

      Untitled

      Untitled

    3. Elastic IP 삭제(release)

      Untitled

      Untitled

      근데 NAT gateway랑 뭔가 연관이 되어 있으면 삭제할 수 없음

      → NAT gateway 상태가 Deleting이 아닌 Deleted가 된 걸 확인하고 삭제하자 (안 그러면 associate되어 있어서 삭제 안 된다고 뜸)

      사실 Deleted 떠도 한참 있다 지워짐

  6. EC2 instance 삭제

    (실습을 위해)