FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
506 views 0 comments
by anonymous
Hi all,

I have an RUTX12 with the two load balanced WWAN interfaces aboard my boat, and use sim cards from 2 different network operators to give us the best chance of getting a workable connection in remote locations. I often have to enable/disable the interfaces manually (using the web interface) to keep my crew happy when one of the networks is too flaky or too slow.

I want to create a simple UI that they can use to enable/disable the interfaces themselves without having to login to the Teltonika UI.

Ideally, I would use a JSON-RPC call to do this.

But my question is:
What is the correct command to run in RUTOS to enable disable a WWAN interface?

Thanks.

1 Answer

0 votes
by anonymous
I have answered my own question, putting here to help others. Using JSON-RPC:
 

Disable an interface:

curl -d '[{"jsonrpc": "2.0", "id": 102, "method": "call", "params": [ "<Your session ID>", "uci", "set", {"config": "network", "section": "<Your interface>", "values": { "disabled": "1", "auto": "0"}}]},{"jsonrpc":"2.0","id":309,"method":"call","params":["<Your session ID>","uci","apply",{"timeout":10}]}]' http://192.168.8.1/ubus

Enable:

curl -d '[ { "jsonrpc": "2.0", "id": 172, "method": "call", "params": [ "<Your session ID>", "uci", "delete", { "config": "network", "section": "<Your interface>", "options": [ "auto", "disabled"]}]}, {"jsonrpc":"2.0","id":309,"method":"call","params":["<Your session ID>","uci","apply",{"timeout":10}]}]' http://192.168.8.1/ubus
Best answer