15

We use a (poorly-designed) application that requires the IP address of our corporate office which has a static public IP address. However, when our failover internet kicks in, it obviously has a different static public IP address and then remote connections fail.

If the application would accept a domain name, I would use that with dynamic DNS, but it doesn't accept a domain name.

Is there any way to input an IP address but get to our domain name? I had two thoughts that I haven't tried yet.

  1. Set up a local IP address that redirects to our domain name (e.g. 10.0.1.99 goes to local.ourdomain.com). However, I'm not quite sure how I would do this. Set up a Raspberry Pi with a web server maybe.

  2. Purchase web hosting with a dedicated IP address and have it redirect to our domain which then could get updated as needed.

Any thoughts on how to achieve this?

10
  • 1
    Reverse proxy. Stick it at a fixed address and have it forward packets to the appropriate address. Dec 4, 2017 at 2:55
  • Just a Windows program that a vendor has provided to us which sends and retrieves data from our corporate office.
    – MrPeanut
    Dec 4, 2017 at 2:56
  • @IgnacioVazquez-Abrams Something like a Raspberry Pi running Nginx as a reverse proxy?
    – MrPeanut
    Dec 4, 2017 at 3:07
  • 2
    You’re going to have to host a reverse proxy somewhere with an IP address that never changes. That will cost money. Have you considered just moving the service to the cloud where redundancy is built in anyways? The cost is probably similar. The other suggestion of using a VPN makes a lot of sense. I don’t see how a reverse proxy is a good solution to this at all. Dec 4, 2017 at 5:51
  • 1
    @Appleoddity The reverse proxy is simply the implementation of bullet point 1 of the OP. You don't have the raspberry in the corporate office but in the local network where the application is being run. Since that's feasible in the given scenario according to the OP, it's probably the simplest and cheapest solution.
    – Voo
    Dec 4, 2017 at 13:49

2 Answers 2

37

A reverse proxy is a good idea, but may be limited by protocol.

I'd solve this problem by setting up a VPN (which provides security - if the app is that badly written it does not do a DNS lookup it's probably not using decent crypto either). Using a VPN means your addresses can all be rfc1918 ( ie private ones ), and the app won't even care when the external addresses change.

0

A VPN is sort of expensive when you could get a Raspberry Pi or Pi Zero and run Debian on it, and set up iptables on it to masquarade the way you want

Details would depend on how you local network was set up, but the general idea would be to give the Pi two fixed local addresses.

One address would be reserved for administering the Raspberry Pi. That's how you'd ssh in and alter things if needed.

The other would act as proxy for the remote primary (or backup).

Packets sent to THAT address could get forwarded using iptables as a masquerade to the primary or to the fallback depending on conditions. NAT would alter the packet's source and destination addresses as needed before re-transmission.

Packets returning get NATed back to the requester.

This should work fine as long as there are no IP addresses embedded deeper in the packets, or cases like classic FTP that establish parallel connections.

Bonus points if you can make the Pi notice that the primary site has vanished and automagically switch to the backup

1
  • I run a vpn for free, i dont see why he couldn't. He isnt hiding his traffic from his ISP. OPENvpn Dec 5, 2017 at 9:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .