OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version openwrt-19.07
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by MiNuS - 25.08.2020

FS#3306 - QMI & DHCP renewal issue.

I’m facing a problem on two routers WG3526 (Modem EC-25) and D-Link DWR921 (Model Broadmobi BM806). My 4G provider is Free Mobile a French mobile provider.

Every 12 hours my ISP change the IP of the interface and the DHCP-Client still get the old IP Address even if “uqmi -d /dev/cdc-wdm0 –get-current-settings” display the new valid ip address.

  • “uqmi -d /dev/cdc-wdm0 –get-current-settings” give IP “B”.
  • “udhcpc” still attribute IP “A” to the wwan0 interface resulting in an nonoperational interface until I restart it (ubus call network.interface.wwan down / ubus call network.interface.wwan up).
  • After an interface restart “udhcpc” attribute IP “B” to the wwan0 interface.

This problem happen exactly every 12 hours the duration of the dhcp lease time on the interface wwan0.

I don’t know if it’s a bug in the firmware of both modems or a problem within OpenWRT.
I can provide more informations or context if needed. It’s also described on another bug in the comment section by @Dmitry. As it’s another bug not related to the original one a new bug is needed. Thread reference https://bugs.openwrt.org/index.php?do=details&task_id=1252.


Detailed description of the BUG

'uqmi -d /dev/cdc-wdm0 –get-current-settings' display the new IP address

uqmi -d /dev/cdc-wdm0 –get-current-settings {

      "pdp-type": "ipv4",
      "ip-family": "ipv4",
      "mtu": 1500,
      "ipv4": {
              "ip": "10.81.148.43",
              "dns1": "193.41.60.16",
              "dns2": "193.41.60.15",
              "gateway": "10.81.148.44",
              "subnet": "255.255.255.248"
      },
      "ipv6": {
      },
      "domain-names": {
      }
}

'ifconfig wwan0' is showing a different IP. I tryed to restart udhcpc manually but the interface still get the old IP until I restart network interface

ifconfig wwan0

        inet addr:10.95.107.241  P-t-P:10.95.107.241  Mask:255.255.255.252
        inet6 addr: fe80::e1b3:e56d:de16:ba57/64 Scope:Link
        UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
        RX packets:54582 errors:0 dropped:0 overruns:0 frame:0
        TX packets:64104 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:46222544 (44.0 MiB)  TX bytes:60349584 (57.5 MiB)

After a network stack restart, "ifconfig wwan0" display the proper IP address.

ifconfig wwan0
        inet addr:10.81.148.43  P-t-P:10.81.148.43  Mask:255.255.255.248
        inet6 addr: fe80::e1b3:e56d:de16:ba57/64 Scope:Link
        UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
        RX packets:54584 errors:0 dropped:0 overruns:0 frame:0
        TX packets:64112 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:46223174 (44.0 MiB)  TX bytes:60351028 (57.5 MiB)

Problem happen again after 12 hours.


Details on the WG3526

root@nly-marconi:/etc/config# ubus call system board
{
	"kernel": "4.14.180",
	"hostname": "nly-marconi",
	"system": "MediaTek MT7621 ver:1 eco:3",
	"model": "ZBT-WG3526 (16M)",
	"board_name": "zbt-wg3526-16M",
	"release": {
		"distribution": "OpenWrt",
		"version": "19.07.3",
		"revision": "r11063-85e04e9f46",
		"target": "ramips/mt7621",
		"description": "OpenWrt 19.07.3 r11063-85e04e9f46"
	}
}
root@nly-marconi:~# uci show network.wwan
network.wwan=interface
network.wwan.proto='qmi'
network.wwan.device='/dev/cdc-wdm0'
network.wwan.apn='free'
network.wwan.auth='none'
network.wwan.pincode='my-pin-code-here'
network.wwan.modes='lte'
network.wwan.metric='20'
network.wwan.delegate='0'
network.wwan.force_link='0'


Details ont the Dlink router

