# Bootstrap WAN interfaces

**URL:** <https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071>\
**Category:** Uncategorized\
**Created:** [September 20, 2020, 7:03pm UTC](https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071 "2020-09-20T19:03:57Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![myreczek](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/myreczek/32/303_2.png) [@myreczek](https://forum.genieacs.com/u/myreczek)\
**Post date:** [September 20, 2020, 7:03pm UTC](https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071/1 "2020-09-20T19:03:57Z")

</div>

Hello,

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

```

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

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [September 20, 2020, 8:59pm UTC](https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071/2 "2020-09-20T20:59:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![myreczek](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/myreczek/32/303_2.png) [@myreczek](https://forum.genieacs.com/u/myreczek)\
**Post date:** [September 24, 2020, 9:19am UTC](https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071/3 "2020-09-24T09:19:29Z")

</div>

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:

```auto
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="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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?

---

<div class="post-metadata">

**Author:** ![Rocket78](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/rocket78/32/267_2.png) [@Rocket78](https://forum.genieacs.com/u/Rocket78)\
**Post date:** [September 24, 2020, 11:28am UTC](https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071/4 "2020-09-24T11:28:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![myreczek](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/myreczek/32/303_2.png) [@myreczek](https://forum.genieacs.com/u/myreczek)\
**Post date:** [September 24, 2020, 11:47am UTC](https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071/5 "2020-09-24T11:47:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![myreczek](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/myreczek/32/303_2.png) [@myreczek](https://forum.genieacs.com/u/myreczek)\
**Post date:** [September 24, 2020, 12:18pm UTC](https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071/6 "2020-09-24T12:18:48Z")

</div>

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});
    commit();
  }
}

```

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

---

<div class="post-metadata">

**Author:** ![Rocket78](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/rocket78/32/267_2.png) [@Rocket78](https://forum.genieacs.com/u/Rocket78)\
**Post date:** [September 24, 2020, 12:42pm UTC](https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071/7 "2020-09-24T12:42:15Z")

</div>

Your WANConnectionDevices start with 2?!

---

<div class="post-metadata">

**Author:** ![myreczek](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/myreczek/32/303_2.png) [@myreczek](https://forum.genieacs.com/u/myreczek)\
**Post date:** [September 24, 2020, 12:45pm UTC](https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071/8 "2020-09-24T12:45:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rocket78](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/rocket78/32/267_2.png) [@Rocket78](https://forum.genieacs.com/u/Rocket78)\
**Post date:** [September 24, 2020, 12:55pm UTC](https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071/9 "2020-09-24T12:55:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![myreczek](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/myreczek/32/303_2.png) [@myreczek](https://forum.genieacs.com/u/myreczek)\
**Post date:** [September 24, 2020, 12:59pm UTC](https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071/10 "2020-09-24T12:59:16Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Rocket78](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/rocket78/32/267_2.png) [@Rocket78](https://forum.genieacs.com/u/Rocket78)\
**Post date:** [September 24, 2020, 1:40pm UTC](https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071/11 "2020-09-24T13:40:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![myreczek](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/myreczek/32/303_2.png) [@myreczek](https://forum.genieacs.com/u/myreczek)\
**Post date:** [September 26, 2020, 8:06pm UTC](https://forum.genieacs.com/t/bootstrap-wan-interfaces/1071/12 "2020-09-26T20:06:22Z")

</div>

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.
