Ah ok, route based. I missed this.The subnet size is calculated from the local-remote IP distance. For 10.1.1.1 to 10.1.1.2 that is a /30...Cheers,Franco
Also, in your link, shouldn't there be a logarithm somewhere in there? It looks wrong.
I was wondering why this wasn't adjusted for nearest power of 2 what it should probably have been?https://github.com/opnsense/core/blob/1aeb52063159df6da3546d132a765557e6a96a6d/src/etc/inc/plugins.inc.d/ipsec.inc#L1871It looks a bit suspicious.
Quote from: bimbar on July 26, 2021, 01:03:03 pmAlso, in your link, shouldn't there be a logarithm somewhere in there? It looks wrong.It feels like my replies and questions are mostly being ignored. Quote from: franco on July 22, 2021, 07:41:35 pmI was wondering why this wasn't adjusted for nearest power of 2 what it should probably have been?https://github.com/opnsense/core/blob/1aeb52063159df6da3546d132a765557e6a96a6d/src/etc/inc/plugins.inc.d/ipsec.inc#L1871It looks a bit suspicious.
Quote from: bimbar on July 26, 2021, 01:03:03 pmAlso, in your link, shouldn't there be a logarithm somewhere in there? It looks wrong.It is. I am not that great a programmer but I know networking.The calculation for IPv4 fundamentally makes sense, but needs to be changed from a difference to the 2log of the same, rounded down plus 1 - probably. I don't know if there are convenient functions for bit arithmetic that avoid floating point calculations. As I said, not that much of a PHP guru.Plus the prefix length should be /64 for all IPv6 connections unless explicitly configured differently by the admin.One does not simply use subnets in IPv6. Kind regards,Patrick