# AT GateWay inside VPC with CIDR smaller subnet ?

**URL:** <https://awshq.com/t/at-gateway-inside-vpc-with-cidr-smaller-subnet/18550>\
**Category:** Architecture & IaC\
**Tags:** vpc, vpn\
**Created:** [June 7, 2024, 10:32am UTC](https://awshq.com/t/at-gateway-inside-vpc-with-cidr-smaller-subnet/18550 "2024-06-07T10:32:59Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![WwWorg](https://awshq.com/letter_avatar_proxy/v4/letter/w/e36b37/32.png) [@WwWorg](https://awshq.com/u/WwWorg)\
**Post date:** [June 7, 2024, 10:32am UTC](https://awshq.com/t/at-gateway-inside-vpc-with-cidr-smaller-subnet/18550/1 "2024-06-07T10:32:59Z")

</div>

Hi all,

We are trying to establish a VPN connection to a third party. Our current network size is too large so we have been asked to reduce it to CIDR 23 or more.

I’ve provided a architectural overview of what i intend to implement as well as my current CDK architecture. Would anyone be able to provide me with some support on how i wold go about doing this?

The values are randomized for privacy in the diagram and CDK code.

Thanks

 ![](https://awshq.com/uploads/default/original/2X/6/67e85b0a9d645c66b3def7cfb1dd75acf9760e82.png)

---

<div class="post-metadata">

**Author:** ![WwWorg](https://awshq.com/letter_avatar_proxy/v4/letter/w/e36b37/32.png) [@WwWorg](https://awshq.com/u/WwWorg)\
**Post date:** [June 7, 2024, 10:36am UTC](https://awshq.com/t/at-gateway-inside-vpc-with-cidr-smaller-subnet/18550/2 "2024-06-07T10:36:57Z")

</div>

current stack definition: [https://codeshare.io/ONBdq0](https://codeshare.io/ONBdq0)

---

<div class="post-metadata">

**Author:** ![likeavirgil](https://awshq.com/letter_avatar_proxy/v4/letter/l/73ab20/32.png) [@likeavirgil](https://awshq.com/u/likeavirgil)\
**Post date:** [June 7, 2024, 1:38pm UTC](https://awshq.com/t/at-gateway-inside-vpc-with-cidr-smaller-subnet/18550/3 "2024-06-07T13:38:43Z")

</div>

What’s your question exactly?

---

<div class="post-metadata">

**Author:** ![SweatyActuator9283](https://awshq.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@SweatyActuator9283](https://awshq.com/u/SweatyActuator9283)\
**Post date:** [June 7, 2024, 1:46pm UTC](https://awshq.com/t/at-gateway-inside-vpc-with-cidr-smaller-subnet/18550/4 "2024-06-07T13:46:58Z")

</div>

why not just create other vpc with a /23 for the vpn with a peering to the existing vpn ?

---

<div class="post-metadata">

**Author:** ![WwWorg](https://awshq.com/letter_avatar_proxy/v4/letter/w/e36b37/32.png) [@WwWorg](https://awshq.com/u/WwWorg)\
**Post date:** [June 7, 2024, 1:59pm UTC](https://awshq.com/t/at-gateway-inside-vpc-with-cidr-smaller-subnet/18550/5 "2024-06-07T13:59:52Z")

</div>

> [@likeavirgil](#):
>
> What’s your question exactly?

Is this architecture feasible for my goal? is what i would like to know if this route is the ‘best’ or would you say there is no need for a NAT GW?

---

<div class="post-metadata">

**Author:** ![WwWorg](https://awshq.com/letter_avatar_proxy/v4/letter/w/e36b37/32.png) [@WwWorg](https://awshq.com/u/WwWorg)\
**Post date:** [June 7, 2024, 2:16pm UTC](https://awshq.com/t/at-gateway-inside-vpc-with-cidr-smaller-subnet/18550/6 "2024-06-07T14:16:02Z")

</div>

> [@SweatyActuator9283](#):
>
> why not just create other vpc with a /23 for the vpn with a peering to the existing vpn ?

VPC Peering doesn’t allow overlapping CIDR ranges

---

<div class="post-metadata">

**Author:** ![SweatyActuator9283](https://awshq.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@SweatyActuator9283](https://awshq.com/u/SweatyActuator9283)\
**Post date:** [June 7, 2024, 2:18pm UTC](https://awshq.com/t/at-gateway-inside-vpc-with-cidr-smaller-subnet/18550/7 "2024-06-07T14:18:17Z")

</div>

> [@WwWorg](#):
>
> VPC Peering doesn’t allow overlapping CIDR ranges

with a Load Balancer you will be fine.

---

<div class="post-metadata">

**Author:** ![s4ntos](https://awshq.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@s4ntos](https://awshq.com/u/s4ntos)\
**Post date:** [June 7, 2024, 3:04pm UTC](https://awshq.com/t/at-gateway-inside-vpc-with-cidr-smaller-subnet/18550/8 "2024-06-07T15:04:26Z")

</div>

why don’t you just use [private NATGW](https://docs.aws.amazon.com/whitepapers/latest/building-scalable-secure-multi-vpc-network-infrastructure/private-nat-gateway.html) ?

If the traffic is the otherway around just have a smaller network where you deploy your loadbalancers (or even better just create a private endpoint service if the Thrid Party Private Cloud is also on AWS)

---

<div class="post-metadata">

**Author:** ![s4lvozesta](https://awshq.com/letter_avatar_proxy/v4/letter/s/df705f/32.png) [@s4lvozesta](https://awshq.com/u/s4lvozesta)\
**Post date:** [June 7, 2024, 4:11pm UTC](https://awshq.com/t/at-gateway-inside-vpc-with-cidr-smaller-subnet/18550/9 "2024-06-07T16:11:51Z")

</div>

come this answer in another discussion

[https://repost.aws/questions/QURLDcCVqiQfSnvfYaFxzcpA/how-to-setup-a-nat-gateway-together-with-a-vpn#ANdHPCVjw2S92qpvnDn6IyUw](https://repost.aws/questions/QURLDcCVqiQfSnvfYaFxzcpA/how-to-setup-a-nat-gateway-together-with-a-vpn#ANdHPCVjw2S92qpvnDn6IyUw)

---

<div class="post-metadata">

**Author:** ![MohammedBanabila](https://awshq.com/letter_avatar_proxy/v4/letter/m/cc9497/32.png) [@MohammedBanabila](https://awshq.com/u/MohammedBanabila)\
**Post date:** [June 7, 2024, 10:40pm UTC](https://awshq.com/t/at-gateway-inside-vpc-with-cidr-smaller-subnet/18550/10 "2024-06-07T22:40:52Z")

</div>

use transit gateway, for overlapping [10.0.0.0/16](http://10.0.0.0/16) cidrblock for multiple vpc, add secondary cidrblock for multiple vpc and add another subnets which transit gateway eni subnet and have vpc attachment, route table for transit gateway, use private nat and either alb or nlb , add vpn attachment.

---

<div class="post-metadata">

**Author:** ![MohammedBanabila](https://awshq.com/letter_avatar_proxy/v4/letter/m/cc9497/32.png) [@MohammedBanabila](https://awshq.com/u/MohammedBanabila)\
**Post date:** [June 7, 2024, 11:03pm UTC](https://awshq.com/t/at-gateway-inside-vpc-with-cidr-smaller-subnet/18550/11 "2024-06-07T23:03:18Z")

</div>

have aviatrix controller in their vpc , add secondary cidr block [100.16.0.0/16](http://100.16.0.0/16) which is public subnet [100.16.1.0/24](http://100.16.1.0/24), other subnet [100.16.0.0/24](http://100.16.0.0/24) for vpcs , remove nat gateway for privatesubnet , add deattached vpn gateway and associate it with transit vpc , propagate vpn connection into route table and adding spoke gateway for applications vpc and do attachments with transit gateway

those spoke deploy vpn connection and attached to Deattached VGW at other vpc,

,
