Problem with QMI Cellular and the DHCP client

Hi,
When I'm rebooting the modem, the DHCP client protocol can't get the IP in first run and I have to restart the service to work it functionally again.
I can't find the delay option for this problem.



system log:

Fri Nov 25 16:59:15 2022 daemon.notice netifd: 4G_4 (1996): udhcpc: received SIGTERM
Fri Nov 25 16:59:15 2022 daemon.notice netifd: 4G_4 (1996): udhcpc: unicasting a release of 31.59.xx.xx to 31.59.xx.xx
Fri Nov 25 16:59:15 2022 daemon.notice netifd: 4G_4 (1996): udhcpc: sending release
Fri Nov 25 16:59:15 2022 daemon.notice netifd: 4G_4 (1996): udhcpc: entering released state
Fri Nov 25 16:59:15 2022 daemon.notice netifd: 4G_4 (1996): Command failed: ubus call network.interface notify_proto { "action": 0, "link-up": false, "keep": false, "interface": "4G_4" } (Permission denied)
Fri Nov 25 16:59:15 2022 daemon.notice netifd: Interface '4G_4' is now down
Fri Nov 25 16:59:15 2022 daemon.warn dnsmasq[1]: no servers found in /tmp/resolv.conf.d/resolv.conf.auto, will retry
Fri Nov 25 16:59:15 2022 daemon.notice netifd: Interface '4G_4' has link connectivity loss
Fri Nov 25 16:59:17 2022 user.notice firewall: Reloading firewall due to ifup of 4G (wwan0)
Fri Nov 25 16:59:23 2022 user.info : luci: accepted login on / for root from 192.168.1.50
Fri Nov 25 17:04:09 2022 daemon.notice netifd: Interface '4G_4' is enabled
Fri Nov 25 17:04:09 2022 daemon.notice netifd: Interface '4G_4' has link connectivity
Fri Nov 25 17:04:09 2022 daemon.notice netifd: Interface '4G_4' is setting up now
Fri Nov 25 17:04:10 2022 daemon.notice netifd: Interface '4G_4' is now down
Fri Nov 25 17:04:10 2022 daemon.notice netifd: Interface '4G_4' is setting up now
Fri Nov 25 17:04:10 2022 daemon.notice netifd: 4G_4 (3695): udhcpc: started, v1.35.0
Fri Nov 25 17:04:10 2022 daemon.notice netifd: 4G_4 (3695): udhcpc: broadcasting discover
Fri Nov 25 17:04:10 2022 daemon.notice netifd: 4G_4 (3695): udhcpc: broadcasting select for 31.59.xx.xx, server 31.59.xx.xx
Fri Nov 25 17:04:10 2022 daemon.notice netifd: 4G_4 (3695): udhcpc: lease of 31.59.xx.xx obtained from 31.59.xx.xx, lease time 7200
Fri Nov 25 17:04:10 2022 daemon.notice netifd: Interface '4G_4' is now up

after restarting the service

add a sleep 30 to rc.local, and restart the service (or interface), afterwards.

Thanks, I tried this command but didn't work. I think it's a bug

which "this" ?

it's not, probably a race condition ...

03

After rebooting the modem the DHCP client getting the IP but it can't set the proper iptables and route things and after restarting the DHCP client service, it's starting to work.

1 Like

You were supposed to add the restart to the rc.local too.

04

Thanks I added some code, and now it's working but it would be better to have an option to add delay in the luci interface and not in rc.local file.

thanks again.

Hi

Have you tried to turn off the DHCP in the modem?

uci set network.4G.dhcp=0
uci commit network

It's disabled by default

But, how did it worked with DHCP disabled?

I mean the DHCP server by default is disabled and for qmi cellular protocol there is no DHCP client option for getting automatic IP, so I used another interface called DHCP client and attached it to the qmi interface for getting the IP, but there is no delay option to wait the DHCP client interface boot up after the qmi interface, so I used the rc.local.

You should just configure the interface with Protocol: QMI Cellular, not adding any DHCP client. The QMI protocol will add the DHCP client if the LTE modem support DHCP. If the LTE modem does not support DHCP you need to set:

uci set network.4G.dhcp=0
uci commit network

I tried your code and my 4G interface got the IP, Gateway and the DNS server IP's, but now I encountered another problem. I can't ping the internet or resolving the DNS name but after adding the DHCP client everything working properly.

So my last config was:

adding the QMI Cellular and adding your commands:

uci set network.4G.dhcp=0
uci commit network

Adding another DHCP Client and referring it to QMI Cellular.

Strange that you 4G interface is not working without adding a DHCP client.
Did you assign correct firewall zone to you 4G interface (Protocol: QMI Cellular)?