I am trying to make the LAN port of the TRB246 act as WAN through the API When I do it through WebUI, a PUT request is set to the following endpoint: <router'a ip>/interfaces/actions/lan_to_wan
I looked at the API documentation in every API version after 7.13.4, but I couldn’t find this endpoint and its documentation, so I thought the lan_to_wan endpoint is not stable and going to be removed soon.
i thought it might be like RUT series devices that we have to create another VLAN and create another WAN and connect it to the newly created VLAN, but I don’t see any VLAN created as a result of calling lan_to_wan endpoint.
Could you please tell me what is the correct way of doing it using the API?
As your task is changing the Lan port to act as wan, the recommended way to achieve that is by changing i via the WEBUI. If you go to Network → Lan → edit lan instance, and you can change the setting from for the Lan to act as Wan.
If you want to automate this via API or CLI, the approach is to replicate the WebUI action by modifying the network interface configuration files or using UCI commands over SSH:
Create or edit the interface configuration for the new WAN interface.
Set the interface protocol to DHCP or static IP as needed.
Bind the interface to the correct physical port (e.g., eth0.1 or the relevant LAN port).
Restart the network service to apply changes.
Adjust firewall zone forwarding rules to allow traffic from the new WAN interface