Configure a static ip address on LANCOM GS-23xx Switches
With the following Addin script you can set a static IPv4 address on LANCOM Switches of the GS-23xx series:
/**
* @param {Config} config
* @param {Context} context
* Do not edit this comment or parameter types. Required for code suggestions
*/
exports.main = function (config, context) {
if (context.device.type.indexOf("GS-23") >= 0) {
config.setScalarByOid("1.1.4.1.1.1", context.vars.DHCP_GS23xx); // onoff DHCP (on:1,off:0)
config.setScalarByOid("1.2.1500.2", "0"); // disables ConfVia Dhcp
config.setScalarByOid("1.1.4.1.1.2", context.vars.SW_IP); // switch IPv4_Addr, e.g. 1.2.3.4
config.setScalarByOid("1.1.4.1.1.3", context.vars.MASK); // IP_Mask, e.g. 255.255.255.0
config.setScalarByOid("1.1.4.1.1.4", context.vars.GW_IP); // IPv4_Gateway
config.setScalarByOid("1.1.4.1.1.5", context.vars.VLAN_ID); // VlanID (1-4094)
config.setScalarByOid("1.1.4.1.1.6", context.vars.DNS_IP); // IPv4 DNS server e.g. 1.2.3.4
}
};