8298 questions

9757 answers

15540 comments

13862 members

0 votes
1,004 views 2 comments
by
Hello

I would like to get the failover status of a RUT955 through JSON RPC. Basically I would like to know how I can reproduce the "WAN Failover Status" (below the image of the device) from the WAN Information page. https://wiki.teltonika.lt/view/RUT955_Network#WAN

So not only do I want to know which connection is in use, I also like to get the status of all other failover connections.

Is there a single command for this? Can I get this from the 'ip route' command? Or do I need more than one command to get this information? If so which commands would I need?

1 Answer

0 votes
by

Hi,

Using 'ip route' you could get active networks:

root@Teltonika~# ip route

default via 192.168.5.1 dev eth1

default via 10.133.153.104 dev wwan0  metric 10

Metric 10 means that it is backup.
by

I was hoping there was a better way. I tested using "ip route", however I saw the output below when using mobile as primary and wired as failover. When triggering the failover.

# ip route
default via 192.168.1.254 dev eth1
default via 192.168.1.254 dev eth1  proto static  src 192.168.1.252  metric 10

So that means wired is the active connection, but also the backup? It seems to me that parsing the "ip route" output is rather error prone.

And I would also need to get the config for the failover. because in my tests I saw no difference when a connection is not used as failover or the connection is used but not connected. Eg. wired is used as failover, but no cable is connected vs wired is not used as failover. Both scenarios have no line for eth1 in the "ip route" output.

So if there is a better option?

by

So that means wired is the active connection, but also the backup?

It means that it is not primary wan.

And I would also need to get the config for the failover.

root@Teltonika:~# cat /etc/config/multiwan

root@Teltonika:~# uci show multiwan

So if there is a better option?
Unfortunately no.