5243 questions

6398 answers

10284 comments

6368 members

0 votes
120 views 6 comments
by
Hello,

I have a RUT950 equipped with a LTE simcard and a satellite modem connected to the WAN interface. The default internet connection is through the satellite modem, and the LTE is the backup. I changed recently the simcard used and I´d like to switch the connection from satellite into LTE to test it. How can I do this via the command line without affecting the fact that if the simcard is not able to connect then the internet connection should switch back to satellite?

1 Answer

0 votes
by

Hello,

For the testing you can follow the steps . 

Set your mobile network as Primary WAN and Wired as Secondary if the connection is down for the mobile it will switch you to the backup (wired automatically .

Also you can do it by command line through the command "ifdown ppp" to make it down and "ifup ppp" to make it up again . And you can check your WAN IP on the overview or you can simply check by pinging on 8.8.8.8 . 

I have also attached the ss for the configurations .

I hope it helps.

Thank you.

Regards,

Ahmed

Best answer
by
Hi Ahmed,

thanks for your reponse. So in my current setup the wired connection is the main one, and mobile is the backup, which is already configured in the WAN Failover tab. So if I use the command "ifdown ppp", I will bring down the current connection (Wired) and the router will try to connect using the mobile one. Is this correct?

My concern is that I´d be doing this remotely and if the mobile connection doesn´t work then I will loose completely the connection to the router. Is there a way to avoid this? or am I missing something?
by
Hello,

As mentioned above you will set the mobile as primary in the WAN failover and wired as secondary . if there is no internet on mobile it will automatically connect to the wired .

ifdown ppp will down the mobile connection . "ppp" is for mobile.

Thank you.
by
ah ok, clear! since currently I am only able to connect to the router via SSH, can you please tell me how I can change the primary connection to mobile and wired as secondary in the command line?

Thanks again for your support.
by

Hello,

I have tried the following to set Mobile WAN as primary and and Wired as Secondary:

I used  vi /etc/config/network

You would see something like 

config interface 'wan'

        option ifname 'eth1'

        option proto 'dhcp'

        option enabled '1'

config interface 'wan2'

        option ifname 'wwan0'

        option proto 'none'

        option metric '10'

config interface 'wan3'

        option ifname 'wlan0'

        option proto 'dhcp'

        option metric '20'

config interface 'loopback'

        option ifname 'lo'

        option proto 'static'

        option ipaddr '127.0.0.1'

        option netmask '255.0.0.0'

config interface 'lan'

        option ifname 'eth0 tap0'

        option type 'bridge'

        option proto 'static'

        option ipaddr '192.168.1.1'

        option netmask '255.255.255.0'

        option disabled '0'

config switch

        option name 'switch0'

        option reset '1'

        option enable_vlan '1'

        option _vlan 'port'

config switch_vlan

        option device 'switch0'

        option vid '0'

        option vlan '1'

        option ports '0t 4'

config interface 'ppp'

        option ifname 'wwan0'

        option proto 'qmi2'

        option service 'auto'

        option device '/dev/cdc-wdm0'

        option pppd_options 'noipdefault'

        option pdptype '1'

        option cid '1'

        option method 'nat'

        option mtu '1500'

        option auth 'pap'

        option enabled '1'

        option disabled '0'

        option backup '1'

        option metric '10'

config interface 'ppp_usb'

config interface 'stabridge'

        option enabled '0'

config interface 'lan_Lan2'

        option proto 'static'

        option netmask '255.255.255.0'

        option ipaddr '192.168.100.1'

        option ifname 'eth0.1'

        option type 'bridge'

        option disabled '0'

config switch_vlan

        option device 'switch0'

        option vlan '2'

        option vid '1'

        option ports '0t 2 3'

Now press "a" to edit the configurations. 
And change the 1st two configurations for wan and wan2 to:
"
config interface 'wan'
        option ifname 'eth1'
        option proto 'dhcp'
        option enabled '1'
config interface 'wan2'
        option ifname 'wwan0'
        option proto 'none'
        option metric '10'
"
After changing press ESC (ESCAPE) , type " :wq " and press enter . Now run command luci-reload . 
Now your Mobile would become primary and Wired as secondary.
I hope it helps.
Thank you.
Regards,
Ahmed
by

Hello,

Alternatively, you can use ubus commands and change the configuration.

For example, to set mobile as primary WAN, run these commands:

uci set network.wan.ifname='wwan0'
uci set network.wan.proto='none'
uci set network.ppp.enabled='1'
uci set network.ppp.disabled='0'
uci set network.wan2.ifname='eth1'
uci set network.wan2.proto='dhcp'
uci commit
luci-reload

 


To set mobile as primary WAN, run these commands:

uci set network.wan.proto='dhcp'
uci set network.wan.ifname='eth1'
uci set network.ppp.enabled='0'
uci set network.ppp.disabled='1'
uci set network.wan2.ifname='wwan0'
uci set network.wan2.proto='none'
uci commit
luci-reload

Regards.

by

Or you can create a new profile via Web UI menu System > Profiles and apply it. Then prepare the required parameters on the new profile. Use SMS Utilities or UCI commands to switch profile. More info here:

https://community.teltonika-networks.com/18789/rut240-wan-failover-uci?show=18789#q18789