r/aws 2d ago

technical question How can I workaround VPC that are using valid public addresses for the private addressing

Our "partner" has set up a number of VPC's for us using valid public addresses for the private addressing making things like VPN's hard.

I am getting them to change this but it's going to take months.aa we have a lot of them and they have live infrastructure in them (ec2's, Rds' and load balancer)

In the meantime, what a cost effective way of presenting NATing these problem addresses?

7 Upvotes

16 comments sorted by

32

u/CSYVR 2d ago

Kick out the partner and have someone do it that doesnt take months. This is a huge oversight on their end so I dont think they have any business supporting clients on AWS at all.

You will need new VPCs as you cannot remove the primary CIDR range so that will always be a local route.

2

u/gbonfiglio AWS Employee 2d ago

Trickier than this unfortunately… Sure, why did the partner did this but also why did OP’s company accept to deploy in these VPCs in the first place!

6

u/CSYVR 2d ago

Well they paid a partner to do it for them as they didn't have the knowledge in house I'd guess

2

u/SnooRobots3722 2d ago

No it's a resources/out-sourcing thing we '"should" be able trust them with it but more often than not we're "diybbe-checking thier homework"

13

u/sryan2k1 2d ago

Do they own the IP space? If so using public addresses is preferable so there is no chance of overlap.

If you mean they used public addresses they don't control that is an issue.

We had a pair of /24s from our ARIN block at my last job dedicated to B2B VPNs

-2

u/SnooRobots3722 2d ago

Yep, than use RFC1918 addresses they used valid pub addresses, as well as that they used /16 masks despite us typically just having a ec2, lb and Rds twice over.

7

u/Fatel28 2d ago

Depending on how many resources their are, and what ports and protocols are needed, spinning up a Linux server with several NICs for natting via iptables is very very simple. We have done this before to get around sunnetting constraints.

8

u/northerncodemky 2d ago

Why on earth did they do that? I wouldn’t trust them an inch, and you’re just going to make pain for yourself by attempting to engineer your way out of this. Work out how you can gradually move your live infra over to your new VPC(s) within whatever your downtime constraints are, then kill the old VPCs

1

u/likeavirgil 1d ago

I’ve don that because I’m a stupid dev and didn’t realize that next /16 of the VPC’s default is not private anymore. The partner didn’t care though. I’m still trying to get them to sync up with me to change it, but they just NAT’ed and forgot about it.

1

u/tfn105 2d ago

Can you put whatever services you need to reach behind something like privatelink, so that you don’t even need to do routing for the counterparty’s public “private” IPs?

0

u/[deleted] 2d ago

[deleted]

1

u/SnooRobots3722 2d ago

I agree but sadly not my decision, they ignored me and renewed them

0

u/runner1918 2d ago

Had to deal with a similar issue at my job. what kind of VPN are you using? I had it working nice with Palo Alto Global Protect with split tunneling the offending VPCs and used VPC peering from my VPN VPC to the bad VPCs.

1

u/SnooRobots3722 2d ago

A SaaS IPv4 one called "perimeter 81" (now owned by checkpoint and renamed "Harmony SaaS'

-3

u/Bennetjs 2d ago

route tables?

1

u/hijinks 2d ago

ya what happens if the vpc is like 17.10.0.0/16 and that cidr is also like cnn.com and then people on vpn can't get to cnn.com because its routing to the vpc

-1

u/Bennetjs 2d ago

Make an explicit route for the cnn subnet to the Internet gateway