FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

12671 questions

15052 answers

24113 comments

47054 members

0 votes
128 views 0 comments
by
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
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