<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><span style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">Bearer 0 is
          the initial default bearer. <br>
        </span></span></p>
    <p><span style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">Bearer 1 is
          the connected bearer<br>
        </span></span></p>
    <p><span style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">Output from  </span></span><span
      style="white-space: pre-wrap">mmcli -b 1 is:</span></p>
    <p><span style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;"> ---------------------------------
        </span><br>
         General            |        path:
        /org/freedesktop/ModemManager1/Bearer/1
        <br>
                            |        type: default
        <br>
         ---------------------------------
        <br>
         Status             |   connected: yes
        <br>
                            |   suspended: no
        <br>
                            | multiplexed: no
        <br>
                            |   interface: enp0s20f0u2
        <br>
                            |  ip timeout: 20
        <br>
                            |  profile id: 1
        <br>
         ---------------------------------
        <br>
         Properties         |         apn: internet
        <br>
                            |     roaming: allowed
        <br>
                            |     ip type: ipv4
        <br>
         ---------------------------------
        <br>
         IPv4 configuration |      method: dhcp
        <br>
                            |      prefix: 0
        <br>
         ---------------------------------
        <br>
         Statistics         |  start date: 2024-02-13T12:08:31Z
        <br>
                            |    attempts: 1</span></p>
    <p><span style="font-family:monospace">
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">Please note ModemManager is not responsible for running the DHCP
client in the net interface, so if your plugin is reporting "dhcp" IP
method in the connected bearer settings (in your get_ip_config_3gpp()
method), then whoever is the network management layer on top of
ModemManager would be the one in charge of running DHCP client.</pre>
        </blockquote>
        I have NetworkManager running. I was under the assumption that
        it would automatically run its dhcp client on the interface. It
        seems to do this when I manually issue AT+CGACT=1,1. Its only
        when running under ModemManager that nothing seems to happen, in
        fact I have tried to run dhclient </span><span
        style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">enp0s20f0u2
          and only then do i get an ip address.</span><br>
      </span></p>
    <p><span style="font-family:monospace"><br>
      </span></p>
    <div class="moz-cite-prefix">On 2/13/24 14:00, Aleksander Morgado
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAAFgFrU3jzCHsvvxH_-dcK1o5wg30U3N65gQyZP78xLoHMC=UA@mail.gmail.com">
      <pre class="moz-quote-pre" wrap="">Hey,

On Mon, Feb 12, 2024 at 9:37 AM Garfield Watkins
<a class="moz-txt-link-rfc2396E" href="mailto:garfield.watkins@gmail.com"><garfield.watkins@gmail.com></a> wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">
I have created a plugin for an LTE modem. This modem exposes 1 AT command port (e.g. ttyUSB0) and one ethernet port via usb (cdc_ether).

When the modem is inserted via USB, the kernel enumerates some serial ports(ttyUSB0 -> ttyUSB7) and a network interface (enp0s20f0u1)

The modem establishes a default bearer on network registration and to establish a data network connection I need to create a pdp context (AT+CGDCONT) with an APN and thereafter activate it with AT+CGACT=1,1

The modem, which is configured in router mode responds by activating its internal dhcp server causing network managers dhcp client to work its magic and eventually configure the ethernet port with all the info it needs (gateways, dns servers, ip address etc).


This same process is essentially performed by my plugin and yet no IP address get assigned to the ethernet adapter exposed by the modem.

Why could this be happening ?

My plugin, specifically the bearer interface implements the folloiwing:

broadband_bearer_class->dial_3gpp = dial_3gpp;
broadband_bearer_class->dial_3gpp_finish = dial_3gpp_finish;
broadband_bearer_class->disconnect_3gpp = disconnect_3gpp;
broadband_bearer_class->disconnect_3gpp_finish = disconnect_3gpp_finish;
broadband_bearer_class->get_ip_config_3gpp = get_ip_config_3gpp;
broadband_bearer_class->get_ip_config_3gpp_finish = get_ip_config_3gpp_finish;
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
Please note ModemManager is not responsible for running the DHCP
client in the net interface, so if your plugin is reporting "dhcp" IP
method in the connected bearer settings (in your get_ip_config_3gpp()
method), then whoever is the network management layer on top of
ModemManager would be the one in charge of running DHCP client.

What's the output of "mmcli -b 0" (assuming 0 is the connected bearer
object) once you perform the modem connection?

</pre>
    </blockquote>
  </body>
</html>