Re: How can I obtain DHCP4Config, IP4Config of an active VPN connection?



-----Original Message-----
From: dcbw redhat com
Sent: Fri, 26 Apr 2013 12:56:05 -0500
To: psimerda redhat com
Subject: Re: How can I obtain DHCP4Config, IP4Config of an active VPN
connection?

On Fri, 2013-04-26 at 13:22 -0400, Pavel Simerda wrote:
----- Original Message -----
From: "Chris Nogen" <chrisnog inbox com>
To: networkmanager-list gnome org
Sent: Friday, April 26, 2013 5:44:07 PM
Subject: How can I obtain DHCP4Config, IP4Config of an active VPN
connection?

Hi everyone,

I'm currently working with NetworkManager and python in order to
connect to
my network company with a VPN.
The python script performs just simple actions like connect VPN through
my
wired interface and then automatically configure my code to reach
company
servers.

Everything worked properly until I wanted to grab DHCP4Config return by
the
VPN server. Indeed, with a simple connection the way to track this
information is to get the device and then ask for those parameters.
Workflow:
1. [org.freedesktop.NetworkManager.Connection.Active] => [Properties]
=>
[Devices]
2. [org.freedesktop.NetworkManager.Device] => [Properties] =>
[DHCP4Config,
IP4Config, ...]

But with a VPN connection, you cannot track the device because Network
Manager didn't add "tun" or "tap" device to the devices list.

Looks like a missing API. I think it warrants a bug report at
http://bugzilla.gnome.org/, where the possible solutions/additions
should be discussed. Thank you for bringing this up as this may help us
with the upcoming architectural changes.

Yes, it is missing API, and a bug for it would be good.

Dan

Hi,

First of all, thank you for your responses. 
I have been busy for few days but I'm looking forward to write the bug report.

Meanwhile, for those who are interested, I found a way to grab this information. 
Just after calling NetworkManager.ActivateConnection method, you must register to VPN.Plugin.Ip4Config 
signal. You will get an array with the properties I wanted. 
It's a bit tricky, but it works. 
To connect to this signal you should use these configurations: 
* Service: org.freedesktop.NetworkManager.PluginName which pluginname is the plugin you use. For example, 
with openvpn: org.freedesktop.NetworkManager.openvpn. I don't know why it's not possible to use directly 
org.freedesktop.NetworkManager
* Object path: /org/freedesktop/NetworkManager/VPN/Plugin
* Interface: org.freedesktop.NetworkManager.VPN.Plugin

My solution means one things, NetworkManager currently store information however there is no way to looking 
for it.

Thanks for your help,
Chris

____________________________________________________________
FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
Check it out at http://www.inbox.com/earth




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