0

The cellular configuration file for NetworkManger has the route metric set to 50. But on boot the route metric for the modem connection is 700. When the connection is taken down and brought back up the correct 50 is used.

How do I get the route metric to be correct on boot?

After booting:

$ ip route
default via 192.168.2.1 dev enp0s31f6 proto dhcp src 192.168.2.21 metric 100
default via 100.235.77.86 dev wwp0s20f0u11i12 proto static metric 700
100.235.77.84/30 dev wwp0s20f0u11i12 proto kernel scope link src 100.235.77.85 metric 50
192.168.2.0/24 dev enp0s31f6 proto kernel scope link src 192.168.2.21
192.168.2.1 dev enp0s31f6 proto dhcp scope link src 192.168.2.21 metric 100

When the cellular connection is brought down and then back up, the route metric is added to the route table correctly.

$ sudo nmcli connection down cellular
$ sudo nmcli connection up cellular

(the name of the configuration file is "cellular")

$ ip route
default via 100.235.77.86 dev wwp0s20f0u11i12 proto static metric 50
default via 192.168.2.1 dev enp0s31f6 proto dhcp src 192.168.2.21 metric 100
100.235.77.84/30 dev wwp0s20f0u11i12 proto kernel scope link src 100.235.77.85 metric 50
192.168.2.0/24 dev enp0s31f6 proto kernel scope link src 192.168.2.21
192.168.2.1 dev enp0s31f6 proto dhcp scope link src 192.168.2.21 metric 100

We need the route to be correct after the reboot.

We are using NetPlan with the renderer set NetworkManager.

Are we hitting a bug in NetworkManager? Suggestions for a work around? (Note the IP address of the cellular connection is clearly DHCP).

Ubuntu 18.04 Server

$ sudo cat /etc/netplan/01-netcfg.yaml
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp0s31f6:
      dhcp4: yes
      nameservers:
       addresses:
         - 8.8.8.8
         - 8.8.4.4
    enp11s0:
      dhcp4: no
      addresses:
        - 10.55.1.1/24
    lo:
      addresses:
        - 127.0.0.1/24

And the cellular configuration file

$ sudo cat /etc/NetworkManager/system-connections/cellular
[connection]
id=cellular
uuid=687de232-34f2-4417-9f16-f8ee1c8b513a
type=gsm
interface-name=cdc-wdm0
permissions=
timestamp=1587517945

[gsm]
apn=fast.t-mobile.com
number=*99#

[ipv4]
dns-search=
method=auto
never-default=false
route-metric=50

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto

Edits:

  • Changed the title from "Cellular Modem incorrectly has route metric of 700"
  • Added a bit more detail
  • Sounds like a bug in NetworkManager. I'd enable level=TRACE logging in NetworkManager.conf file and read the log. – thaller Apr 24 at 19:47
  • Thanks for the reference. level=TRACE added more info, but nothing of significance. The second start shows the route metric going to 50, the first does not. I've also filed a bug with NetworkManager. – Duane Murphy Apr 27 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.