Quectel EC25A refusing to issue ipv4
Chris McKenzie
chris at waive.car
Thu Sep 6 08:37:50 UTC 2018
So here is where I am now. This is a very strange mobile network and unlike
anything else I've seen!
The ipv4 on T-Mobile for me is indeed statically assigned. I was able to
find through modemmanager.
Using a few well documented things you can find elsewher:
$ sudo mmcli -m 0 --simple-connect="apn=internet"
successfully connected the modem
$ sudo mmcli -b 0
Bearer '/org/freedesktop/ModemManager1/Bearer/0'
-------------------------
Status | connected: 'yes'
| suspended: 'no'
| interface: 'wwp0s29u1u1u4i4'
| IP timeout: '20'
-------------------------
Properties | apn: 'internet'
| roaming: 'allowed'
| IP type: 'none'
| user: 'none'
| password: 'none'
| number: 'none'
| Rm protocol: 'unknown'
-------------------------
IPv4 configuration | method: 'static'
| address: '26.27.221.170'
| prefix: '30'
| gateway: '26.27.221.169'
| DNS: '10.177.0.34', '10.177.0.210'
| MTU: '1500'
-------------------------
IPv6 configuration | method: 'unknown'
-------------------------
Stats | Duration: '0'
| Bytes received: 'N/A'
| Bytes transmitted: 'N/A'
----
Well alright, this looks within reason of what I got on windows, I'll just
ignore those dns records and use googles for now, let's try it out:
$ sudo ip addr add 26.27.221.170/30 dev wwp0s29u1u1u4i4
$ sudo ip add default via 26.27.221.169 dev wwp0s29u1u1u4i4
And bam, ipv4 is there!
Conclusions:
1. Some mobile providers will statically assign you an ipv4 address which
you can discover
through mmcli -b 0. They will not respond to DHCP Discover requests on
ipv4. You must
look this up and "manually" set it yourself.
This particular mobile provider (Los Angeles, T-Mobile) will respond on
DHCP discover for
ipv6, which is very deceptive.
2. git clone libmbim, ModemManager and libqmi. Use the latest-ish versions.
Even in something like Debian/buster which is ostensibly testing, you may
still have out of date versions. This is important!
3. Although there's an appearance of modemmanager being a managed version
of qmi-network, and qmi-network being a managed version of qmi-cli, this is
not 100% true. Although each one can do things which orchestrate the thing
below it, they can also do things that the others cannot. You cannot, as I
had assumed, use simply qmi-cli for an "Expert debug" mode and expect to
have everything at your disposal. You need all 3 when troubleshooting.
4. Don't fear the source code for these, it's not that hard and pretty well
laid out.
Case Closed. This is magnificent. Thanks a lot for your help!
On Tue, Sep 4, 2018 at 5:15 AM, Aleksander Morgado <aleksander at aleksander.es
> wrote:
> Hey,
>
> > So we start. First we query our data format:
> >
> > $ sudo qmicli -d /dev/cdc-wdm0 --wda-get-data-format
> > [03 Sep 2018, 16:44:34] -Warning ** [/dev/cdc-wdm0] requested auto
> mode
> > but no MBIM QMUX support available
> > [/dev/cdc-wdm0] Successfully got data format
> > QoS flow header: no
> > Link layer protocol: 'raw-ip'
> > Uplink data aggregation protocol: 'disabled'
> > Downlink data aggregation protocol: 'disabled'
> > NDP signature: '0'
> > Uplink data aggregation max size: '0'
> > Downlink data aggregation max size: '0'
> >
> > We see the raw-ip there, which was the recommendation.
> >
>
> Ok.
>
> > Before bringing up the network I further investigate:
> >
> > $ sudo qmicli -d /dev/cdc-wdm0 --wds-get-default-settings=3gpp
> > [03 Sep 2018, 16:48:16] -Warning ** [/dev/cdc-wdm0] requested auto
> mode
> > but no MBIM QMUX support available
> > Default settings retrieved:
> > APN: 'fast.t-mobile.com'
> > PDP type: 'ipv4-or-ipv6'
> > Username: ''
> > Password: ''
> > Auth: 'none'
> >
> > Furthermore, scanning with --wds-get-profile-list=3gpp shows that all
> the
> > PDP's are "ipv4-or-ipv6" which looks good.
> >
> > So we try the forcing of ipv4 again:
> >
> > # qmicli -d /dev/cdc-wdm0 --wds-set-ip-family=4 --client-no-release-cid
> -v
> >
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Opening device with
> > flags 'auto'...
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] loaded driver of
> cdc-wdm
> > port: qmi_wwan
> > [03 Sep 2018, 16:52:16] -Warning ** [/dev/cdc-wdm0] requested auto
> mode
> > but no MBIM QMUX support available
> > [03 Sep 2018, 16:52:16] [Debug] QMI Device at '/dev/cdc-wdm0' ready
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Assuming service
> 'wds'
> > is supported...
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Allocating new client
> > ID...
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] sent message...
> > <<<<<< RAW:
> > <<<<<< length = 16
> > <<<<<< data = 01:0F:00:00:00:00:00:01:22:00:04:00:01:01:00:01
> >
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] sent generic request
> > (translated)...
> > <<<<<< QMUX:
> > <<<<<< length = 15
> > <<<<<< flags = 0x00
> > <<<<<< service = "ctl"
> > <<<<<< client = 0
> > <<<<<< QMI:
> > <<<<<< flags = "none"
> > <<<<<< transaction = 1
> > <<<<<< tlv_length = 4
> > <<<<<< message = "Allocate CID" (0x0022)
> > <<<<<< TLV:
> > <<<<<< type = "Service" (0x01)
> > <<<<<< length = 1
> > <<<<<< value = 01
> > <<<<<< translated = wds
> >
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] received message...
> > <<<<<< RAW:
> > <<<<<< length = 24
> > <<<<<< data =
> > 01:17:00:80:00:00:01:01:22:00:0C:00:02:04:00:00:00:00:00:01:02:00:01:16
> >
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] received generic
> > response (translated)...
> > <<<<<< QMUX:
> > <<<<<< length = 23
> > <<<<<< flags = 0x80
> > <<<<<< service = "ctl"
> > <<<<<< client = 0
> > <<<<<< QMI:
> > <<<<<< flags = "response"
> > <<<<<< transaction = 1
> > <<<<<< tlv_length = 12
> > <<<<<< message = "Allocate CID" (0x0022)
> > <<<<<< TLV:
> > <<<<<< type = "Result" (0x02)
> > <<<<<< length = 4
> > <<<<<< value = 00:00:00:00
> > <<<<<< translated = SUCCESS
> > <<<<<< TLV:
> > <<<<<< type = "Allocation Info" (0x01)
> > <<<<<< length = 2
> > <<<<<< value = 01:16
> > <<<<<< translated = [ service = 'wds' cid = '22' ]
> >
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Registered 'wds'
> > (version unknown) client with ID '22'
> > [03 Sep 2018, 16:52:16] [Debug] Asynchronously set IP family...
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] sent message...
> > <<<<<< RAW:
> > <<<<<< length = 17
> > <<<<<< data = 01:10:00:00:01:16:00:01:00:4D:00:04:00:01:01:00:04
> >
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] sent generic request
> > (translated)...
> > <<<<<< QMUX:
> > <<<<<< length = 16
> > <<<<<< flags = 0x00
> > <<<<<< service = "wds"
> > <<<<<< client = 22
> > <<<<<< QMI:
> > <<<<<< flags = "none"
> > <<<<<< transaction = 1
> > <<<<<< tlv_length = 4
> > <<<<<< message = "Set IP Family" (0x004D)
> > <<<<<< TLV:
> > <<<<<< type = "Preference" (0x01)
> > <<<<<< length = 1
> > <<<<<< value = 04
> > <<<<<< translated = ipv4
> >
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] received message...
> > <<<<<< RAW:
> > <<<<<< length = 20
> > <<<<<< data =
> > 01:13:00:80:01:16:02:01:00:4D:00:07:00:02:04:00:00:00:00:00
> >
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] received generic
> > response (translated)...
> > <<<<<< QMUX:
> > <<<<<< length = 19
> > <<<<<< flags = 0x80
> > <<<<<< service = "wds"
> > <<<<<< client = 22
> > <<<<<< QMI:
> > <<<<<< flags = "response"
> > <<<<<< transaction = 1
> > <<<<<< tlv_length = 7
> > <<<<<< message = "Set IP Family" (0x004D)
> > <<<<<< TLV:
> > <<<<<< type = "Result" (0x02)
> > <<<<<< length = 4
> > <<<<<< value = 00:00:00:00
> > <<<<<< translated = SUCCESS
> >
> > [/dev/cdc-wdm0] Client ID not released:
> > Service: 'wds'
> > CID: '22'
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Releasing 'wds'
> client
> > with flags 'none'...
> > [03 Sep 2018, 16:52:16] [Debug] [/dev/cdc-wdm0] Unregistered 'wds'
> > client with ID '22'
> > [03 Sep 2018, 16:52:16] [Debug] Client released
> > [03 Sep 2018, 16:52:16] [Debug] Closed
> >
> > Now I try to pull the network up:
> > $ sudo qmicli -d /dev/cdc-wdm0
> > --wds-start-network="APN=fast.t-mobile.com,ip-type=4"
> >
> > Which succeeds
> >
>
> Yes, but it will be disconnected right after the command returns
> because the CID that was used for the command was released
> automatically. You can prevent this using --client-no-release-cid, and
> then you can re-use the CID in the next WDS commands you send with
> --client-cid=CID.
>
> > $ sudo dhclient -4 -v wwp0s29u1u1u4i4
> >
> > is the last step.
> >
> > This now fails. No ipv6, no nothing.
> >
>
> In this case, it's just because of the above, the modem is already
> disconnected at this point as the CID was released.
>
> > ------
> >
> > Alright that failed. Let's try qmi-network instead, which relies on
> > /etc/qmi-network.conf, which I will start by leaving unmodified
> > from my last email, since it seemed to have worked.
> >
> > $ sudo pkill dhclient
> > $ sudo qmi-network /dev/cdc-wdm0 start
> > Loading profile at /etc/qmi-network.conf...
> > /usr/local/bin/qmi-network: 2: /etc/qmi-network.conf: ip-type=4:
> not
> > found
> > APN: internet
> > APN user: unset
> > APN password: unset
> > qmi-proxy: no
> > Checking data format with 'qmicli -d /dev/cdc-wdm0
> > --wda-get-data-format '...
> > [03 Sep 2018, 17:03:53] -Warning ** [/dev/cdc-wdm0] requested
> auto
> > mode but no MBIM QMUX support available
> > Device link layer protocol retrieved: raw-ip
> > Getting expected data format with 'qmicli -d /dev/cdc-wdm0
> > --get-expected-data-format'...
> > [03 Sep 2018, 17:03:54] -Warning ** [/dev/cdc-wdm0] requested
> auto
> > mode but no MBIM QMUX support available
> > Expected link layer protocol retrieved: 802-3
> > Updating kernel link layer protocol with 'qmicli -d /dev/cdc-wdm0
> > --set-expected-data-format=raw-ip'...
> > [03 Sep 2018, 17:03:54] -Warning ** [/dev/cdc-wdm0] requested
> auto
> > mode but no MBIM QMUX support available
> > error: cannot set expected data format: Expected data format not
> > updated properly to 'raw-ip': got '802-3' instead
> > Error updating kernel link layer protocol
> > Starting network with 'qmicli -d /dev/cdc-wdm0
> > --wds-start-network=apn='internet' --client-no-release-cid '...
> > [03 Sep 2018, 17:03:54] -Warning ** [/dev/cdc-wdm0] requested
> auto
> > mode but no MBIM QMUX support available
> > Saving state at /tmp/qmi-network-state-cdc-wdm0... (CID: 23)
> > Saving state at /tmp/qmi-network-state-cdc-wdm0... (PDH:
> 2267620704)
> > Network started successfully
> >
> > None of these things look good. Whatever, I'll try it anyway:
> >
>
> That's strange. If you're using a kernel >= 4.5 you shouldn't have had
> any issue running --set-expected-data-format=raw-ip.
>
> > $ sudo dhclient -4 wwp0s29u1u1u4i4
> > fails.
> > $ sudo dhclient wwp0s29u1u1u4i4
> > ... eventually gives me an ipv6 address again ...
> >
> > This is where I was before.
> >
>
> I think you need to investigate a bit more why the kernel failed to
> set raw-ip for the WWAN interface.
> Also, please note that when an interface is in raw-ip mode, dhclient
> will NOT work as it doesn't know how to set the interface up. There
> are other DHCP clients out there that support that operation, just not
> all.
> Instead, you can run --wds-get-current-settings and manually apply the
> settings on the interface and set up the default routes as you wish.
> qmi-network only puts the modem in connected mode, it doesn't setup
> the network interface.
>
> If you need a solution that does all (modem connect, wwan iface setup
> and default route management) then libqmi+ModemManager+NetworkManager
> is the best solution.
>
> --
> Aleksander
> https://aleksander.es
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20180906/ad9770bb/attachment-0001.html>
More information about the libqmi-devel
mailing list