EG25-G ping fails after changing routing metric

After I update the routing metric for the wwan0 interface, then ping command show there is no internet connectivity.

Here are the steps of what I’m doing:

  • Run quectel-CM:
    sudo /usr/local/bin/quectel-CM -s internet.comcel.com.co
  • Ping using the wwan0 interface. This is successful.
ubuntu@ubuntu:~$ ping -I wwan0 -c 3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 10.131.139.211 wwan0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=118 time=36.8 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=118 time=28.8 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=118 time=27.7 ms

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 27.736/31.155/36.853/4.055 ms
  • Change the routing metric: sudo ifmetric wwan0 601. Here’s what the routing table looks like before and after.
# BEFORE the ifmetric command.
ubuntu@ubuntu:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.131.139.212  0.0.0.0         UG    0      0        0 wwan0
0.0.0.0         192.168.0.1     0.0.0.0         UG    600    0        0 wlan0
10.131.139.208  0.0.0.0         255.255.255.248 U     0      0        0 wwan0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0
192.168.0.0     0.0.0.0         255.255.255.0   U     600    0        0 wlan0
# AFTER the ifmetric command. 
ubuntu@ubuntu:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    600    0        0 wlan0
0.0.0.0         10.131.139.212  0.0.0.0         UG    601    0        0 wwan0
10.131.139.208  0.0.0.0         255.255.255.248 U     601    0        0 wwan0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0
192.168.0.0     0.0.0.0         255.255.255.0   U     600    0        0 wlan0
  • Ping again, this time it fails:
ubuntu@ubuntu:~$ ping -I wwan0 -c 3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 10.131.139.211 wwan0: 56(84) bytes of data.

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2036ms

Is there anything I’m doing wrong? Are there any alternatives to update the routing metric for the wwan0 interface?

Why do you set network interface metric to a fixed value?

I want to use LTE data only if wifi and ethernet data isn’t available. Because wlan is using 600, I’m setting the fixed value to 601.

What’s happening now is that LTE data is taking precedence over all other networks.