Description:
You can use this add-in script to configure IP addresses, areas or networks that must not be accessed.
Add-in code:
/** * @param {Config} config * @param {Context} context * Do not edit this comment or parameter types. Required for code suggestions */ exports.main = function (config, context) { var fwVersion = context.device.firmwareVersionObject; var ufApi = config.getUfApi(); var blockAddresses = function () { ufApi.raw({ method: 'PUT' , uri: '/model/blocked-ips-settings/' , body: { "blockedAddresses" : [ // Fill with ip-addresses, ip-networks or ip-ranges as the example below "2.2.2.2" , "2.2.2.0/24" , "2.2.2.2-2.2.2.3" ] }, failOnError: false })
};
if (fwVersion.major < 11 ) { if (fwVersion.major == 10 && fwVersion.minor >= 13 && fwVersion.patch >= 6915 ) { blockAddresses(); } else { config.warnLog( "The current installed FirmwareVersion does not support the BlockedAddresses Script." ) } } else { blockAddresses(); } };
|
---|
Add-in as JSON file:
blocked-addresses.json