OPNsense Forum
Archive => 23.1 Legacy Series => Topic started by: tessus on February 18, 2023, 08:58:54 pm
-
I would like to set a DHCP static mapping via a script, but I couldn't find an API call to create such a mapping.
How can I automate this? e.g. I want to create a static DHCP mapping for interface ABC.
-
Anyone?
Is this idea so strange or does nobody know? e.g. how do you set the DHCP mapping after one used terraform to create a VM? I can automate everything, except apparently creating a static DHCP mapping.
Did nobody ever come across the same issue?
-
Sorry to bump this again. I am ok with someone telling me that it is not possible, but why does nobody answer?
Does really nobody know? Not even the OPNsense devs?
-
This might be a bad idea ... but you might be able to export and modify the config file and re-import the required parts to change the DHCP server config.
-
Hmm, this might work, iff that applying can be done via an API, otherwise I am back to square one.
-
@tessus
at the moment there is no api endpoints for dhcp leases (legacy pages are used). but it looks like there are plans for MVC migration (https://github.com/opnsense/core/issues/6380) IIUC. then api endpoints will appear
-
Great. Thanks for the info. This is indeed great news.