0

I'm trying to understand how IP addresses work. For instance, when you rent space at a colo for your server, and say, "I need 20 IP addresses", how are they giving those to you, and is your server aware of them or are they just paths to your server from the outside? Does the colo have a bunch of IP addresses, and they're simply routing traffic on the 20 that you purchased to your server, or does something else happen? Then, when it comes to your web server (Nginx, in my case), can you control which IP addresses to listen on or would all traffic to domains whose A Record points to any of your server's IP addresses be routed to the same place (same place in Nginx that is)?

A single physical server can have many IP addresses, right?

Finally, if I have 2 servers (one for fail-over) in the same colo, one right on top the other, is it possible to have traffic that's always coming in on the same IP address route to the backup server when the other server goes down?

3 Answers 3

1

There are many different scenarios and each one can be used in a different setup.

  • A server can be assigned multiple private/public IP addresses at the same. All of these IPs should be routed/NATed to this server.
  • Also, multiple servers can be "assigned" a single private/public IP address (VIP). This IP should be routed/NATed to this cluster of servers (to the active one). If a load balancer is used, the shared IP can be assigned to the load balancer and then it will dispatch the request to the appropriate server.
1

Regarding your first question, yes, the hosting/server provider will route a subnet or a bunch of individual IP addresses on their routers to the physical IP address on your server.

You are then able to use it on logical interfaces on your server (to be used with local services), or route them through a vpn to another host.

For failover, you would need to set up some kind of heartbeat between the two servers, and the IP used by the clients will be present on the live server, on a logical interface. If the live server goes down, the standby server will respond to arp requests for the virtual IP.

1

For the second part of your question, you need a "High Availability" solution. The way you implement that depends on the OS of the servers (Linux? Windows?). It's not so simple to answer that here. There are great tutorials for HA solutions on each platform available on the Web.

Now, for 1st part of your question. 20 IPs? Do you mean 16 or 32? It depends. Anyway, the standard way to assign some IPs for you is to split an address space with the netmask. Then, if the server has only one IP, that IP will have a default gateway (a router or a firewall). That device knows how to reach your server and how packets from your server go to the internet.

2
  • A hosting provider can route individual /32s, thus allowing only 20 addresses.
    – petrus
    Apr 22, 2012 at 14:18
  • HA Proxy is what I'll be using for HA, I think.
    – orokusaki
    Apr 22, 2012 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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