Using GSM usb dongle

I am testing a GSM dongle as a reserve network if internet fails. The problem is that when i plug in the dongle, two default gateways are added to the routing table.

This is the config file with high metric cost for the gsm network:

 # interfaces(5) file used by ifup(8) and ifdown(8)

 # Please note that this file is written to be used with dhcpcd
 # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

 # Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface wlan0 inet dhcp

 # GSM 3G Hi_Link USB modem
allow-hotplug eth1
iface eth1 inet dhcp
        metric 1000

this is the routing table without dongle

pi@emonpi(ro):~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         Broadcom.Home   0.0.0.0         UG    202    0        0 eth0
192.168.3.0     *               255.255.255.0   U     202    0        0 eth0

this is with dongle

pi@emonpi(ro):~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         Broadcom.Home   0.0.0.0         UG    202    0        0 eth0
default         192.168.1.1     0.0.0.0         UG    204    0        0 eth1
default         192.168.1.1     0.0.0.0         UG    1000   0        0 eth1
192.168.1.0     *               255.255.255.0   U     204    0        0 eth1
192.168.3.0     *               255.255.255.0   U     202    0        0 eth0

please comment

Hax

What sort of usb gsm dongle are you using? We have setup using a HiLink dongle with emonpi. This will work out of the box if using emonSD pre built sd card image. Here is the manual setup: GitHub - openenergymonitor/huawei-hilink-status: Query Huawei HiLink modems for status information.