networkmanager-1.10 VPN Error: "Could not find source connection" when network booting.

2017-12-08 Thread Donny Harrop
I network boot so the linux kernel sets up eth0.  In upgrading from nm
1.8.4 to 1.10 my VPN's broke with reason="Could not find source
connection."  Running 'nmcli connection' shows that eth0 is managed
under both 1.8.4 and 1.10.  I suspect this is a bug, but haven't found
anything in the mail archives or bugzilla.  Just wanted to bounce this
off the list for some insight before opening up a bug report.

- Donny
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: signal for (De)ActivateConnection?

2017-12-08 Thread Michael Hirmke
Hi,

[...]

>Hi,

>sounds a bit like you want to perform some action when a particular
>connection profile activates/deactivates.

jepp.

>First, you need to know which a connection profile you care about, that
>is, you need its /org/freedesktop/NetworkManager/Settings/* path.
>You need to call GetSettings() on each of the profiles, to match what
>you are looking for (for example, matching the connection.id).

Ok. I'd prefer a general approach, not one for a single machine only.
So I need some information about the type of connection this is.
In my actual script I check for the type of device (NM_DEVICE_TYPE_*)
combined with a few active checks into the network this device is
connected to, to decide what actions to take.

>When a connection is activated, it has an active-connection that
>references it. Usually there is at most one such active-connection,
>but while re-activating a connection there can be multiple once (one
>that is about to deactivate, and once that is about to activate).

Ok, I guess there are flags to check just like for devices? For that
purpose I check NM_DEVICE_STATE_* in the actual script.

>Anyway, you need to monitor these active connections for whether they
>reference the profile you care about. The Manager's PropertyChanged
>event for ActiveConnections notifies you when active-connection come to
>be and cease to exist.

Ok, this seems to be the important piece.
What exactly is the PropertyChanged Event *for ActiveConnection*?

>The ActiveConnection basically ties the profile to the networking
>device.

Ok.

>and as said, an active VPN connection is a bit odd, they are active-
>connections too (with an additional
>org.freedesktop.NetworkManager.VPN.Connection interface).


>I would inspect the state with the "d-feet" GUI.

Never came across this tool, but I'll check it - thx.


>You could also use libnm via GObject introspection (e.g. from Perl or
>Python). That might be more convenient to use, then a plain D-Bus
>library (the latter works of course too). We don't have any perl
>examples, only Python:
>https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/pyth
>on

Yeah, I saw them and adopted my actual script from them, but I couldn't
find a useful example for quering active connections - presumably cause
I looked for the wrong patterns.

>best,
>Thomas

Thx again.

Bye.
Michael.
-- 
Michael Hirmke
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Searching for documentation how to add an interface to a bridge via DBus API

2017-12-08 Thread thilo.ceston...@ts.fujitsu.com
Hi Thomas,

thanks for your answer. Works! :)

Cheers,
Thilo

Am Freitag, den 08.12.2017, 08:11 +0100 schrieb Thomas Haller:
> On Thu, 2017-12-07 at 15:55 +, thilo.ceston...@ts.fujitsu.com
> wrote:
> > Hi!
> > 
> > So I found the settings.connection interface and can delete a
> > existing
> > ethernet <=> bridge connection.
> > 
> > So adding a connection is probably what I want.
> > 
> > Is it sufficient to create a dict with e.g. "id"=>"eth0" and
> > "master"=>"br0" to
> > create a connection of the ethernet device eth0 to the bridge br0?
> > 
> > Or what settings do I need to serve?
> 
> Hi,
> 
> yes, you need to create a connection profile for each slave.
> 
> 
> You also need to activate it (or it might auto-activate when you create
> it -- and if you configured that).
> 
> check what you created with `nmcli connection show "$CON"`.
> 
> Maybe see examples:
> https://cgit.freedesktop.org/NetworkManager/NetworkM
> anager/tree/examples/python/dbus
> 
> 
> best,
> Thomas
> 
> > 
> > Cheers,
> > Thilo
> > 
> > Am Donnerstag, den 07.12.2017, 13:44 + schrieb
> > thilo.ceston...@ts.fujitsu.com:
> > > Hi all!
> > > 
> > > I'm trying to add an ethernet device to a bridge via DBus API. 
> > > 
> > > gdbus-codegen generated me three functions for a bridge device:
> > > 
> > > network_manager_device_bridge_get_slaves
> > > network_manager_device_bridge_dup_slaves
> > > network_manager_device_bridge_set_slaves
> > > 
> > > get_slaves and dup_slaves working well. But set_slaves don't, as
> > > the slave-
> > > property is readonly.
> > > 
> > > My question is, how can I add an interface to a bridge via DBus
> > > API. I could
> > > find an hint anywhere or I didn't understand it to an hint :).
> > > 
> > > Could someone point me please in the right direction?
> > > 
> > > Thanks!
> > > 
> > > Cheers,
> > > Thilo
> > > ___
> > > networkmanager-list mailing list
> > > networkmanager-list@gnome.org
> > > https://mail.gnome.org/mailman/listinfo/networkmanager-list
> > 
> > ___
> > networkmanager-list mailing list
> > networkmanager-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/networkmanager-list

smime.p7s
Description: S/MIME cryptographic signature
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list