Re: NetworkManager dispatchers



Okay so I was able to get MM 1.4.12 and NM 1.0.10 compiled and deployed on my unit, which I must admit wasn't easy. 0.9.4 was a lot easier, I had to do a whole lot of re-linking and stuff to get 1.0.10 set up and running. Good news is it is up and running!


I got my 3g up and running and it's all good. Now trying to get NM to start a PPP on it but I'm hitting the wall again.
I've read a lot of documents on setting up devices but none that go deep into setting up GSM and PPP, which is sad. Here is what I have done so far:

- with NMCLI: 
nmcli con add type gsm con-name ppp ifname ppp0 apn internet.com
Connection 'ppp' (af71d0c7-bbbd-4d4e-941e-a2581dc86a2e) successfully added.

root/usr/local/etc/NetworkManager/system-connections# nmcli con up ppp
Error: Connection activation failed: No suitable device found for this connection.

some useful outputs:
root/usr/local/etc/NetworkManager/system-connections# nmcli con
NAME   UUID                                  TYPE  DEVICE 
ppp    af71d0c7-bbbd-4d4e-941e-a2581dc86a2e  gsm   --     
radio  f6547503-d831-4cc2-bd3c-a958e645552a  gsm   --     
root/usr/local/etc/NetworkManager/system-connections# nmcli dev
DEVICE   TYPE      STATE         CONNECTION 
ttyUSB2  gsm       disconnected  --         
eth0     ethernet  unmanaged     --         
lo       loopback  unmanaged     --         
root/usr/local/etc/NetworkManager/system-connections# mmcli -L

Found 1 modems:
/org/freedesktop/ModemManager1/Modem/0 [Cinterion] PHS8-USA


I added another entry to the ppp connection and called it radio:
cat radio 
[connection]
id=radio
uuid=f6547503-d831-4cc2-bd3c-a958e645552a
type=gsm
#interface-name=ppp0
interface-name=wwan0
permissions=
secondaries=

[gsm]
apn=m2minternet.apn
number=*99#

[ipv4]
dns-search=
method=auto

[ipv6]
dns-search=
method=auto

[serial]
baud=115200


nmcli con up radio ifname ppp0
Error: device 'ppp0' not compatible with connection 'radio'.


Can someone tell me what I'm not doing right? I want to have my PPP0 interface come up everytime the radio is connected. When I do it manually through pppd call it works beautifully but I can't get it to work with NMCLI. Any ideas why not?


Thanks





On Tue, Mar 1, 2016 at 7:38 AM, Dan Williams <dcbw redhat com> wrote:
On Mon, 2016-02-29 at 17:40 -0800, Ali Nematollahi wrote:
> Thanks! I've looked at nmcli radio but there is no good documentation
> I
> could find for the version I am using. All of the documentation is
> for
> newer version and don't apply.

Yeah, you say later you're using NM 0.9.4, which is extremely old (23-
Mar-2012) and I'm not surprised some stuff would be different...

> First of all, when I do:
>
> nmcli nm wwan
> WWAN
> disabled
>
> Then I do:
>  nmcli nm wwan on
> nmcli nm wwan
> WWAN
> disabled
>
> nmcli nm status
> RUNNING         STATE           WIFI-HARDWARE   WIFI       WWAN-
> HARDWARE
> WWAN
> running         connected       enabled         enabled    enabled
> disabled

What's in /var/lib/NetworkManager/NetworkManager.state ?

Can you turn on NM log debugging (might be an nmcli command for that)
and see what NM prints out when you do "nmcli nm wwan on"?

Dan