root@lfgo-routeur:~# ubus call system board
{
	"kernel": "4.14.180",
	"hostname": "lfgo-routeur",
	"system": "MediaTek MT7620N ver:2 eco:6",
	"model": "D-Link DWR-921 C1",
	"board_name": "dlink,dwr-921-c1",
	"release": {
		"distribution": "OpenWrt",
		"version": "19.07.3",
		"revision": "r11063-85e04e9f46",
		"target": "ramips/mt7620",
		"description": "OpenWrt 19.07.3 r11063-85e04e9f46"
	}
}
root@lfgo-routeur:~# uci show network.wwan
network.wwan=interface
network.wwan.ifname='wwan0'
network.wwan.device='/dev/cdc-wdm0'
network.wwan.proto='qmi'
network.wwan.apn='free'
network.wwan.pincode='my-pin-code-here'
network.wwan.delay='10'
MiNuS commented on 31.08.2020 08:06

Additionnal informations.

I used MWAN3 to monitor the interface the past few days and the script try to restart the interface when it went down. Sometime it stay blocked on the "pin-verify" but it's another story.

Below the log showing the timing of the problem (exactly every 12 hours the dhcp lease time)

Fri Aug 28 22:23:32 CEST 2020 - Action:ifdown - Interface:wwan - Device:wwan0
Fri Aug 28 22:23:34 CEST 2020 - Action:ifdown - Interface:wwan - Device:
Fri Aug 28 22:23:40 CEST 2020 - Action:disconnected - Interface:wwan - Device:wwan0
Fri Aug 28 22:23:42 CEST 2020 - Action:connected - Interface:wwan - Device:wwan0
Fri Aug 28 22:23:43 CEST 2020 - Action:ifup - Interface:wwan - Device:wwan0

Sat Aug 29 10:23:28 CEST 2020 - Action:ifdown - Interface:wwan - Device:wwan0
Sat Aug 29 10:23:30 CEST 2020 - Action:ifdown - Interface:wwan - Device:
Sat Aug 29 10:23:37 CEST 2020 - Action:connected - Interface:wwan - Device:wwan0
Sat Aug 29 10:23:38 CEST 2020 - Action:ifup - Interface:wwan - Device:wwan0

Sat Aug 29 22:23:31 CEST 2020 - Action:ifdown - Interface:wwan - Device:wwan0
Sat Aug 29 22:23:34 CEST 2020 - Action:ifdown - Interface:wwan - Device:
Sat Aug 29 22:23:40 CEST 2020 - Action:connected - Interface:wwan - Device:wwan0
Sat Aug 29 22:23:41 CEST 2020 - Action:ifup - Interface:wwan - Device:wwan0

Sun Aug 30 10:23:32 CEST 2020 - Action:ifdown - Interface:wwan - Device:wwan0
Sun Aug 30 10:23:34 CEST 2020 - Action:ifdown - Interface:wwan - Device:
Sun Aug 30 10:23:42 CEST 2020 - Action:connected - Interface:wwan - Device:wwan0
Sun Aug 30 10:23:43 CEST 2020 - Action:ifup - Interface:wwan - Device:wwan0

Sun Aug 30 22:23:30 CEST 2020 - Action:ifdown - Interface:wwan - Device:wwan0
Sun Aug 30 22:23:32 CEST 2020 - Action:ifdown - Interface:wwan - Device:
Sun Aug 30 22:23:39 CEST 2020 - Action:connected - Interface:wwan - Device:wwan0
Sun Aug 30 22:23:40 CEST 2020 - Action:ifup - Interface:wwan - Device:wwan0

Below another view more detailed showing the result of the bug.

My script (see below) log stats of interface before and after interface restart. It also compare the DHCP lease obtained and the UQMI parameters.
There is one thing missing in this log it's the DHCP state of the interface begore going down. The DHCP lease is properly renewed with the old IP address even if " uqmi -d /dev/cdc-wdm0 –get-current-settings" display properly the new IP address given by the ISP.

