Description:With the following Addin script you can add DHCP interfaces with static IP address reservations Used variables:Add-In Code
exports.main = function (config, context) {
var ufApi = config.getUfApi();
var CreateDHCPInterface = function (interface) {
var UUIDLookup = ufApi.lookup("interfaces",
{ name: interface }
);
ufApi.createObject("dhcp-interfaces",
{
"active": true,
"interface": String(UUIDLookup),
"mode": "server",
"relay": {
"serverAddresses": []
},
"server": {
"leaseTime": 60,
"maxLeaseTime": 120,
"authoritative": true,
"preventAddressConflicts": true,
"rangeStart": "x.x.x.x",
"rangeEnd": "x.x.x.x",
"gateway": "x.x.x.x",
"preferredDns": "x.x.x.x",
"alternativeDns": "",
"preferredNtp": "",
"alternativeNtp": "",
"wins": "",
"dnsSearchDomains": [],
"staticIpAddresses": [
],
"routes": [],
"tftpAddress": "",
"pxeFilename": "",
"proxyConfigAddress": "",
"network": "x.x.x.x/24",
"vendor": {
"identifier": "",
"options": []
}
}
}
)
};
CreateDHCPInterface("InterfaceName");
};
Addin as JSON file: View file |
---|
name | DHCPInterface.json |
---|
height | 150 |
---|
|
|