RUTX11 Failover Question

Dear Team
I need to implement the following scenario.
RUTX11 with two SIMS and SIM_SWITCH to SIM2 in case SIM1 looses icmp to specific IP address.
On routers Lan we have one device#1 with IP: and device#2 with IP:
When MOB1S1A1(SIM1) is active, traffic initiated from both devices should be forwarded to their destination.
When MOB1S2A1(SIM2) is active traffic initiated only from device#1 with IP should be forwarded and traffic from device#2 with IP should be dropped.

Please advice/assist.


I have a similar requirement as yours. This is what I did.

  1. I created a traffic rule that will block to access the WAN interface:

  2. I enabled sim switch when there is no connection for sim 1, it will switch to sim2

  3. I had a custom script that will check the status of SIM2. If SIM2 is down, the traffic rule created previously is disabled. But if SIM2 is up, the traffic rule will be enabled.

# Function to retrieve JSON result and extract mobile status
get_sim_info() {
 local sim_result="$1"
 mobile_status=$(echo "$sim_result" | awk -F'[:,]' '/"up"/ {print $2}')
# Function to check SIM connectivity
check_sim() {
 local sim_name="$1"
 local sim_result="$(ubus -S call network.interface."$sim_name" status)"
 get_sim_info "$sim_result"
 if [ "$mobile_status" = "true" ]; then
 #echo "Sim2 is in use"
 uci set firewall.21.enabled='1'
 uci commit firewall
 #echo "Sim1 is in use"
 uci set firewall.21.enabled='0'
 uci commit firewall
# Check SIM2
check_sim "mob1s2a1_4"

The firewall number will vary on the configuration. To verify, once the firewall rule is created, run this command on CLI: uci show firewall

Then, you can configure crontab for how frequent the script will run (for example, every 30 minutes).

crontab -e

*/30 * * * *


Hi and thanks for the help
I approached it as bellow
We enabled SIM_SWITCH for the switchover on failure, but also enable fail-over for MOB1S1A1 & MOB1S2A1 interfaces having track IP “” so the interface are always online when they are active (RUTX11 has only one modem).
With fail-over enable we can take advantage of the rules that exist on fail-over page.
One rule is matching traffic from source and can use either mobile interface (with a policy that includes MOB1S1A1 & MOB1S2A1 interfaces) and a rule that matches and can use only MOB1S1A1 (with a policy that includes only MOB1S1A1 interface)
We have tested this very extensively and it works as expected.

Thanks again for your help.

This topic was automatically closed after 15 days. New replies are no longer allowed.