I am running a Linux VM on Azure (IaaS) which is providing an SFTP service to the Internet.
I am migrating this service back to on-premises, through a firewall on a different public IP address.
Sadly, many customers are connecting to this service via public IP address (as opposed to FQDN).
- Linux VM has public IP 1.1.1.1 right on its NIC.
- Firewall's public IP is 2.2.2.2.
I want to redirect traffic to the on-premises firewall.
Is there an Azure service/resource that can take inbound connections to 1.1.1.1, then NAT the destination IP to 2.2.2.2 and then also NAT the source IP to 1.1.1.1 or another public IP (like 3.3.3.3) on that service/resource?
Thanks!
A redirect at the IP level (network layer) like you're asking does not exist, nor does SFTP support such a thing (unlike HTTP).
Simply change the DNS record pointing to the new server and you're done. If you don't use DNS yet, now is the time to start.
Of course, you could forward requests and data between the old and the new server (using source and destination NAT or similar), but then the data flow would be awkward.