0

I want to build a system that allows me to have "floating IPs". To do this, I want to have a single server with 5 IP addresses. It then relays that traffic to another machine (or more) that contains 4 VPSes. This second machine only has one real IP address, but I want each VPS to have a dedicated IP. Server 1 will be in a datacenter, server 2 will be in another datacenter. But I can't get multiple IPs on server 2, so I have to simulate it. Also I'll be able to move server 2 to a different datacenter later and my IPs can be forwarded to the new IP of server 2 without issue.

The two computers are going to be in different locations, so I can't just combine them. I'll need to tunnel traffic across the internet from one to the other.

I don't know enough about networking to be able to seamlessly forward all traffic. Where do I start learning in order to figure out? Also if you have any ideas on what I need to do, I would really appreciate it. I have searched the internet and it is so overwhelming, I just figured asking here someone could point me in the right direction.

5IP ========> Server1 ====5IP===>Server 2

In the diagram, the ISP directs traffic from 5 ips to Server1. Server2 gets traffic from Server1, but it should think that it got traffic from the internet.

The big issue I'm thinking of is that I want it to forward all traffic, not just TCP. I just have no idea how to get started. Thank you.

user3413723
  • 151
  • 5
  • 2
    If the addresses are all on the same network, then you bridge (switch) the frames. If they are on different networks, then you route the packets. – Ron Maupin Dec 02 '20 at 01:37
  • If your servers at DC2 are only reachable (and reach) through those foreign IP addresses and not with their native IPs (except to establish the tunnel), they it shouldn't be that difficult. If you intend to use both foreign and native, you now get the multi-homing case which has a lot of minor issues (eg: even if routing is done properly, UDP services that are not multi-homing aware might answer with the wrong address) – A.B Dec 02 '20 at 11:55
  • 1
    Depending on what your intent is, a load balancer such as HAProxy may be your best answer – Kevin Dec 02 '20 at 15:24
  • They invented DNS for this, why is that not an option? And yeah you could do something as simple as NAT and source address rewriting to the return traffic goes to the 'server' and not the client directly, generally known as NAT444 or CGN, just don't block your server becuase it's showing ALL traffic from ONE IP, you'll need to sift to all the NAT logs to trace down real user and abusers – Jacob Evans Dec 02 '20 at 15:50

1 Answers1

1

Yes, it's possible to create a tunnel to forward traffic to your other data center. Server 1 will act as a router to forward traffic into a GRE tunnel between data center 1 and data center 2. The trick

Given your very generic scenario, that's as about as detailed an answer as I can give you. If you provide more information about your topology, we can suggest more specific things.

Ron Trunk
  • 2,159
  • 1
  • 11
  • 19
  • I want to host websites from my house with different IPs. The other server will be in the datacenter. So if I move or switch telecom providers, I won't have an issue. I want to have my own little subnet at my house so I can have multiple servers there. All traffic will go through the datacenter before or after touching my local network. – user3413723 Dec 04 '20 at 20:04
  • In order to make this work, you need two things: 1. a static IP at your house (your ISP will charge you for it), and 2. A commercial-grade router at both locations. Servers will have poorer performance if you make them do the routing. Frankly, it may make more sense to rent websites from a cloud provider. If you decide to change, you just copy your configs to the new provider. – Ron Trunk Dec 04 '20 at 20:22