# Wan ppp instances?

**URL:** <https://forum.genieacs.com/t/wan-ppp-instances/5939>\
**Category:** Uncategorized\
**Created:** [September 8, 2024, 12:44am UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939 "2024-09-08T00:44:11Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanz](https://avatars.discourse-cdn.com/v4/letter/h/aca169/32.png) [@hanz](https://forum.genieacs.com/u/hanz)\
**Post date:** [September 8, 2024, 12:44am UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/1 "2024-09-08T00:44:11Z")

</div>

Hello, I’m new to GenieAcs.  
I’m trying to setup a Fiberhome HG6245D with the following WAN:

1. DHCP for TR069
2. PPPOE for INTERNET

So far i got the first WAN, the TR069 is configured via device interface, i tried many post about creating wan instrances but nothing happen may fault code appear and so many invalid arguments showed. I’m unable to create WANPPPConnection no matter what I’ve tried to do.  
Any help will be appreciated.

I dont know where to start on creating wan pppoe instances?

I tried adding this on provisions named “WAN\_PPP\_Instances” and presets named “WAN\_PPP\_Instances” with 0 Weight and 0 BOOTSTRAP i dont know whats the purpose, i hoped someone will explain. Im so really grateful if i ever solve this problem. Thank you

const now = Date.now();  
log(‘Creating WANPPPConnection (if necessary)’);  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.\*”, null, {path: 1});

log(‘Setting up WANPPPConnection’);  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection._._”, {path: now}); //Refresh the node…

declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection._.Enable", {value: now}, {value: “true”});  
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection._.Name”, {value: now}, {value: “2\_INTERNET\_R\_VID\_1”});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection._.ConnectionType", {value: now}, {value: “IP\_Routed”});  
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection._.X\_FH\_ServiceList”, {value: now}, {value: “INTERNET”});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection._.Password", null,{value: serial.value[0]});  
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection._.Username”, null,{value: serial.value[0]});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection._.NATEnabled", {value: now}, {value: true});  
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection._.ConnectionStatus”, null, {value: serial.value[0]});

 ![Screenshot 2024-09-08 082153](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/9/9452a52080be29fad27c1cf46b09f3a11d6ab2fe.png)

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [September 9, 2024, 5:32pm UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/2 "2024-09-09T17:32:22Z")

</div>

Try this:

```javascript
const now = Date.now();
const basePath = 'InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection';

const params = {
    Enable: true,
    name: "2_INTERNET_R_VID_1",
    ConnectionType: "IP_Routed",
    X_FH_ServiceList: "INTERNET",
    Username: serial.value[0],
    Password: serial.value[0],
    NATEnabled: true,
};

// Remove all existing entries. No changes will be made until the end of the script (if necessary)
declare(`${basePath}.[]`, null, {path: 0});

const path = basePath + '.[' + Object.keys(params).map(key => key + ':' + params[key]).join(',') + ']';

log('Creating WANPPPConnection (if necessary)', path);

// Create the instance (if necessary)
declare(path, {path: 1}, {path: 1});

```

---

<div class="post-metadata">

**Author:** ![hanz](https://avatars.discourse-cdn.com/v4/letter/h/aca169/32.png) [@hanz](https://forum.genieacs.com/u/hanz)\
**Post date:** [September 10, 2024, 12:45am UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/3 "2024-09-10T00:45:39Z")

</div>

Thank you.

I can’t make it work with your suggestion or maybe putting it in the wrong place.

I try pressing summon to get some result and i showed something like this.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/7/70391070a449da7301e283ee504e2a62a32c20c8.png)

and haved error  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/8/84863aa39849b8a327ea531c2fd827e0d2e3b4ad.png)

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/2/21299e5b5773928fb281ecef2e915246124972cf.png)

Please check if this is correct

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/9/99f4616b631f6f49abdcb79d5ee3dc56cf8d1b2c.png)

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/8/824d420d14bda91074804e796e9cb5826b711c30.png)

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [September 10, 2024, 4:05pm UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/4 "2024-09-10T16:05:19Z")

</div>

Parameter names are case sensitive, and it appears I lower cased one on accident. Replace the params block with this and try again:

```javascript
const params = {
    Enable: true,
    Name: "2_INTERNET_R_VID_1",
    ConnectionType: "IP_Routed",
    X_FH_ServiceList: "INTERNET",
    Username: serial.value[0],
    Password: serial.value[0],
    NATEnabled: true,
};

```

If you still get an error, check the logs on the CPE. Or honestly even better is to crack the unit open and connect a [TTL-\>USB serial adapter](https://www.amazon.com/dp/B075N82CDL). Every CPE I’ve encountered has a 4 pin serial header on the PCB. You can use a logic analyzer, or an internet search to figure out the pinout of the serial header. A significant amount of info is dumped out to the serial port that doesn’t even make it into syslog.

---

<div class="post-metadata">

**Author:** ![hanz](https://avatars.discourse-cdn.com/v4/letter/h/aca169/32.png) [@hanz](https://forum.genieacs.com/u/hanz)\
**Post date:** [September 12, 2024, 12:51am UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/5 "2024-09-12T00:51:57Z")

</div>

got this fault  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/5/5dea79516a2a3826b7ee4a9fc3642bf8fcb44038.png)  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/6/6fcc58288065099edf0401a6737d1d1b73075f2a.png)

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/7/7d1c59cc1e412c5c3a5bbebdf1ba850b4738e0b1.png)

Thank you, i’ll try

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [September 12, 2024, 4:04pm UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/6 "2024-09-12T16:04:44Z")

</div>

Because you haven’t defined the serial parameter. Please don’t copy and paste code without understanding what is actually going on. This is how potentially critical vulnerabilities get introduced.

```auto
const serial = declare('DeviceID.SerialNumber', {value: 1});

```

---

<div class="post-metadata">

**Author:** ![hanz](https://avatars.discourse-cdn.com/v4/letter/h/aca169/32.png) [@hanz](https://forum.genieacs.com/u/hanz)\
**Post date:** [September 12, 2024, 10:39pm UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/7 "2024-09-12T22:39:07Z")

</div>

Thank you for everything to figure out my problem, i’ll try this TTL-USB Serial Adapter to crack the device and also i noticed that everytime i make wan pppoe connection thru modem interface i dont see delete instances on genieacs\>device page, its different to another brand like huawei, zte that everytime you create wan instances you see delete instances.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/d/d6a1e54c25c3afc07cd3d603ea01ca8d2955ef43.png)

how to solve this on zte “-”

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/7/707002589a0eedda3072c6cfc714562c3359d8c9.png)

---

<div class="post-metadata">

