On 01/02/17 23:21, Gert Doering wrote:
>> I don't want that. The IPs from the pool are assigned in a serial way or
>> in a random way?
> Serial.
>
>> Is there a way to put an upper limit on the dynamic pool or to make it
>> more specific?
> It's "server base address plus 0x1000 plus the relative number in the IPv4
> pool".
>
> So if your IPv4 pool is a, say, /16 (65000 addresses), your IPv6 address
> will never be more than "server base address plus 0x1000 plus 65000" - just
> start your static addresses at "server base address plus 0x1:0000:0000"
> (4 billion), which the assignment algorithm will never reach.
>
> You have 64 bits available - so using
>
>     $net::1 for the server, and thus $net:0:0:0:nnnn for dynamic clients
>     $net:0:1:0001:mmmm for static client 1
>     $net:0:1:0002:xxxx for static client 2
>     $net:0:1:0003:zzzz for static client 3
> ...
>
> will be guaranteed collision-free.
>
> gert

Thanks for the details :)

I've also looked at pool.c and found out how the pool size is done.

Nevertheless, there seems to be some strange assumptions with ipv6_base

  pool->base_ipv6 = ipv6_base;
         pool->size_ipv6 = ipv6_netbits>96 ? ( 1<<(128-ipv6_netbits) )
                           : IFCONFIG_POOL_MAX;

This gives for:
/64 to /96: size_ipv6=65536 (essentially a /112 capped by IFCONFIG_POOL_MAX)
/97: size_ipv6=2^31 (probably a print problem here for %d. msg() gives 
-2147483648 in logs)
/98: size_ipv6=2^30
...
/112: size_ipv6=65536

So a /98 to /111 gives more IPs for allocation, than /64 to /96
Why is that?

Essentially if I use a /64 I should keep the first /112 for dynamic 
allocation and not the first 4 billion (/96) as you say.
correct?

I would skip the first /96 anyways :)

regards,

G



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-users

Reply via email to