I have a question that I hope is simple, but I can't seem to find an answer.
I have an Ubuntu server that only allows connections from one specific source IP address. This IP address belongs to another Ubuntu server with one interface, and this is a restriction I cannot change for a variety of reasons.
I would like to have the flexibility to use the second Ubuntu server as a proxy to allow connections to the first with the correct source IP address.
The Ubuntu server with one interface has an IP address of 12.2.2.2 and the ultimate destination is a server (13.3.3.3
) that only accepts connections from 12.2.2.2
. However, my source IP address is 11.1.1.1
. I want to use the second Ubuntu server (12.2.2.2
) as a proxy to connect to the destination server (13.3.3.3
). I also want to have the ability to limit by TCP port and ideally NAT the port.
I'm not sure if this is more of a proxy server question or something that can be accomplished with iptables and NAT. I'm not a networking or Linux noob; I've been doing both in some capacity or another for 30+ years, but some rust has accumulated on my skills, so any pointers would be greatly appreciated.