내용으로 건너뛰기

동일한 CIDR을 가진 VPC에 대한 네트워크 구성 문의

0

현재 VPC-A, VPC-B, VPC-C가 있습니다.

  • VPC-A와 VPC-B는 CIDR이 동일한 10.0.0.0/16 대역을 사용 중입니다.
  • VPC-A에는 A, A2 인스턴스가 있고, VPC-B에는 B, B2 인스턴스가 있습니다.
  • VPC-C에는 Ansible 서버 역할을 하는 C 인스턴스가 있습니다.

CIDR 중복 문제를 해결하고, C 인스턴스에서 A, A2, B, B2 인스턴스로 SSH(22포트) 통신이 가능하도록 구성하고 싶습니다. 어떠한 방식으로 구성해야 효율적인 구성이 가능할까요?

질문됨 일 년 전288회 조회

2개 답변
1
수락된 답변

환경 구성

  • 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 포트) 통신 가능하게 설정

구성 방법

  1. Service Network 생성
  2. VPC-A, VPC-B, VPC-C 모두 Service Network에 Attach
  3. VPC-A와 VPC-B에 Resource Gateway 생성
  4. 각 인스턴스를 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 인스턴스
  5. SSH 포트(22)에 대한 접근 정책 구성
  6. C 인스턴스에서 ssh a-svc.lattice.local 및 ssh b-svc.lattice.local로 접근 가능하도록 테스트 단계 포함

위와 같이 구성을 통해, 서비스 네트워크 → 리소스 게이트웨이 → 리소스 등록 → DNS Alias → 정책 구성 → 통신 테스트를 해보실 수 있습니다.

AWS

답변함 일 년 전

0

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:

  1. 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
  1. 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
  1. 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
  1. 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
  1. 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

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