0

Let's say I have 2 locations:

1. the United States Datacenter
2. the Russian Federation Datacenter

I have 1 /24 Subnet with 1 AS. Both sites have a different ISP.

My target is to: allocate /24 for both locations, and use different IPs from this /24 allocation for my servers in DC 1 and DC 2.

Theoretically speaking, I want something shown in the picture. I will assign different IPs for the US server and RU server.

enter image description here

Is this possible? Or the minimum allocation size is /24 and therefore I will need 2 /24 subnets?

  • Think about what Google does. It has data centers all over the world, and it uses the same addressing in each. The Internet routing protocol, BGP, will direct a user request to the closest data center, so you hit the Russian Google server from Russia, and the U.S. Google server from the U.S. each server has the same address. If the Russia network goes down, BGP will put in the next best route, and a user will automatically be directed there. – Ron Maupin Dec 4 '19 at 20:50
3

@Zac67 's (first) answer assumes you have some backdoor connectivity between the data centers. If you don't, then you cannot do this.

You can't advertise a prefix smaller than /24 on the Internet, so you can't advertise a /25.

If you create some sort of tunneling as Zac67 mentions, you could pull this off (as a last resort) , but there are three things to consider:

  1. You still need to route traffic over the tunnel so that if you want to reach a server in the US, traffic entering the russian DC gets routed over the tunnel to the US DC.
  2. Traffic from Russia will enter the Russa DC, go over the tunnel to the US DC. The return traffic will leave the US data center over the Internet to reach the Russian user. That routing is rather inefficient, and you might have bandwidth concerns.
  3. If you have stateful firewalls, it gets worse, because the return traffic must go back over the tunnel and exit the Russian DC. This is known as "trombone traffic". Routing gets complex quickly.

You really need two /24 blocks (or use addresses provided by your ISPs) in order to make this work. If you can get by with smaller address blocks, consider carefully if you really need your own AS -- you might be able to use you ISP's AS (and their address space).

| improve this answer | |
  • Thank you very much. I guess I will rent out another /24 block and separate the US and RU with 2 AS as well. – dnleiman Dec 4 '19 at 20:40
  • 1
    If you can get by with a smaller block at each DC, consider using your ISP's AS and some of their addresses. – Ron Trunk Dec 4 '19 at 20:44
  • @dnleiman why would you want two AS numbers ? – Matt Douhan Dec 4 '19 at 21:57
2

My target is to: allocate /24 for both locations,

That is perfectly possible, provided any IP is reachable through both routes.

and use different IPs from this /24 allocation for my servers in DC 1 and DC 2.

That's not possible. A client will be routed to the location closest to it (least cost route). If the server IP isn't working on that location the client can't connect. There's no try and error in routing.

Prefixes longer than /24 are not usually advertised using BGP, so you can't split it either - that depends on the ISPs though.

However, you could tunnel the other location's IPs from each location, making them reachable. If you use plain routing (no NAT) and don't depend on stateful routing you could use asymmetric routing, ie. not route client replies back into the tunnel but directly from the server using the default route.

| improve this answer | |
  • Thanks for your reply, that helps. However, I still don't get it fully. Let's say if: 1. Server in Russia has an IP: 10.0.0.1 2. The server in the US has an IP: 10.0.0.139 When a client connects to 10.0.0.139 from Russia, he's going to go to Russian DC rather than the US? What will happen to the client? He will receive an error, and I will need to do something to route him to the US manually? – dnleiman Dec 4 '19 at 19:58
  • 1
    If you advertise your route to two different location, the location with the shortest metric wins. So, Russian users will likely go to the Russian location and US users to the US. Clients cannot affect routing (nor would they know how find the other location), so they just get a timeout or an ICMP error. I had the impression you couldn't get another /24 prefix, so the above are workarounds. The good solution is what Ron is proposing: get a 2nd block or use IPs from the ISP's space. – Zac67 Dec 4 '19 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.