IPv6 multiple addresses on an interface

ipv6subnet

I used to assign different IPv6 addresses for different services on the same server this way I can filter what can be accessed from where, which is improves network security.

I just realized that the only thing I might be doing wrong is that I choose these addresses from the same /64 prefix. It is not a problem to filter out connections from the outside world on the gateway, but the isolation may be bad between the server processes.

If I understand correctly, /64 is the smallest prefix that is recommended be assigned. If I want to disallow (using packet filter on the server) the services to communicate with each other then they should not be in the same subnet so I have to assign the addresses from different /64 prefixes.

Am I right in this?

Or it is no problem using serveral /120 prefixes for example to not needlessly waste the IP range?

Should it work as per standard, or the behavior is implementation-specific?

Thank you in advance!

Best Answer

Inside your network, I guess, technically, you can do anything you like. You can assign /120's if you really want to. But you shouldn't.

But is there actually a problem you're trying to solve here? There should be zero issue assigning multiple IPv6 addresses from the same /64 to a single server. In fact you can assign an entire /64 or larger if you want to (and there are reasons why you would want to do this).

Now, that all said and done, it appears that you are mostly concerned with intra-server comunication. Here's the thing though - even if you assign IP addresses from different networks intra-server communication is still going to work. Because a server will only route to a default gateway (and thus pass through a network level firewall) if it has no route to the target - but in your case it has a direct route to the target because the IP addresses are all on the same machine.

Secondly, addressing this network communication is only one small part of the pie. If you're concerned about security in depth, what's to stop an attacker (or a rogue application) from just reading and writing directly to the memory space of the other application? Or the disk?

The most common way to enforce that sort of segregation is via Virtual Machines. Or containers/jails.