I am encountering an issue with creating instances for multiple WAN interfaces. Specifically, I have the following paths already set up for the first WAN interface via DHCP:
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANEthernetLinkConfig.*
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.*
I need to create a second WAN interface with a similar structure, but I do not know the exact instance ID (denoted as n) for the new instances. The desired paths are:
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.n.WANEthernetLinkConfig.*
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.n.WANPPPConnection.1.*
It is crucial to create these two instances without interfering with the existing ones for the first WAN interface. In my attempts to create the second WAN interface, I receive errors when using different values for n.
Using n = 1 results in the new interface being linked to the first instance instead of being separate:
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.*
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.*
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANEthernetLinkConfig
Second WAN interface gets created, but since there is only one instance for WANEthernetLinkConfig, it becomes impossible to have separate VLANs for IPoE and PPPoE.
Any other values for n (2,3,…) lead to the following internal errors:
faultCode: "9003"
faultString: Invalid arguments
setParameterValuesFault:
- parameterName: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Enable
faultCode: "9002"
faultString: Internal error
Which after the provision is repeated end up being these errors:
faultCode: "9003"
faultString: Invalid arguments
setParameterValuesFault:
- parameterName: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.9.Enable
faultCode: "9002"
faultString: Internal error
The interface with this setup does not get created.
How can I create the second WAN interface correctly without referencing n?
The setup I have now:
if (is_tplink){
let values_pppoe = {
ConnectionTrigger: "AlwaysOn",
ConnectionType: "IP_Routed",
NATEnabled: true,
Name: "pppoe_eth_3740_1_d",
PPPAuthenticationProtocol: "AUTO_AUTH",
Password: pppoe_password,
TransportType: "PPPoE",
Username: pppoe_username,
X_TP_FirewallEnabled: true,
X_TP_IfName: "ppp0",
X_TP_L2IfName: "eth0.3740_1",
Enable: true,
};
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.[]", null, {path: 2});
let base_path_pppoe = "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.n"
const path_pppoe = base_path_pppoe + '.WANPPPConnection.[' + Object.keys(values_pppoe).map(key => key + ':' + values_pppoe[key]).join(',') + ']';
declare(path_pppoe, {path: 1}, {path: 1});
let values_pppoe_vlan = {
EthernetLinkStatus: "Up",
X_TP_IfName: "eth0.3740",
X_TP_VID: 3740,
X_TP_VLanEnabled: true,
Enable: true,
};
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.n.WanEthernetLinkConfig.*", null, {path: 2});
const path_pppoe_vlan = base_path_pppoe + '.WANEthernetLinkConfig.[' + Object.keys(values_pppoe_vlan).map(key => key + ':' + values_pppoe_vlan[key]).join(',') + ']';
declare(path_pppoe_vlan, {path: 1});
commit();
declare("Tags.PROVISIONED", {value: now}, {value: true});
declare("Reboot", null, {value: now}); }}
Any other number gives me internal errors
faultCode: "9003"
faultString: Invalid arguments
setParameterValuesFault:
- parameterName: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Enable
faultCode: "9002"
faultString: Internal error
faultCode: "9003"
faultString: Invalid arguments
setParameterValuesFault:
- parameterName: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANPPPConnection.1.Enable
faultCode: "9002"
faultString: Internal error
which after code is repeated end up being this errors:
faultCode: "9003"
faultString: Invalid arguments
setParameterValuesFault:
- parameterName: InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.9.Enable
faultCode: "9002"
faultString: Internal error
and
faultCode: "9001"
faultString: Request denied
setParameterValuesFault: null