Skip to content

Cloud WAN Connect Peer throws "Connect Peer IP is outside of subnet CIDR range" error with NO_ENCAP

1

I'm creating a Cloud WAN Connect Peer with NO_ENCAP protocol and getting this error:

An error occurred (ValidationException) when calling the CreateConnectPeer operation: 
The Connect Peer IP is outside of subnet CIDR range

My setup:

  • VPC with two subnets:
    • subnet-aaa (10.0.1.0/24): public subnet where my CGW appliance lives, ENI IP: 10.0.1.50
    • subnet-bbb (10.0.2.0/24): private "transit" subnet used for the VPC attachment to Cloud WAN
  • Connect attachment is created on top of the VPC attachment
  • The VPC attachment uses subnet-bbb (the transit subnet)

My CLI command:

aws networkmanager create-connect-peer \
  --connect-attachment-id attach-0abc123 \
  --peer-address 10.0.1.50 \
  --inside-cidr-blocks "10.255.0.0/29" \
  --subnet-arn arn:aws:ec2:us-east-1:111122223333:subnet/subnet-bbb \
  --bgp-options PeerAsn=65000

I used subnet-bbb because that's the transit subnet associated with the VPC attachment. But the error says the peer IP (10.0.1.50) is outside that subnet's CIDR (10.0.2.0/24).

Do I need to move my appliance to the transit subnet? That would break my architecture.

asked 5 months ago139 views

2 Answers
2
Accepted Answer

Hello Crown,

The repost Agent is correct. You don't need to move your appliance. The fix is simple: for NO_ENCAP Connect Peers, the SubnetArn must reference the subnet where the peer IP actually resides, not the subnet used by the VPC/transport attachment.

Root Cause:

The --subnet-arn parameter for NO_ENCAP Connect Peers serves a different purpose than you might expect. It tells Cloud WAN which subnet contains the ENI that will be the BGP peer. AWS validates that --peer-address falls within that subnet's CIDR range.

Your peer address is 10.0.1.50, which is in subnet-aaa (10.0.1.0/24). But you specified subnet-bbb (10.0.2.0/24), hence the "outside of subnet CIDR range" error.

Fix:

aws networkmanager create-connect-peer \
  --connect-attachment-id attach-0abc123 \
  --peer-address 10.0.1.50 \
  --inside-cidr-blocks "10.255.0.0/29" \
  --subnet-arn arn:aws:ec2:us-east-1:111122223333:subnet/subnet-aaa \
  --bgp-options PeerAsn=65000

Simply change subnet-bbb to subnet-aaa the subnet where your CGW appliance (10.0.1.50) actually lives.

Why This Is Different from GRE Connect:

This is where the confusion comes from. With GRE-based Connect (encapsulated), the architecture is:

Core Network ←→ Connect Attachment ←→ Transport (VPC Attachment) ←→ Transit Subnet ←→ GRE Tunnel ←→ Appliance

In GRE mode, the transport attachment's subnet carries the outer GRE packets, and the SubnetArn logically refers to the transport path. The peer IP is the GRE tunnel endpoint, which can be a different IP than the ENI.

With NO_ENCAP Connect (tunnel-less), there's no encapsulation layer:

Core Network ←→ Connect Attachment ←→ Directly to Appliance ENI

The BGP session runs directly between the Core Network edge and your appliance's ENI. There's no tunnel, no outer header, no transport subnet involvement in the data path. The SubnetArn must point to where the actual ENI lives because:

  1. AWS needs to know which subnet to create/manage the Connect Peer's network path in
  2. AWS validates the peer IP belongs to that subnet
  3. The Core Network edge routes traffic directly to that subnet

Architecture Implications:

Your transit subnet (subnet-bbb) is still used for the VPC attachment, that's fine. The VPC attachment and the Connect Peer's subnet can be different. The routing works like this:

  • VPC attachment uses subnet-bbb for its ENIs (this enables the VPC-to-CoreNetwork path)
  • Connect Peer references subnet-aaa where your appliance lives (this enables direct BGP peering)
  • The Connect attachment sits on top of the VPC attachment but the peer traffic flows directly to the appliance subnet

Important: Make sure subnet-aaa has a route table entry pointing the inside-cidr-blocks (10.255.0.0/29) toward the Core Network (via the VPC attachment). Without this route, return BGP traffic from your appliance won't reach the Core Network edge's inside IPs.

References:

AWS
SUPPORT ENGINEER

answered 5 months ago

AWS
EXPERT

reviewed 5 months ago

EXPERT

reviewed 5 months ago

  • Cheers for the explanation!!!

2

The error you're encountering occurs because when using the NO_ENCAP protocol for a Cloud WAN Connect Peer, the peer address (your appliance's IP) must fall within the CIDR range of the subnet you specify in the --subnet-arn parameter.

In your case, you're specifying subnet-bbb (10.0.2.0/24) as the subnet ARN, but your appliance's peer address is 10.0.1.50, which belongs to subnet-aaa (10.0.1.0/24). This mismatch is causing the validation error.

To resolve this, you should specify the subnet where your appliance actually resides in the --subnet-arn parameter. Update your command to use subnet-aaa instead:

aws networkmanager create-connect-peer \
--connect-attachment-id attach-0abc123 \
--peer-address 10.0.1.50 \
--inside-cidr-blocks "10.255.0.0/29" \
--subnet-arn arn:aws:ec2:us-east-1:111122223333:subnet/subnet-aaa \
--bgp-options PeerAsn=65000

The --subnet-arn parameter is specifically for NO_ENCAP protocol and indicates which subnet contains the Connect peer appliance. This is separate from the subnets used by your VPC attachment. You don't need to move your appliance to the transit subnet - the Connect attachment can still be associated with your VPC attachment while the Connect peer references the subnet where your appliance actually lives.
Sources
ConnectPeerError - AWS Global Networks for Transit Gateways
create_connect_peer - Boto3 1.42.50 documentation

answered 5 months ago

EXPERT

reviewed 5 months ago

AWS
SUPPORT ENGINEER

reviewed 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.