서울 리전 AWS VPC(10.0.0.0/16) <-> 미국(버지니아 북부) 리전 AWS VPC(172.31.0.0/16)
VPC 생성
172.31.0.0/16 대역으로 생성
VPC ID는 Peering Connection할 때 필요하므로 적어놓을 것
dev-3tier-private-01 서브넷 생성
⇒ Virginia에 있는 VPC와 맺을 것이므로 Another Region 선택
⇒ 미리 적어놓은 Virginia의 VPC의 ID를 기입해준다.
Status : Pending Acceptance인 것을 확인할 수 있다.
Virginia 리전에 와서 보면 같은 상태인 것을 확인할 수 있다.
Virginia 리전에서 Accept Request를 클릭하면 피어링이 성공한다.
Active로 변함
Seoul Region에서는 Routes만 변경해주면 된다.
172.31.0.0/16 대역으로 가는 Packet들은 pcx-blahblah로 모두 보낼 것을 정의
Virginia Region에서는 어느 Subnet 대역을 가진 인스턴스들이 어떤 Routes로 갈 것인지를 정의
3tier-private-rt는 아래의 172.31.1.0/24 서브넷 대역을 가진 인스턴스들에 대해 적용이 되며, 10.0.0.0/16으로 가는 Packet들의 타겟을 pcx-blahblah로 보냄을 정의해준다.
SSH Test ( Seoul Region - Private Subnet - EC2 ⇒ Virginia Region - Private Subnet - EC2 )
첫 번째 시도에서는 버지니아 Region에서 EC2 인스턴스에 대한 Security Group을 열어주지 않아 ssh 접속이 안되는 것을 확인할 수 있다.
Ping 속도 Test
Seoul Region의 Bastion Server에서 Test 진행 ( 보안 그룹 적절히 변경 후 테스트 진행함 )
Peering Connection으로 맺어진 EC2간의 Ping 테스트를 진행해본 결과 많이 느리다...
ubuntu@bastion:~$ ping 10.0.3.220
PING 10.0.3.220 (10.0.3.220) 56(84) bytes of data.
64 bytes from 10.0.3.220: icmp_seq=1 ttl=255 time=0.499 ms
64 bytes from 10.0.3.220: icmp_seq=2 ttl=255 time=0.456 ms
64 bytes from 10.0.3.220: icmp_seq=3 ttl=255 time=0.448 ms
64 bytes from 10.0.3.220: icmp_seq=4 ttl=255 time=0.486 ms
ubuntu@bastion:~$ ping 172.31.1.10
PING 172.31.1.10 (172.31.1.10) 56(84) bytes of data.
64 bytes from 172.31.1.10: icmp_seq=1 ttl=255 time=196 ms
64 bytes from 172.31.1.10: icmp_seq=2 ttl=255 time=196 ms
64 bytes from 172.31.1.10: icmp_seq=3 ttl=255 time=196 ms
64 bytes from 172.31.1.10: icmp_seq=4 ttl=255 time=196 ms
64 bytes from 172.31.1.10: icmp_seq=5 ttl=255 time=196 ms
https://library.gabia.com/contents/tech/8881/
https://docs.aws.amazon.com/ko_kr/vpc/latest/peering/create-vpc-peering-connection.html
흥미롭네요