Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Many datacentres sell the option of having more than one IPv4 address per server.

Before I buy and allocate any addresses, I'd like to experiment with this at home, but I am unsure how to go about it. Is it the job of specialist routers/switches or can it be achieved with basic switches and cheap PCs?

For example:

PC(A) has IPs

PC(B) has IP

PC(A)'s request to and (etc.) go to PC(B).

I have a few home routers with inbuilt switches on them that I can disable DHCP in the config. I also have a few old machines I can use to provide any netwoking services e.g. DHCP.

One of the reasons I'd like to experiment with how to do this, is to allow 1 machine to accept requests on a given port from multiple domains without proxying (hence multiple IPs), then forward the packets internally to services, on differing internal ports, based on their destination IP, with iptables rules.

share|improve this question
Why the down votes? I specifically want experiment with this on available hardware so that I can put it into place quicker in the workplace. – Mike Sep 11 '11 at 23:42

Simply having multiple addresses is pretty simple and requires no special equipment. It's called IP Aliasing. There's the traditional method of creating alias interfaces (eth0:1, etc), or the newer method of using the 'ip' command to add IPs to a single interface. A server with aliased IPs will ARP-reply for all of them (and Linux will do so on all connected interfaces, not just that subnet).

Both methods have the same effect; use of one or the other is dependent on how much you rely on broken software that binds to an interface by name (instead of an IP address) to select the source of outgoing connections and for creating a daemon's listen socket.

Aliased IPs must be manually configured; DHCP has no provision for assigning additional IPs to a single MAC address.

Building on this is multi-IP handling by loopback interfaces. In this setup, the actual interface (ethX) has a small block used to talk to the gateway (say a /30 or a /29), and a larger block is aliases as above to the 'lo' interface. The gateway device (datacenter router) has a static route for the block on the loopback, specifying the server's eth0 IP as the next hop. In this setup, the server may not ARP-reply for the IPs in the routed block, only for the IP actually directly connected on ethX.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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