How to switch between GSM, Ethernet and WIFI?

How to switch between GSM, Ethernet and WIFI? We are using WP7702 Module that has GSM, WIFI and Ethernet modules in it. Is there a way to switch between these for data connections when it is available. Be default, it will use GSM

in my testing, it will automatically switch to radio data or USB ECM data.

root@swi-mdm9x28-wp:~# ping www.google.com
PING www.google.com (172.217.161.132): 56 data bytes
64 bytes from 172.217.161.132: seq=0 ttl=117 time=47.493 ms
64 bytes from 172.217.161.132: seq=1 ttl=117 time=45.850 ms
^C
www.google.com ping statistics —
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 45.850/46.671/47.493 ms
root@swi-mdm9x28-wp:~# ping 192.168.2.3
PING 192.168.2.3 (192.168.2.3): 56 data bytes
^C
— 192.168.2.3 ping statistics —
4 packets transmitted, 0 packets received, 100% packet loss
root@swi-mdm9x28-wp:~# ifconfig ecm0 192.168.2.2
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# ping 192.168.2.3
PING 192.168.2.3 (192.168.2.3): 56 data bytes
64 bytes from 192.168.2.3: seq=0 ttl=64 time=4.856 ms
64 bytes from 192.168.2.3: seq=1 ttl=64 time=1.913 ms
^C
— 192.168.2.3 ping statistics —
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 1.913/3.384/4.856 ms
root@swi-mdm9x28-wp:~# ping www.google.com
PING www.google.com (172.217.161.132): 56 data bytes
64 bytes from 172.217.161.132: seq=0 ttl=117 time=52.329 ms
64 bytes from 172.217.161.132: seq=1 ttl=117 time=42.267 ms
^C
www.google.com ping statistics —
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 42.267/47.298/52.329 ms

root@swi-mdm9x28-wp:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.134.155.125 0.0.0.0 UG 0 0 0 rmnet_data0
10.134.155.124 * 255.255.255.252 U 0 0 0 rmnet_data0
192.168.2.0 * 255.255.255.0 U 0 0 0 ecm0
192.168.225.0 * 255.255.255.0 U 0 0 0 bridge0

Thanks for your kind reply. How to switch to WIFI if its available? Do we need to watch for the wifi availability if so, how and How to switch to it?

Please see the document here on how to use the wifi command:

I am trying to use following commands, but it is getting disconnected frequently

ifconfig wlan0 up

wpa_passphrase ssid pass123 > /etc/wpa_supplicant.conf


wpa_supplicant -d -D wext -i wlan0 -c /etc/wpa_supplicant.conf

Seems you did not follow the document …

That document is for the mangOH Green with wifi expansion card. I can verify that the instructions are also correct for mangOH Red with Talon wifi/BT IOT card. However OP is not clear about platform, my understanding is that mangOH Yellow which has WP7702 and built in wifi may work differently, in particular using wlan1 instead of wlan0.

Suppose, we have both rmnetdata0 cellular interface and wlan0 WLAN interface. How to make WLAN interface default and route applications to send data via WLAN?

How about using

route del default
route add default gw xxx.xxx.xxx.xxx netmask 255.255.255.0