Hello, I cannot get it to work to add a 2nd WANIPConnection which has a custom vlan (depending on the customer) and get’s its IP Address via DHCP, I already tried a lot of stuff in the provision script, here is my current script maybe there is only a small quick fixable mistake…
const wanMac = declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.MACAddress", {value: 1}).value[0];
const serialNumber = declare("DeviceID.SerialNumber", { value: 1 }).value[0];
const config = ext("config-fetcher", "getDeviceConfig", wanMac);
if (!config || typeof config.vlanId === 'undefined') {
log(`Invalid config received from extension for ${serialNumber}. Aborting.`);
return;
}
log(`Successfully fetched config for ${serialNumber}. VLAN ID: ${config.vlanId}`);
const now = Date.now();
declare('InternetGatewayDevice.Layer2Bridging.Bridge.1.BridgeEnable', null, {value: true})
declare('InternetGatewayDevice.Layer2Bridging.Bridge.1.VLAN.1.VLANEnable', null, {value: true})
declare('InternetGatewayDevice.Layer2Bridging.Bridge.1.VLAN.1.VLANName', null, {value: 'INTERNET_DHCP'})
declare('InternetGatewayDevice.Layer2Bridging.Bridge.1.VLAN.1.VLANID', null, {value: config.vlanId})
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.*", null, {path: 2});
declare('InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.Enable', null, {value: true})
declare('InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.Name', null, {value: 'INTERNET_DHCP'})
declare('InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.AddressingType', null, {value: 'DHCP'})
declare('InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.ConnectionType', null, {value: 'IP_ROUTED'})
declare("InternetGatewayDevice.Layer2Bridging.Bridge.1.VLAN.1.VLANID", { path: 1 });
declare("InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.SSID", { path: 1 });
declare("InternetGatewayDevice.WANDevice.*", { path: 1});