# Assign a large number of IPv6 addresses



## Hawara (Jan 25, 2012)

Hi!

I have a IPv6 subnet. I need to assign all of its addresses (500,000 IPs) to a FreeBSD interface. If I do that, FreeBSD hangs. On linux I can mark this network as 'local', so it accepts all packets that come to those addresses. Can I do this on FreeBSD and how?


----------



## SirDice (Jan 25, 2012)

Why on earth do you want to do that?


----------



## Hawara (Jan 25, 2012)

I have a number of servers, that act like a accelerator with nginx. Those are behind load-balancers.
I give each website a unique combination of IP addresses from a pool (So each website has a different set of four IP addresses).
I need to assign those IP addresses to accelerators, so they accept the packets that comes from the balancers.
And it can be done in linux.

P.S. I'm not trying to start a flame war FreeBSD vs linux, I need to know how to do the same thing, so I can avoid using linux on accelerators.


----------



## darkmark (Jan 25, 2012)

Sounds like you just need to route the prefix in a certain way instead of assigning the entire network to an interface, unless you have 500,000 accelerators?

Please be specific in how you did this in linux.


----------



## Hawara (Jan 25, 2012)

I actually have around 100 accelerators, but each of them must have those IP addresses on lo0to accept packets from load-balancers. Right now this is working with ipv4 addresses, but there are only 100 of them. Since IPv6 networks are bigger - more addresses can be added to unique combination.

This is the linux command I use:
[CMD=]ip -6 route add 2a00:15f8:f000:X/64 local via fe80::1 dev eth0.N[/cmd]


----------



## darkmark (Jan 25, 2012)

equivalence would be 


```
$ route add -inet6 -net 3ffe:501:ffff:222::0/64 ::1 -iface em0
$ ifconfig lo0 inet6 3ffe:501:ffff:222::1/64
```

However you are limited to 255 addresses per interface.

You may be able to get around this limitation via interface cloning and having 255 addresses per clone.


----------

