- 최신
- 최다 투표
- 가장 많은 댓글
환경 구성
- VPC-A (CIDR: 10.0.0.0/16)
- A-10-0-1-10 (10.0.1.10)
- A-10-0-1-11 (10.0.1.11)
- VPC-B (CIDR: 10.0.0.0/16)
- B-10-0-1-10 (10.0.1.10)
- B-10-0-1-11 (10.0.1.12)
- VPC-C (CIDR: 10.1.0.0/16)
- C 인스턴스 (관리/Ansible 서버 역할)
Lattice 구성 설계
- VPC lattice를 활용하여 Service Network, Resource Gateway, Resource Config, DNS Alias, 그리고 정책을 올바르게 구성
- CIDR 중복 환경에서 IP 충돌 없이 VPC-C의 C 인스턴스가 VPC-A의 A-10-0-1-10, A-10-0-1-11 인스턴스와 VPC-B의 B-10-0-1-10, B-10-0-1-11 인스턴스로 SSH(22 포트) 통신 가능하게 설정
구성 방법
- Service Network 생성
- VPC-A, VPC-B, VPC-C 모두 Service Network에 Attach
- VPC-A와 VPC-B에 Resource Gateway 생성
- 각 인스턴스를 Resource로 등록하고 DNS Alias 부여
- a-svc.lattice.local → A-10-0-1-10 인스턴스
- a2-svc.lattice.local → A-10-0-1-11 인스턴스
- b-svc.lattice.local → B-10-0-1-10 인스턴스
- b2-svc.lattice.local → B-10-0-1-11 인스턴스
- SSH 포트(22)에 대한 접근 정책 구성
- C 인스턴스에서
ssh a-svc.lattice.local및ssh b-svc.lattice.local로 접근 가능하도록 테스트 단계 포함
위와 같이 구성을 통해, 서비스 네트워크 → 리소스 게이트웨이 → 리소스 등록 → DNS Alias → 정책 구성 → 통신 테스트를 해보실 수 있습니다.
답변함 일 년 전
When you have VPCs with overlapping CIDR blocks (like VPC-A and VPC-B both using 10.0.0.0/16), direct VPC peering between them is not possible because AWS doesn't support peering connections between VPCs with overlapping IP address ranges.
To solve this problem and enable SSH communication from the Ansible server (instance C) in VPC-C to all instances in VPC-A and VPC-B, I recommend the following approach:
- Create VPC peering connections from VPC-C to each of the other VPCs separately:
- Create a peering connection between VPC-C and VPC-A
- Create a peering connection between VPC-C and VPC-B
- Update route tables:
- In VPC-C's route table: Add routes to VPC-A's CIDR (10.0.0.0/16) via the VPC-A peering connection and to VPC-B's CIDR (10.0.0.0/16) via the VPC-B peering connection
- In VPC-A's route table: Add a route to VPC-C's CIDR via the VPC-A peering connection
- In VPC-B's route table: Add a route to VPC-C's CIDR via the VPC-B peering connection
- Use specific routes to distinguish between the overlapping CIDRs:
- Since both VPC-A and VPC-B use the same CIDR block, you'll need to create more specific routes in VPC-C's route table
- For example, if instances A and A2 are in subnet 10.0.1.0/24 in VPC-A, and instances B and B2 are in subnet 10.0.2.0/24 in VPC-B, you can create specific routes for these subnets
- Configure security groups:
- Update security groups for instances A, A2, B, and B2 to allow inbound SSH traffic (port 22) from instance C's IP address or security group
- Ensure instance C's security group allows outbound SSH traffic to the other instances
- Alternative approach if specific routes don't work:
- If the subnet-level routing doesn't provide enough specificity, consider using NAT gateways or Transit Gateway with Network Address Translation to handle the overlapping IP addresses
- Another option is to reconsider your IP addressing scheme and change one of the VPCs to use a different CIDR block if possible
This configuration will allow your Ansible server (instance C) in VPC-C to communicate with all instances in both VPC-A and VPC-B via SSH, despite the overlapping CIDR blocks, by using specific subnet routes to distinguish between the identical address spaces.
Sources
VPC peering configurations with routes to an entire VPC - Amazon Virtual Private Cloud
Example routing options - Amazon Virtual Private Cloud
VPC peering configurations with specific routes - Amazon Virtual Private Cloud
답변함 일 년 전
