IAM for static IPs in templates

4 views
Skip to first unread message

Marten Lucas

unread,
Jan 19, 2026, 4:08:53 PMJan 19
to OpenWISP
Hi,

I am not sure I understand the IAM of OpenWisp correctly.

I setup a subnet and created IPs for my local infra network (the IPs for the switches).

Now I want to Apply them to a template so that I don't rely on the Configuration variables.
But how do I get a secific IP in the template?


What I have is:
{
            "type": "ethernet",
            "name": "br_lan_172",
            "addresses": [
                {
                    "proto": "static",
                    "family": "ipv4",
                    "address": "172.16.100.2",
                    "mask": 24
                }
            ],
            "device": "br-lan.172",
            "delegate": false
        }

and in the IAM:
{ "id": "93964498-70a0-4b00-9bab-0d7626473b87", "created": "2026-01-18T18:55:12.126729Z", "modified": "2026-01-18T18:55:12.126729Z", "ip_address": "172.16.100.2", "description": "switch-eg", "subnet": "34dfeb04-2d55-453b-8e41-65901a3a48fb" },

1) How do I connect the two ?

2) I have another template for static IPs in the network. Can I use IAM for this template as well? I was hoping I can manage the IAM - IP entries with the MAC and then they get applied to the template.

Please appologize if I get the purpose of IAM wrong. I am fine with using config variables but I don't wanna miss out if there is an easier way.

thx for the help and the great project.

regards

Federico Capoano

unread,
Jan 20, 2026, 10:17:52 AMJan 20
to open...@googlegroups.com
Hi,

at the moment there's two ways to use ip addresses and subnets defined in the IPAM module to be used in templates as variables:

- when using VPNs like Wireguard and Zerotier

Example of a subnet division rule:

There's two type of rules right now:

- Device: triggered when a new device is created
- VPN: triggered when a VPN-client template is assigned to a device

When the rule triggers it would automatically provision the desired amount of subnets and ip addresses, and make them available as variables to be used in the configuration.

Manually creating IPs and Subnets doesn't have much benefits now.
If you could describe your use case further it may help us. Were you expecting to be able to define subnets and ip addresses that you'd be able to then connect to templates or devices?

Best regards
Federico Capoano

--
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, visit https://groups.google.com/d/msgid/openwisp/cc4b4fbd-8bac-4b60-9f97-e0ae1aca3f31n%40googlegroups.com.

Marten Lucas

unread,
Jan 21, 2026, 8:01:10 AMJan 21
to OpenWISP
yes exectly.
I have this template:
"default_values": {
"openwisp_mac": "BC:5F:F4:BD:0C:7D",
"openwisp_ip": "172.16.100.100",
"openwisp_host": "openwisp-abc",
"printer_mac": "00:00:00:00:00:01",
"printer_ip": "10.12.12.20",
"printer_host": "printer-abc",
"voip_mac": "00:00:00:00:00:02",
"voip_ip": "10.12.12.30",
"voip_host": "voip-abc",
"appserver_mac": "00:00:00:00:00:03",
"appserver_ip": "10.12.12.10",
"appserver_url": "cloud-abc.lan",
"backupserver_mac": "00:00:00:00:00:04",
"backupserver_ip": "10.12.12.11",
"backupserver_host": "backup-abc"
},
"config": {
"dhcp": [
{
"config_name": "host",
"name": "{{printer_host}}",
"ip": "{{printer_ip}}",
"config_value": "host_printer",
"mac": "{{printer_mac}}",
"leasetime": "infinite"
},
{
"config_name": "host",
"name": "{{voip_host}}",
"ip": "{{voip_ip}}",
"config_value": "host_voip",
"mac": "{{voip_mac}}",
"leasetime": "infinite"
},
{
"config_name": "host",
"name": "{{openwisp_host}}",
"ip": "{{openwisp_ip}}",
"config_value": "host_openwisp",
"mac": "{{openwisp_mac}}",
"leasetime": "infinite"
},
{
"config_name": "host",
"name": "{{appserver_host}}",
"ip": "{{appserver_ip}}",
"config_value": "host_appserver",
"mac": "{{appserver_mac}}",
"leasetime": "infinite"
},
{
"config_name": "host",
"name": "{{backupserver_host}}",
"ip": "{{backupserver_ip}}",
"config_value": "host_backupserver",
"mac": "{{backupserver_mac}}",
"leasetime": "infinite"
}
]
},

and I am looknig for a more conventient way of assigning static IPs.

I would be great If I Can Link an interface to a IAM Subnet and then assign the IPs to the devices in IAM.
Reply all
Reply to author
Forward
0 new messages