8290 questions

9757 answers

15535 comments

13843 members

0 votes
471 views 2 comments
by

hi,

How to change (using UCI commans on RUT240) this WAN Failover configuration:

to this one:

tks,

Danilo

1 Answer

0 votes
by

Hi,

Basically, you can create a new profile (menu System > Profiles) and apply it. Then prepare the required parameters on the new profile. Use SMS Utilities or UCI command to change profile:

Extract profile to:

/tar -C / -xzf /etc/profiles/<profile_name>.tar.gz

Set profiles config:

uci set profiles.general.profile=<profile_name>

uci commit profiles

Apply uci defaults:

/usr/sbin/profile.sh -u

Apply uci config:

/sbin/luci-reload

 

You could create script in /bin/ called for example switch_new which will switch profile to new profile.

Script example (change archive name to your profiles archive name; In uci line change name to your profile name):

#!/bin/ash

 

tar -C / -xzf /etc/profiles/new_1591348925.tar.gz

uci set profiles.general.profile=new

uci commit profiles

/usr/sbin/profile.sh -u

/sbin/luci-reload

You can check the exact name of profile archive with command:

ls -l /etc/profiles

Execute this command in CLI to make script executable

chmod +x /bin/switch_new

Regards.

by

hi, tks for your kind answer but I only need once to implement the new configuration (i do not need a way to switch back and forth ..).

I only need UCi command to set Wan Failover in this way:

  • Main: WAN wired interface (dhcp);
  • failover on Mobile

easy...

could you provide UCI commands to make it?

tks

by
Changing the operation mode (main and failover) is not a single command operation. These changes change the settings for network, multiwan, load balancing sections. It is better to use the Web UI to make these changes because the UCI command may be omitted or not entered correctly.