Hi
Could anyone help to add PPPoE interface on the Mikrotik device.
Here are parts of my provision script:
//get count of ppp interfaces
let num = declare(“Device.PPP.InterfaceNumberOfEntries”, {value: 1}).value[0];
log("num: " + num);
//create one more PPP interface
declare(“Device.PPP.Interface.*”, null, {path: num+1 });
Then I should set “Device.PPP.Interface.I.X_MIKROTIK_Type” = “PPPoE”
Where I - number of just created (declared) PPP interface.
Code:
declare(“Device.PPP.Interface.”+ “3” +“.X_MIKROTIK_Type”, null, {value: “PPPoE”});
This code works when I enter I=3 manually. But last number can change. I want to get the number of last created interface from device parameters. The question is how to do this.
Then I tried this:
var interfaces = declare(“Device.PPP.Interface.”);
log(interfaces.size); // count of PPP.Interfaces
log(interfaces.path); // path of first PPP.Interface
But I don’t know how to get number or path of last element in interfaces