Assigning multiple IPv6 addresses on a Server

domain-name-systemipv6reverse-dns

Let me uncover my intent.

My host provides hundreds of IPV6 addresses free, but charge for an IPV4 address. I have several sites under one server and I was wondering if I can give each site/domain it's own ipv6 address.

Is that even possible? If so how?

I've read quite a bit about ipv6 but I do not understand it as clear as I'd like.

My main goal is, for each domain/site to have it's own unique IP, so someone can't do a reverse ip look up and see what sites I have on that server.

Thanks in advance for the patience.

Best Answer

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