Sun Aug 30 22:23:30 CEST 2020 - Action:ifdown - Interface:wwan - Device:wwan0
calling: ubus call network.interface.wwan down
{
        "pdp-type": "ipv4",
        "ip-family": "ipv4",
        "mtu": 1500,
        "ipv4": {
                "ip": "10.92.174.236",
                "dns1": "212.27.40.240",
                "dns2": "212.27.40.241",
                "gateway": "10.92.174.237",
                "subnet": "255.255.255.248"
        },
        "ipv6": {

        },
        "domain-names": {

        }
}
wwan0     Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.41.208.219  P-t-P:10.41.208.219  Mask:255.255.255.248
          inet6 addr: fe80::b6a7:6397:3697:50fa/64 Scope:Link
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:69814179 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28061149 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:87843195331 (81.8 GiB)  TX bytes:5812847812 (5.4 GiB)

Sun Aug 30 22:23:32 CEST 2020 - Action:ifdown - Interface:wwan - Device:
calling: ubus call network.interface.wwan down
"Out of call"
wwan0     Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          POINTOPOINT NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:69814179 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28061150 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:87843195331 (81.8 GiB)  TX bytes:5812847876 (5.4 GiB)

calling: ubus call network.interface.wwan up
"Out of call"
wwan0     Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          POINTOPOINT NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:69814179 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28061150 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:87843195331 (81.8 GiB)  TX bytes:5812847876 (5.4 GiB)

calling: ubus call network.interface.wwan up
{
        "pdp-type": "ipv4",
        "ip-family": "ipv4",
        "mtu": 1500,
        "ipv4": {
                "ip": "10.92.174.236",
                "dns1": "212.27.40.240",
                "dns2": "212.27.40.241",
                "gateway": "10.92.174.237",
                "subnet": "255.255.255.248"
        },
        "ipv6": {

        },
        "domain-names": {

        }
}
wwan0     Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.92.174.236  P-t-P:10.92.174.236  Mask:255.255.255.248
          inet6 addr: fe80::b6a7:6397:3697:50fa/64 Scope:Link
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:69814181 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28061156 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:87843195969 (81.8 GiB)  TX bytes:5812848916 (5.4 GiB)

Sun Aug 30 22:23:39 CEST 2020 - Action:connected - Interface:wwan - Device:wwan0
Sun Aug 30 22:23:40 CEST 2020 - Action:ifup - Interface:wwan - Device:wwan0

Below the script used to monitor the interface in MWAN3.

#!/bin/sh
#
# This file is interpreted as shell script.
# Put your custom mwan3 action here, they will
# be executed with each netifd hotplug interface event
# on interfaces for which mwan3 is enabled.
#
# There are three main environment variables that are passed to this script.
#
# $ACTION
#      <ifup>         Is called by netifd and mwan3track
#      <ifdown>       Is called by netifd and mwan3track
#      <connected>    Is only called by mwan3track if tracking was successful
#      <disconnected> Is only called by mwan3track if tracking has failed
# $INTERFACE	Name of the interface which went up or down (e.g. "wan" or "wwan")
# $DEVICE	Physical device name which interface went up or down (e.g. "eth0" or "wwan0")

Date=`date`
echo "$Date - Action:$ACTION - Interface:$INTERFACE - Device:$DEVICE" >> /tmp/interface.log
if [ $ACTION = "ifdown" ]
then
     if [ $INTERFACE = "wwan" ]
     then
          echo "calling: ubus call network.interface.wwan down"  >> /tmp/interface.log
          uqmi -d /dev/cdc-wdm0 --get-current-settings >> /tmp/interface.log
          ifconfig wwan0 >> /tmp/interface.log
          ubus call network.interface.wwan down
          sleep 3
          echo "calling: ubus call network.interface.wwan up"  >> /tmp/interface.log
          uqmi -d /dev/cdc-wdm0 --get-current-settings >> /tmp/interface.log
          ubus call network.interface.wwan up
          ifconfig wwan0 >> /tmp/interface.log
     fi
fi

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing