Wan ppp instances?

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]});

Try this:

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

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.

and haved error
image

Please check if this is correct

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

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. 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.

1 Like

got this fault
image
image

Thank you, i’ll try

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.

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

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.

how to solve this on zte “-”

Wrap the key X_ZTE-COM_ServiceList in quotes “X_ZTE-COM_ServiceList”

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

  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.

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)

Please include all of the code.

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 })
  }
}
    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
    }

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?

Changed script like you said:

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:

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"

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

It works now, thank you @akcoder