wwan/ofono: handle missing default gateway

Sicelo requested to merge sicelo/NetworkManager:ungateway-ofono into main


Handle cases when a gateway address is not provided by the mobile operator when using static IP assignment method.


Sometimes, an operator does not send a default gateway when the ofono context is brought online. Currently, NetworkManager treats this as a fault and stops processing the connection activation. As can be seen from upstream ofono tests,in this case, the gateway should be set to, so the final configuration looks like:

$ nmcli con show ESM
GENERAL.NAME:                           ESM
GENERAL.UUID:                           07d8dd55-537f-596d-a095-35c747b7c570
GENERAL.DEVICES:                        n900_2
GENERAL.IP-IFACE:                       gprs0
GENERAL.STATE:                          activated
GENERAL.DEFAULT:                        no
GENERAL.DEFAULT6:                       no
GENERAL.SPEC-OBJECT:                    --
GENERAL.VPN:                            no
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/47
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/8
GENERAL.ZONE:                           --
GENERAL.MASTER-PATH:                    --
IP4.ROUTE[1]:                           dst =, nh =, mt = 700
IP6.GATEWAY:                            --

$ ip route show
default dev gprs0 scope link  metric 700


Please read https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md before opening the merge request. In particular, check that:

  • the subject for all commits is concise and explicative
  • the message for all commits explains the reason for the change
  • the source is properly formatted
  • any relevant documentation is up to date
  • you have added unit tests if applicable
Edited by Sicelo

Merge request reports