**Author:** ![ojpojao](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/ojpojao/32/1213_2.png) [@ojpojao](https://forum.genieacs.com/u/ojpojao)\
**Post date:** [September 14, 2024, 7:47pm UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/8 "2024-09-14T19:47:05Z")

</div>

Wrap the key _ **X\_ZTE-COM\_ServiceList** _ in quotes **“X\_ZTE-COM\_ServiceList”**

---

<div class="post-metadata">

**Author:** ![Felipe](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/felipe/32/1949_2.png) [@Felipe](https://forum.genieacs.com/u/Felipe)\
**Post date:** [January 10, 2025, 5:10pm UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/9 "2025-01-10T17:10:30Z")

</div>

Hi, It still work? I’m trying to:

```auto
  const params = {
    X_HW_VLAN: 100,
    NATEnabled: true,
    MaxMRUSize: 1480,
    Username: config.pppoeUser,
    Password: config.pppoePass,
    X_HW_IPv6Enable: true
  };
  
  const path = wanPath + '[' + Object.keys(params).map(key => key + ':' + params[key]).join(',') + ']';

  log('Creating WANPPPConnection (if necessary)');
  declare(path, { path: 1 }, { path: 1 })

```

but wan instance was not created, and looking logs there’s no addObject.

```auto
2025-01-10T14:16:53.083Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: Inform; cpeRequestId="148" informEvent="6 CONNECTION REQUEST" informRetryCount=0
2025-01-10T14:16:53.113Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="1945093381c0000" acsRequestName="GetParameterNames"
2025-01-10T14:16:53.124Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="1945093381c0001" acsRequestName="GetParameterNames"
2025-01-10T14:16:53.178Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="1945093381c0002" acsRequestName="GetParameterNames"
2025-01-10T14:16:53.190Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="1945093381c0003" acsRequestName="GetParameterNames"
2025-01-10T14:16:53.207Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="1945093381c0004" acsRequestName="GetParameterNames"
2025-01-10T14:16:53.221Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="1945093381c0005" acsRequestName="GetParameterNames"
2025-01-10T14:16:53.279Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="1945093381c0006" acsRequestName="GetParameterValues"
2025-01-10T14:16:53.624Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="1945093381c0007" acsRequestName="GetParameterValues"
2025-01-10T14:16:53.698Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: Script: <<------ CHECK IF WAN IS CONFIGURED ------>>
2025-01-10T14:16:53.717Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="1945093381c0200" acsRequestName="GetParameterNames"
2025-01-10T14:16:53.769Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: Script: ONU sem nenhuma WAN PPPoE configurada. TAG: PROBLEM___NO_WAN adicionada e alerta enviado.
2025-01-10T14:16:53.995Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: Script: Creating WANPPPConnection (if necessary)
2025-01-10T14:16:54.017Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: Script: <<------ CHECK IF WAN IS CONFIGURED ------>>
2025-01-10T14:16:54.036Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: Script: ONU sem nenhuma WAN PPPoE configurada. TAG: PROBLEM___NO_WAN adicionada e alerta enviado.
2025-01-10T14:16:54.246Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: Script: Creating WANPPPConnection (if necessary)

```

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [January 10, 2025, 5:55pm UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/10 "2025-01-10T17:55:46Z")

</div>

Please include all of the code.

---

<div class="post-metadata">

**Author:** ![Felipe](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/felipe/32/1949_2.png) [@Felipe](https://forum.genieacs.com/u/Felipe)\
**Post date:** [January 10, 2025, 6:33pm UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/11 "2025-01-10T18:33:36Z")

</div>

```auto
function reconfWanPPPoe(wanExists, wanPath=null) {
  let ssid = declare(
    'InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.SSID',
    { value: 1 },
  ).value[0]
  
  let deviceId = declare('DeviceID.ID', { value: 1 }).value[0]
  let serialNumber = declare('DeviceID.SerialNumber', { value: 1 }).value[0]
  let productClass = declare('DeviceID.ProductClass', { value: 1 }).value[0]
  let oui = declare('DeviceID.OUI', { value: 1 }).value[0]
  
  let args = {
    sn: serialNumber,
    productClass: productClass,
    oui: oui,
    ssid: ssid,
  }
  
  let config = ext('nmt', 'nmt', JSON.stringify(args))
  config = JSON.parse(config)
  
  if(!wanPath) {
    wanPath = "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1."
  }
  
  const params = {
    X_HW_VLAN: 100,
    NATEnabled: true,
    MaxMRUSize: 1480,
    Username: config.pppoeUser,
    Password: config.pppoePass,
    X_HW_IPv6Enable: true
  };
  
  const path = wanPath + '[' + Object.keys(params).map(key => key + ':' + params[key]).join(',') + ']';

  if(!wanExists) {
    log('Creating WANPPPConnection (if necessary)');
  	declare(path, { path: now }, { path: 1 })
  }
}

```

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [January 10, 2025, 9:09pm UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/12 "2025-01-10T21:09:46Z")

</div>

```javascript
    if(!wanExists) {
        log('Creating WANPPPConnection (if necessary)');
        // Tell Genie to remove all instances. No work will be performed unless actually necessary
        declare(wanPath + '[]', null, {path: 0});
        declare(path, { path: 1 }, { path: 1 }); // First path arg should be 1, not now
    }

```

---

<div class="post-metadata">

**Author:** ![Felipe](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/felipe/32/1949_2.png) [@Felipe](https://forum.genieacs.com/u/Felipe)\
**Post date:** [January 13, 2025, 11:03am UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/13 "2025-01-13T11:03:00Z")

</div>

There is any way to specify what instance do I want to keep? I mean, I can say how many instances do I want, but if I want to specify an instance using any filter, is it possible?

---

<div class="post-metadata">

**Author:** ![Felipe](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/felipe/32/1949_2.png) [@Felipe](https://forum.genieacs.com/u/Felipe)\
**Post date:** [January 13, 2025, 2:09pm UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/14 "2025-01-13T14:09:41Z")

</div>

Changed script like you said:

```auto
function noWAN() {
  let ssid = declare(
    'InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.SSID',
    { value: 1 },
  ).value[0]
  
  let deviceId = declare('DeviceID.ID', { value: 1 }).value[0]
  let serialNumber = declare('DeviceID.SerialNumber', { value: 1 }).value[0]
  let productClass = declare('DeviceID.ProductClass', { value: 1 }).value[0]
  let oui = declare('DeviceID.OUI', { value: 1 }).value[0]
  
  let args = {
    sn: serialNumber,
    productClass: productClass,
    oui: oui,
    ssid: ssid,
  }
  
  let config = ext('nmt', 'nmt', JSON.stringify(args))
  config = JSON.parse(config)
  
  const wanPath = "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection"
  
  const params = {
    X_HW_VLAN: 100,
    NATEnabled: true,
    MaxMRUSize: 1480,
    Username: config.pppoeUser,
    Password: config.pppoePass,
    X_HW_IPv6Enable: true
  };
  
  const path = wanPath + '.[' + Object.keys(params).map(key => key + ':' + params[key]).join(',') + ']';
  
  declare(wanPath + '[]', null, {path: 0})
  declare(path, { path: 1 }, { path: 1 })
}

```

That’s the logs:

```auto
Inform; cpeRequestId="246" informEvent="6 CONNECTION REQUEST" informRetryCount=0
2025-01-13T14:21:25.670Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="194600a74cd0000" acsRequestName="GetParameterNames"
2025-01-13T14:21:25.679Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="194600a74cd0001" acsRequestName="GetParameterNames"
2025-01-13T14:21:25.730Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="194600a74cd0002" acsRequestName="GetParameterNames"
2025-01-13T14:21:25.740Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="194600a74cd0003" acsRequestName="GetParameterNames"
2025-01-13T14:21:25.751Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="194600a74cd0004" acsRequestName="GetParameterNames"
2025-01-13T14:21:25.762Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="194600a74cd0005" acsRequestName="GetParameterNames"
2025-01-13T14:21:25.818Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="194600a74cd0006" acsRequestName="GetParameterValues"
2025-01-13T14:21:26.094Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="194600a74cd0007" acsRequestName="GetParameterValues"
2025-01-13T14:21:26.168Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: Script: <<------ CHECK IF WAN IS CONFIGURED ------>>
2025-01-13T14:21:26.195Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: ACS request; acsRequestId="194600a74cd0200" acsRequestName="GetParameterNames"
2025-01-13T14:21:26.207Z [INFO] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: Script: ONU sem nenhuma WAN PPPoE configurada. TAG: PROBLEM___NO_WAN adicionada e alerta enviado.
2025-01-13T14:21:26.509Z [WARN] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: Channel has faulted; channel="default" retries=0 faultCode="script.Error" faultMessage="Invalid parameter path"
2025-01-13T14:21:26.509Z [WARN] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: Channel has faulted; channel="inform" retries=0 faultCode="script.Error" faultMessage="Invalid parameter path"
2025-01-13T14:21:26.510Z [WARN] 10.0.176.60 00259E-EG8145X6%2D10-485754432F06BFAE: Channel has faulted; channel="debug" retries=0 faultCode="script.Error" faultMessage="Invalid parameter path"

```

---

<div class="post-metadata">

**Author:** ![Felipe](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/felipe/32/1949_2.png) [@Felipe](https://forum.genieacs.com/u/Felipe)\
**Post date:** [January 13, 2025, 2:26pm UTC](https://forum.genieacs.com/t/wan-ppp-instances/5939/15 "2025-01-13T14:26:20Z")

</div>

My bad. There was a missing point on the path.

It works now, thank you @akcoder
