I’m in the process of planning a VPN migration from an on prem datacenter to AWS.
The partner company will only accept a certain public IP address to go across the tunnel ( a public IP address they own, their security requirements are kinda funky in that they only allow IP addresses in ranges they own to talk across the vpn.
Is it possible to assign a public IP address to a private NAT gateway, and allow that to route to a site-to-site vpn through a Transit Gateway? The current setup has a physical firewall NATing the vpn bound traffic to said public IP address.
I believe the only other option is to spin up an EC2 that can nat, like a linux box with iptables or something.
I don’t think you can. Private nat gateways don’t allow you to assign an elastic IP, so even if you did use AWS BYOIP to bring the IP over, it wouldn’t let you assign it to a private NAT Gateway. You would probably have to use a NAT Instance to meet security requirements.
Please correct me if I’m incorrect, I’m learning as well
Have you seen the following doc
I think a NAT host is going to be your only option. AFAIK you can’t arbitrarily NAT with an AWS-managed solution.
Doesn’t answer the question about the easiest way to NAT traffic across a vpn with Transit Gateway & Site to Site VPNs.
I’ll experiment with the private nat gateway and if it doesn’t work then it’s time for iptables ec2
You won’t be able to assign a “public IP address that they own” to anything in AWS, unless I’m misinterpreting the problem statement. Best you can do is allocate an EIP and associate it with something, and make sure the partner company adds it to the allow list(s).
Assuming you’re using something like Strongswan, you can use that EIP value as your tunnel address, ensuring that all traffic over the tunnel comes from a single (virtual) IP. The EIP is no actually “associated” with a resource, as far as AWS is concerned. But using this model ensures no IP conflicts with networks on the other side of the tunnel. There’s no requirement that your tunnel address be private, at least for Strongswan.
If they’re really stuck on “we have to own this IP,” I guess your option of a custom NAT device could work, but I do not have any experience setting that up.
Maybe a little network diagram to show how is the VPN setup right now? And which parts of it are “moving into AWS”?
You should check out RFC 6598, it is space set aside specifically for large NAT issues. If you want more help though you are going to have to provide a lot more detail.
I could be wrong but isnt this what direct connect is for?
NAT Gateways can have elastic IPs that’ll give you a static egress address for everything in the private subnets in that vpc. You can’t do that with private NAT Gateways.
Once you have a vpc with a static egress address, You can create a site to site vpn in that vpc to access resources across the VPN Tunnel.
I don’t understand the role of the transit gateway here. Is your idea to create two VPCs, 1 for apps and another for hosting site to site vpn & nat Gateway with static egress address and then access this site to site vpn from apps vpc over transit gateway?
I think a 3rd party network device VM would be the way to go.
Set up (as an example) a Palo Alto VM Series in a discrete VPC, reachable from other VPCs via transit gateway.
The Palo Alto should have two ENIs (plus the management Interface) , each in a separate subnet. One subnet would have a VPN gateway attached with a route table that points the IP addresses that the peer will allow at the Palo Alto’s ENI and a default route to the VPN gateway.
The other subnet would have a default route to the TGW and any destination subnets pointed at the Palo.
On the Palo Alto, use static NATs or Source NATs as necessary. It is not the most scalable solution but it will allow you to use public IPs that you do not actually own within the context of this VPN.