Assigning multiple IPv6 addresses on a Server

Solution 1:

First of all, you need an addressing plan. If you don't have one yet, get a /48 network allocated to you. Then pick one /64 as your current major network. You'll save the rest of the address space in the event, i sincerely wish you it will happen, that your business scales up a lot.

NOTE: You will NEVER need more than a /64, but if you get really big, it might start making sense to split your big customers in different /64 to help visually recognize each of them.

Once you have your /64 you can either start allocating it serially (first IP to first site and so on) or pick organizational sub-groups and assign subnets to them (example: Customer X has 200 sites, he gets his own small subnet). I suggest the second approach, it will help with routing and your network guy won't have an headache. I assume you have multiple servers, possibly dislocated in different geographical areas.

You will need to properly route your assigned /64 so be sure you get it allocated properly by your service provider. Having your own core router helps with that (not mandatory).

After that, start adding those IPs to the interface(s) of the server that will serve those sites, by creating interface aliases like this:

$: ifconfig eth0:0 2001:470:1f0a:314::1 up

Once you're done adding addresses and you verify they are routable, create a VirtualHost in apache that will answer only on that IP/domain.

<VirtualHost [2001:470:1f0a:314::1]:80>

ServerName newhost.ipv6domain.com

If you then add proper DNS records (newhost.ipv6domain.com -> 2001:470:1f0a:314::1) you should be fine.

I obviously omitted all the non-relevant configuration for Apache. That is not a complete VirtualHost statement.

EDIT: I added the port number by mistake in the line about proper dns record. A typo caused by typing up this answer 10 minutes before work with coffee in one hand :P

Solution 2:

This is entirely possible, and is indeed how IPv6 is intended to work.

The problem comes with client connectivity, so far. IPv6 is not universally connectable right now, and probably won't be for some years yet. An IPv6-only site will not be as reachable as one with a v4 address.

However, it should be possible to support both v4 and v6 addresses. Those sites may all share one v4 address, but when a client comes in on v6 they'll get a separate IP. This dual-stack approach is what most of us will have to do in the near term as we move through the v6 transition.