> I was reading on google somewhere that I need a config file
> in: /etc/NetworkManager/system-connections/
> so I put one in:
>
> cat /etc/NetworkManager/system-connections/radio
> [connection]
> id=MyWwanConnection
> type=gsm
>
> [ipv4]
> method=auto
>
> [gsm]
> number=*99#
> apn=mnet.bell.ca.ioe
>
>
> restarted NM, did the same thing, no difference.
>
> Any documentation for 0.9.4.0 that I can use to figure this out? Can
> someone help me with setting up the radio connections? I'm having no
> luck.
>
> Thanks
>
>
>
> On Fri, Feb 26, 2016 at 2:22 PM, Dan Williams <dcbw redhat com>
> wrote:
>
> >
> > On Fri, 2016-02-26 at 10:50 -0800, Ali Nematollahi wrote:
> > >
> > > Thanks!
> > >
> > > How to I enable "service called NetworkManager-dispatcher or
> > > nm-dispatcher"? When I search for "dispatcher" in my filesystem
> > > only
> > > these
> > > come up:
> > > /etc/NetworkManager/dispatcher.d
> > > /etc/dbus-1/system.d/nm-dispatcher.conf
> > > /usr/share/dbus-1/system-
> > > services/org.freedesktop.nm_dispatcher.service
> > > /usr/lib/NetworkManager/nm-dispatcher.action
> > > /usr/sbin/usb_modeswitch_dispatcher
> > >
> > >
> > > Starting MM as a service makes perfect sense.
> > > The question is however, how do I find out when to say "enable"
> > > the
> > > modem,
> > > or to do a simple-connect? I was planning on using the
> > > dispatchers
> > > for all
> > > of that, to automate all of those. So basically:
> > NetworkManager will take care of that, if 'wwan' radios are
> > enabled.
> >  See 'nmcli radio'.  As long as 'nmcli radio' reports WWAN enabled,
> > and
> > as long as your machine has no airplane switch for WWAN (or if it
> > does
> > the switch enables the WWAN), NetworkManager will enable the modem
> > when
> > it is discovered by ModemManager and it will be available to
> > connect
> > with from NetworkManager.
> >
> > Recent versions of NetworkManager (1.0.8+) also have support for
> > WWAN
> > autoconnect, so I don't think you need a dispatcher script here at
> > all.
> >
> > >
> > > - MM starts
> > > - modem comes up, status -> Disabled
> > >    - dispatcher kicks in: status -> Enabled
> > > - dispatcher kicks in: simple-connect
> > Dispatcher scripts only trigger on connection up/down, so you don't
> > get
> > any events on modem status changes.  But that shouldn't matter,
> > since
> > NetworkManager can take care of all of the WWAN connection stuff as
> > long as ModemManager is up and running (like if its run as a system
> > service).
> >
> > Dan
> >
> > >
> > > Thanks!
> > >
> > >
> > > On Fri, Feb 26, 2016 at 12:36 AM, Thomas Haller <thaller redhat c
> > > om>
> > > wrote:
> > >
> > > >
> > > > On Thu, 2016-02-25 at 17:16 -0800, Ali Nematollahi wrote:
> > > > >
> > > > > Hi guys
> > > > >
> > > > > I'm trying to experiment with NM dispatchers but I can't seem
> > > > > to
> > > > > get
> > > > > anything done. I have a very basic script
> > > > > in /etc/NetworkManager/dispatcher.d/02test:
> > > > >
> > > > > #!/bin/sh -e
> > > > >
> > > > > echo "Starting ModemManager"
> > > > > ModemManager --debug &
> > > > >
> > > > > But it is not running. I have made sure the scripts and
> > > > > directories
> > > > > are executable (a+x). But I cannot seem to get the scripts to
> > > > > run.
> > > > >
> > > > > Can someone help me with this please?
> > > > > NetworkManager --version
> > > > > 0.9.4.0
> > > > You probably also need to enable a service called
> > > > NetworkManager-
> > > > dispatcher or nm-dispatcher.
> > > >
> > > >
> > > > >
> > > > > Question 2: I wanted to use the dispatcher script to start
> > > > > ModemManager on startup and to enable the 3G modem I have.
> > > > > Can it
> > > > > be
> > > > > done? I have seen examples of how to start a connection when
> > > > > an
> > > > > interface comes up but nothing that could help me with this.
> > > > It looks very wrong to start ModemManager from a dispatcher
> > > > script.
> > > > Those scripts are invoked often and at various times, you don't
> > > > want to
> > > > start ModemManager every time something happens with a
> > > > networking
> > > > interface.
> > > >
> > > > Instead, start ModemManager as a regular system service, just
> > > > like
> > > > NetworkManager.
> > > >
> > > >
> > > > Thomas
> > > >
> > > _______________________________________________
> > > networkmanager-list mailing list
> > > networkmanager-list gnome org
> > > https://mail.gnome.org/mailman/listinfo/networkmanager-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]