<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Sep 7, 2017 at 2:55 AM, Marco Marino <span dir="ltr"><<a href="mailto:marino.mrc@gmail.com" target="_blank">marino.mrc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div>Hi Dan, thank you for your code. It is really useful!<br></div>Anyway, I have problem with indexes because:<br></div><br>Vendor released a fw with 2 WANDevice because it works in two cases: with the DSL port and with the LAN4 port used as WAN. Basically this creates a first problem: I have InternetGatewayDevice.<wbr>WANDevice.1 that is unused, InternetGatewayDevice.<wbr>WANDevice.2 that is the ptm device and InternetGatewayDevice.<wbr>WANDevice.3 that is used for pppoe over eth4. (I don't know why InternetGatewayDevice.<wbr>WANDevice.1 is unused!)<br></div></div></div></div></div></div></div></blockquote><div><br></div><div>WANDevice.1 is the ATM interface, 2 is the PTM and 3 is the WAN port/Eth4</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div></div><br>It seems to me that the index of "WANConnectionDevice" is incremented of 2 in an unordered manner each time a new WANDevice is added. In fact, in my case I have:<br>InternetGatewayDevice.<wbr>WANDevice.<b>2</b>.<wbr>wanconnectiondevice.<b>3</b><br></div>and<br>InternetGatewayDevice.<wbr>WANDevice.<b>3</b>.<wbr>wanconnectiondevice.<b>1</b> <br></div><div>lastly, if I try to add a new wanconnectiondevice for example to WANDevice.1, the assigned index is 5!! in fact I have: InternetGatewayDevice.<wbr>WANDevice.1.<wbr>wanconnectiondevice.<b>5</b> <br></div><div><br></div>please, note that the index of wanconnectiondevice is unordered.<br><br></div>Following your code, my idea is to completely drop any WANDevice and any WANConnectionDevice during the script execution and then recreate only <br>InternetGatewayDevice.<wbr>WANDevice.1.<wbr>WANConnectionDevice.1.<wbr>WANIPConnection<br></div></div></div></blockquote><div><br></div><div>You are making this to complicated :). </div><div><br></div><div>Here is what I do. First ensure that a WANPPPConnection exists on the ATM interface (thats the one we use). In your case you would want to ensure one exists on the PTM interface (WANDevice.2). Then blindly set the credentials on <b>all</b> WANPPConnection instances. This allows the device to work whether its plugged into a DSL line (as either ATM or PTM) or via the WAN port/Eth4. Depending on how you have your base config on the CPE set, your provisioning script could be made more or less complicated.</div><div><br></div><div>This line will ensure that there is only one WANPPPConnection on the PTM interface:</div><div><div>declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.*", null, {path: 1});</div></div><div><br></div><div>Now blindly set the credentials across all the WANPPPConnection instances</div><div><div>    declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Username", {value: now}, {value: config.username});</div><div>    declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Password", {value: now}, {value: config.password});</div></div><div><br></div><div><br></div><div>If you are still in the testing phase and have the ability to set a base config on the CPE, configure your CPE with the PTM interface and WAN interface. Then in the WAN services section of the GUI, create two services each for the PTM and WAN interfaces. First one being PPPoE, we do PPP traffic untagged. Second interface choose IPoE, and enter a VLAN number. We call the second interface the 'Management' interface. Then bind your TR-069 traffic to the management interface. This will prevent the CPE from doing mgmt over the public internet. The second big advantage this provides is you can <b>always</b> do management on the CPE regardless of what the PPP state is. This will also allow you to switch a CPE from routed to bridged mode remotely, and still maintain communication with the CPE.</div><div><br></div><div>In our environment, when a subscriber is disabled (non-pay, we also have a lot of seasonal customers that keep the CPE over the winter [and some even leave it plugged in and on]), I set declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Enable", {value: now}, {value: false}); This explicitly turns off the PPP interface and prevents the CPE from hammering on our radius server.</div><div><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div>but at the moment this doesn't work. Basically I'm trying with:<br>declare("<wbr>InternetGatewayDevice.<wbr>WANDevice.*", null, {path: 1});<br>declare("<wbr>InternetGatewayDevice.<wbr>WANDevice.*.<wbr>WANConnectionDevice.*", null, {path: 1});<br>declare("<wbr>InternetGatewayDevice.<wbr>WANDevice.*.<wbr>WANConnectionDevice.*.<wbr>WANPPPConnection.*", null, {path: 1});<br><br></div>so, my question is, how can I completely drop the configuration and then recreate only <br><div><div><div><div><div>InternetGatewayDevice.<wbr>WANDevice.1.<wbr>WANConnectionDevice.1.<wbr>WANIPConnection<br></div><div>during the script execution? My idea is to do this in the function setupBaseWanPppConnection().<br><br></div><div>Thank you<br></div><div><br></div></div></div></div></div></div></blockquote></div></div></div>