Setting IP-addresses without NetworkManager?

Dan Williams dcbw at redhat.com
Fri Sep 8 18:13:55 UTC 2017


On Fri, 2017-09-08 at 20:55 +0300, Ossi Ahosalmi wrote:
> Hi,
> 
> This didn't answer my question. Is it possible to have ModemManager
> or
> mbim-tool to configure IP settings, so I don't have to manually set
> them
> or use my own scripts?

Ah, sorry.  No, it's not possible; MM just configures the modem, it
does not touch any IP/DNS/routing since that is best left to other
tools and every Linux distro does something different
here.  Additionally tools that do these things often have to coordinate
with other tools for shared resources (like the default route and
/etc/resolv.conf).

> Running mbimcli -d /dev/cdc-wdm0 --set-radio-state=on returns:
> 
> error: operation failed: Failure.

That likely means that your platform has built-in airplane mode
capability, or it's doing something odd with the W_DISABLE pin of the
mincard slot.

What do you get for "rfkill list"?

Dan

> 
> On 8.9.2017 19:22, Dan Williams wrote:
> > On Fri, 2017-09-08 at 18:13 +0300, Ossi wrote:
> > > Hi,
> > > 
> > > I run a very minimal Gentoo installation on the latest X1 Carbon
> > > with
> > > EM7455 modem. I do all the networking related config with netifrc
> > > scripts. I can initialize the modem using ModemManager, running
> > > 'mmcli
> > > -m 0 --simple-connect="apn=internet"' and grabbing the IP-
> > > information
> > > from 'mmcli -b 0'. This is a lot of manual work, so I've scripted
> > > it.
> > > I'm just wondering if it's possible to set address, gateway and
> > > nameservers automatically without NetworkManager? Running dhcpcd
> > > on
> > > the
> > > modem interface does not do anything.
>> > MBIM devices generally do not support DHCP on the net port, you
> > have to
> > get the IP configuration through MBIM.
>> > Yes, you can take that information and apply it to the net port
> > manually, and write the DNS info to /etc/resolv.conf manually too. 
> > This should work; you don't need NM to do that.
>> > But it looks like the modem is not powered up, or is in airplane
> > mode. 
> > Try:
>> > mbimcli -d /dev/cdc-wdm0 --set-radio-state=on
>> > before running mbim-network and see if that fixes things.  If it
> > doesn't, and you still get the RadioPowerOff, your platform may
> > have
> > hardware rfkill/airplane mode functionality that you need to figure
> > out
> > how to turn off first.
>> > Dan
>> > > I also noticed that 'mbim-network /dev/cdc-wdm0 start' does not
> > > work
> > > at
> > > all. Could you give a hint of what's wrong with my setup:
> > > 
> > > Loading profile at /etc/mbim-network.conf...
> > >     APN: internet
> > >     APN auth protocol: unset
> > >     APN user: unset
> > >     APN password: unset
> > >     mbim-proxy: no
> > > Querying subscriber ready status 'mbimcli -d /dev/cdc-wdm0
> > > --query-subscriber-ready-status --no-close '...
> > > [/dev/cdc-wdm0] Subscriber ready status retrieved: Ready state:
> > > 'initialized' Subscriber ID: '244052162157311' SIM ICCID:
> > > '89358021150507165706' Ready info: 'unknown' Telephone numbers:
> > > (0)
> > > 'unknown' [/dev/cdc-wdm0] Session not closed: TRID: '3'
> > > Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 3)
> > > Querying registration state 'mbimcli -d /dev/cdc-wdm0
> > > --query-registration-state --no-open=3 --no-close '...
> > > [/dev/cdc-wdm0] Registration status: Network error: 'unknown'
> > > Register
> > > state: 'deregistered' Register mode: 'automatic' Available data
> > > classes:
> > > 'unknown' Current cellular class: 'gsm' Provider ID: 'unknown'
> > > Provider
> > > name: 'unknown' Roaming text: 'unknown' Registration flags:
> > > 'packet-service-automatic-attach' [/dev/cdc-wdm0] Session not
> > > closed:
> > > TRID: '4'
> > > Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 4)
> > > Attaching to packet service with 'mbimcli -d /dev/cdc-wdm0
> > > --attach-packet-service --no-open=4 --no-close '...
> > > error: operation failed: RadioPowerOff
> > > Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 5)
> > > Starting network with 'mbimcli -d /dev/cdc-wdm0 --
> > > connect=apn='internet'
> > > --no-open=5 --no-close '...
> > > error: operation failed: RadioPowerOff
> > > Network start failed
> > > [/dev/cdc-wdm0] Session not closed: TRID: '6'
> > > Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 6)
> > > 
> > > 
> > > _______________________________________________
> > > ModemManager-devel mailing list
> > > ModemManager-devel at lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
> 
> 


More information about the ModemManager-devel mailing list