Subdivision rule

43 views
Skip to first unread message

Radu Rambet

unread,
Mar 11, 2024, 8:55:56 AM3/11/24
to OpenWISP
I am trying to get rid of any manual configuration when a new device registers.

One of the things I understand its implemented is automatic IP for devices.

So I created network subdivision rule : 2 subnets of /24 each , 1 ip creation so I could register 250 devices with 1 Ip from each subnet like {{id_subnet1_ip1}} and {{id_subnet2_ip1}}


suvdivrul1.PNG
Instead what I am getting is : 2 ip s from 2 differnety subnets 2 new per device.

That usecase would be like for instance you are defining a DHCP server per device and allocate Ip-range.

But what I was expecting is same functionality as in VPN case : each new node gets a new IP and you define variables whenever needed.

What am I doing wrong ? I tried to select VPN instead of Device in sudvinision net creation but it did nothing. 

I also searched discussions and nothing recent i could find. 

Can someone help ? I am sure such functionality si available as it functions for VPN perfectly . (And many thanks for wgVPN over VxLAN integration as it is of great help in keeping things under control)

suvdivrul2.PNGsuvdivrul3.PNG

Device ip seems right but if you look closely there are 2 subnets for each device not ips from the same 2 subnets like it does for VPN.

Federico Capoano

unread,
Mar 12, 2024, 9:29:48 AM3/12/24
to open...@googlegroups.com
The help text tries to explain this:

"indicates how many addresses will be created for each subnet."

So if you have 2 subnets,  you will get 1 ip for each subnet, so you get a total of 2 IP addresses reserved for each device.

We currently have 2 built-in subnet division rules:

1. device: the rule is triggered each time a device is created
2. vpn: the rule is triggered each time a device gets a particular VPN-client template assigned

I hope this helps.
Federico

Radu Rambet

unread,
Mar 13, 2024, 2:08:32 PM3/13/24
to OpenWISP
On Tuesday, March 12, 2024 at 3:29:48 PM UTC+2 f.capoano wrote:
The help text tries to explain this:

"indicates how many addresses will be created for each subnet."

So if you have 2 subnets,  you will get 1 ip for each subnet, so you get a total of 2 IP addresses reserved for each device.


Yes but that creates 2 new subnets for each device and reserves one ip from each subnet.
it should be an option to create one subnet for instance 10.10.1.0/24 with one IP from the same range to each device 
Eg: xx_subnet1_ip1 should be 10.10.1.1 for device 1 and 10.10.1.2 for device 2 . in this way one can deploy more devices in the same L2/L3 network . 

This is exactly waht VPN rule does but only with VPN server. 

I was sure that such functionality exists as it is very useful deploying large networks. 

There are more complcated situations where one would have an DHCP server per each device where for example 3rd octet would identify the device in range and 4th would be used for individual device assignemnt over wifi. But that is just a naming convention.

Unfortunately as is I have to asign manually ip's for each device that is not a drama but in order to avoid mistakes automation would help.

Anyhow existing VPN automation is just awsome and saves immense amount of work.

Federico Capoano

unread,
Mar 14, 2024, 7:01:50 AM3/14/24
to open...@googlegroups.com
You can try instructing the rule to create very small subnets (eg: /32 or /31) and get 1 IP.
I remember there was an issue with subnets sized /32 which would not allow to get 1 IP but I don't remember if this bug is still there.
Let me know if you try and if the bug is still there we should open an issue and fix it.

Federico


--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/017d4d1b-37f2-4ea6-89d3-892ef51f6706n%40googlegroups.com.

Radu Rambet

unread,
Mar 14, 2024, 3:24:14 PM3/14/24
to OpenWISP
Actually same idea came to my mind . But i abandoned it as it populates with a lot of subnets and makes managing them a mess. Instead of avoiding mistakes one may create mistake due to too many subnets generated (one per ip per device) son 20 devices allready 20 subnets. 

And yes it cannot create /32 network . might be a bug but in my opinion doenst matter as that is not the intended functionality.

 subnet1.PNG

Federico Capoano

unread,
Mar 14, 2024, 5:37:20 PM3/14/24
to open...@googlegroups.com
At the moment what you can do is choose a /31.

I created a couple of issues which should make this use case possible:


Reply all
Reply to author
Forward
0 new messages