Bootstrap WAN interfaces


I have a 0 BOOTSTRAP attached preset to remove all WANIPConnection objects. I want to keep the OLT_CREATE_OMCI_TR069_DHCP_WAN and create INTERNET WAN device.

declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.*.WANIPConnection.[]", null, {path: 0});
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.*.WANIPConnection.[Enable:true,Name:OLT_CREATE_OMCI_TR069_DHCP_WAN]", {path: now}, {path: 1});
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.*.WANIPConnection.[Enable:true,Name:INTERNET,ConnectionType:IP_Routed,NATEnabled:true,AddressingType:DHCP,X_HW_VLAN:1020]", {path: now}, {path: 1});

I always end with this:

2020-09-20T18:53:13.955Z [INFO] 00259E-HG8245-485754436E7CE725: Inform; cpeRequestId="37" informEvent="0 BOOTSTRAP,1 BOOT,4 VALUE CHANGE" informRetryCount=1
2020-09-20T18:53:13.981Z [INFO] 00259E-HG8245-485754436E7CE725: ACS request; acsRequestId="174acdced5e0000" acsRequestName="GetParameterNames"
2020-09-20T18:53:14.062Z [INFO] 00259E-HG8245-485754436E7CE725: ACS request; acsRequestId="174acdced5e0001" acsRequestName="GetParameterValues"
2020-09-20T18:53:14.331Z [INFO] 00259E-HG8245-485754436E7CE725: ACS request; acsRequestId="174acdced5e0200" acsRequestName="GetParameterNames"
2020-09-20T18:53:15.673Z [INFO] 00259E-HG8245-485754436E7CE725: ACS request; acsRequestId="174acdced5e0201" acsRequestName="GetParameterValues"
2020-09-20T18:53:15.997Z [INFO] 00259E-HG8245-485754436E7CE725: ACS request; acsRequestId="174acdced5e0202" acsRequestName="DeleteObject"
2020-09-20T18:53:19.342Z [INFO] 00259E-HG8245-485754436E7CE725: ACS request; acsRequestId="174acdced5e0203" acsRequestName="GetParameterNames"
2020-09-20T18:53:19.574Z [INFO] 00259E-HG8245-485754436E7CE725: ACS request; acsRequestId="174acdced5e0204" acsRequestName="DeleteObject"
2020-09-20T18:53:20.446Z [INFO] 00259E-HG8245-485754436E7CE725: ACS request; acsRequestId="174acdced5e0205" acsRequestName="GetParameterNames"
2020-09-20T18:53:20.618Z [INFO] 00259E-HG8245-485754436E7CE725: ACS request; acsRequestId="174acdced5e0206" acsRequestName="DeleteObject"
2020-09-20T18:53:23.870Z [INFO] 00259E-HG8245-485754436E7CE725: ACS request; acsRequestId="174acdced5e0207" acsRequestName="GetParameterNames"
2020-09-20T18:53:24.181Z [INFO] 00259E-HG8245-485754436E7CE725: ACS request; acsRequestId="174acdced5e0208" acsRequestName="AddObject"
2020-09-20T18:53:24.467Z [INFO] 00259E-HG8245-485754436E7CE725: ACS request; acsRequestId="174acdced5e0209" acsRequestName="GetParameterValues"
2020-09-20T18:53:24.800Z [INFO] 00259E-HG8245-485754436E7CE725: ACS request; acsRequestId="174acdced5e020a" acsRequestName="SetParameterValues"
2020-09-20T18:53:24.998Z [WARN] 00259E-HG8245-485754436E7CE725: CPE fault; acsRequestId="174acdced5e020a" cpeFaultCode="9002" cpeFaultString="Internal error"
2020-09-20T18:53:24.998Z [WARN] 00259E-HG8245-485754436E7CE725: Channel has faulted; channel="bootstrap" retries=0 faultCode="cwmp.9002" faultMessage="Internal error"
2020-09-20T18:53:25.008Z [INFO] 00259E-HG8245-485754436E7CE725: New device registered

I’m not sure with the path filter. Is this even possible doing this way?

The code looks fine. Can’t help with the internal error fault as that’s a device related issue.

So I’ve come further now.

Internal errors were related to boolean literal, which is fixed now. But creating WAN interfaces still does not work.

My provision works except the last element:

declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.*.WANIPConnection.[Enable:true,Name:INTERNET,ConnectionType:IP_Routed,NATEnabled:true,AddressingType:DHCP,X_HW_VLAN:1020]", {path: now}, {path: 1});

This statements results in creating sub-instance of WANIPConnection which faults as “Resources exceeded” from the CPE.

