Make EC25 available to the host system via IP

I have EC25 modem and want it to connect to the host system so that it receives a (local) IP address and I could run an application like a web server on the embedded linux system and access it from the host (Windows PC in my case).
On the host system there’s a mobile broadband interface announced that provides internet access through the modem but as an mbn interface it does not have its own IP address.

Bonus question, is it possible for the modem to get internet access via the host system (not the cellular network)?

I think I made a little progress regarding this. I recomposed the modem to the ECM mode using at+qcfg="usbnet",1 (then searched a bit for the ECM windows driver and then manually updated the hardware in windows device manager since everything was recognized as serial ports).
Now there’s a pseudo-ethernet connection in windows (ncpa.cpl) and I can ping the modem and view a webserver running on it. However the issue I face now is that once this connection is up, it is used as default connection in windows (likely the modem pushes a default route) and hence internet access is via the cellular network, which is not the behaviour I want. I want to continue using my cable connection while being able to access services ran on the modem. So the question now is how to avoid the ECM connection becoming the default.
Another issue I noticed is that the modem would get recomposed into usbnet=0 mode on reboot (still not sure if it happens all the time or randomly). Is there a way to make this permanent?

In ps I noticed the following:

dnsmasq -i bridge0 -I lo -z --dhcp-range=bridge0,192.168.225.20,192.168.225.30,255.255.255.0,43200 --dhcp-option-force=6,192.168.225.1 --dhcp-option-force=120,abcd.com

Which I believe is the process responsible for network configuration. But I am struggling to find from which script or config this line comes.

Dear @Curious_User ,

Thank you for reaching out.

ECM is the correct approach. After setting AT+QCFG=“usbnet”,1 and rebooting, the module will present a USB Ethernet interface and assign the PC a local IP (typically 192.168.225.x), allowing you to access services on the module (e.g., 192.168.225.1) while keeping it as a local management link.

To prevent Windows from selecting the ECM link as the default internet route, increase the Interface Metric on the ECM adapter (disable “Automatic metric” and set a higher value), or configure the ECM adapter with a static IP but no Default Gateway. This keeps your wired connection as the default for internet while the 192.168.225.0/24 path remains reachable.

AT+QCFG=“usbnet” is an NV-saved setting. Apply it once, reboot with AT+CFUN=1,1, and confirm with AT+QCFG=“usbnet”. If it reverts, it is usually due to a factory reset or host-side tools/firmware behavior changing the USB profile.

The dnsmasq command you observed is started by the module’s internal ECM networking service (module-side), not from a Windows script. For the modem to obtain internet via the host instead of cellular, it is not provided as a simple AT configuration on Windows; it requires host-side network sharing/routing setup rather than a modem-side AT switch.

Best Regards,
Aghelan