<soap-env:Envelope xmlns:soap-enc="" xmlns:soap-env="" xmlns:xsd="" xmlns:xsi="" xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><soap-env:Header><cwmp:ID soap-env:mustUnderstand="1">174bf5fb2520104</cwmp:ID></soap-env:Header><soap-env:Body><cwmp:AddObject><ObjectName>InternetGatewayDevice.WANDevice.1.WANConnectionDevice.5.WANIPConnection.</ObjectName><ParameterKey></ParameterKey></cwmp:AddObject></soap-env:Body></soap-env:Envelope>

I can’t figure out how to create a new sub-instance of WANConnectionDevice which is the way the CPE creates WAN interfaces using its web GUI.

Can you help?

I found somewhere in this forum that the number after path in the third parameter is an absolute value of existing Objects. So in your example your CPE should create/keep just one WANConnectionDevice.

Maybe your CPE interpretes it different, but if you want 5 WANConnectionDevices then you should do a
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.*", null, {path: 5});
first. Which means if there are 3 already there create 2 more and if there are 6 delete 1.

In fact I want only 2 WAN devices.

Problem is the device comes preconfigured so I’m trying to delete wha’t preconfigured while keeping the TR069 interface which is X_HW_VLAN:1002 and create new INTERNET WAN.

But the device does not folow the rules and tries to reuse deleted object indexes which results in “Resources exceeded” faults.

This is what I have after factory reset:

    InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANIPConnection.1.Name = 2_INTERNET_R_VID_1512,xsd:string
    InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANIPConnection.1.Name = 3_VOIP_R_VID_1511,xsd:string
    InternetGatewayDevice.WANDevice.1.WANConnectionDevice.4.WANIPConnection.1.Name = 4_IPTV_B_VID_1510,xsd:string
    InternetGatewayDevice.WANDevice.1.WANConnectionDevice.5.WANIPConnection.1.Name = OLT_CREATE_OMCI_TR069_DHCP_WAN,xsd:string

I want to keep OLT_CREATE_OMCI_TR069_DHCP_WAN which has attribute X_HW_VLAN:1002 and create new WAN named INTERNET with X_HW_VLAN:1020:

declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.*.WANIPConnection.[]", null, {path: 0});
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.*.WANIPConnection.[Enable:true,X_HW_VLAN:1002]", {path: now}, {path: 1});
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.*.WANIPConnection.[Enable:true,Name:INTERNET,ConnectionType:IP_Routed,NATEnabled:true,AddressingType:DHCP,X_HW_VLAN:1020]", {path: now}, {path: 1});

But somehow the device messes with the instance indexes. It also seems it won’t create instance under WANIPConnection (Resources exceeded fault) but only under WANConnectionDevice.

I was able to delete unwanted instances in loop:

let wanPorts = declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANIPConnection.*.Name", {path: now, value: now});
let wanRegex = /^(InternetGatewayDevice.WANDevice.\d+.WANConnectionDevice.\d+)/;

for(let wanPort of wanPorts) {
  log(wanPort.path + ' = ' + wanPort.value);
  let wanDevice = wanPort.path.match(wanRegex);
  if(!wanPort.value[0].match(/TR069/)) {
    declare(wanDevice[0], null, {path: 0});

But how to create new WANConnectionDevice so it does not collide on instance index?

Your WANConnectionDevices start with 2?!

Yes and there’s nothing I can do about it, it’s the device after factory reset.

Seems like WANIPConnection is not an object. Genieacs shows the tree in “all parameters” on the device page. If there is a [+] on WANIPConnection it is an object which can be instanciated. Just like the [-] on already instanciated object.

For the WANConnectionDevices I would try to delete all existing, create only one and replicate the parameters that you want to keep from index 5.

It surely is an object. How to create a new instance like:

declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.[WANIPConnection].[X_HW_VLAN:1020]", {path: now}, {path: 1});

I mean what is the correct syntax to AddObject?

WANIPConnection seems like it is limited to one (1) object if it throws the “resources exceeded”. Sorry I overlooked that there is a Number after WANIPConnection.

I would first delete all WANConnectionDevices (as it is not starting with index 1) and do a
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.*", null, {path: 1});
which should leave you with one device named InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1. Now I would refresh InternetGatewayDevice.WANDevice.1.WANConnectionDevice from UI to see what your device made out of it and if it creates the …WANIPConnection.1 Object by itself.

Yes, WANIPConnection is limited to one instance. This is why I need the correct path alias to create new WANConnectionDevice with exactly one WANIPConnection instance, ie. something like:

declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.[].WANIPConnection[X_HW_VLAN:1020]", {path:now}, {path:1});

I know this syntax is invalid, perhaps somebody could explain the right syntax? @zaidka?

This is extremely dangerous operation since I cannot delete current WANConnectionDevice holding the tr-069 OMCI assigned IP interface since it would result in “Bad session” fault. I just want to add new WAN device for the Internet service.