Bug 174439 - VPN PPTP support
Summary: VPN PPTP support
Status: RESOLVED FIXED
Alias: None
Product: Network Management
Classification: Unmaintained
Component: Control Module (show other bugs)
Version: 0.7
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Will Stephenson
URL:
Keywords:
: 205079 234672 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-06 15:54 UTC by Daniel
Modified: 2011-07-19 13:25 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
main dialog for editing pptp-vpn connection (15.67 KB, application/xml)
2009-08-10 06:07 UTC, Pavel Andreev
Details
VPN connection options dialog (7.84 KB, application/xml)
2009-08-10 06:09 UTC, Pavel Andreev
Details
vpn routes settings dialog (3.48 KB, application/xml)
2009-08-10 06:09 UTC, Pavel Andreev
Details
Patch. Implementation of readConfig(), writeConfig(), readSecrets() functions. (7.05 KB, patch)
2009-08-13 16:52 UTC, Pavel Andreev
Details
screen shot with Log (121.85 KB, image/png)
2009-08-30 12:38 UTC, Pavel Andreev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2008-11-06 15:54:33 UTC
Version:           0.7 (using KDE 4.1.2)
OS:                Linux
Installed from:    Ubuntu Packages

For knetworkmanager 0.7 is no VPN over PPTP avialable. OpenVPN and VPNC are available.
Comment 1 Tilo Klausing 2009-02-04 21:33:02 UTC
*** This bug has been confirmed by popular vote. ***
Comment 2 Will Stephenson 2009-02-05 17:52:06 UTC
It's on the todo list...
Comment 3 gapon 2009-05-29 15:51:50 UTC
Any progress here, please? Thanks a lot.
Comment 4 Marcos Marado 2009-07-01 15:40:41 UTC
This is actually a regression comparing to knetworkmanager for KDE 3 (more details at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531577 ), so can you please the severity of this issue?

Best regards,
-- 
Marado
Comment 5 Daniel 2009-07-08 17:42:26 UTC
Not relevant for me any more, but it's the same issue with the plasma-widget.
Comment 6 Roberto Braga 2009-08-06 11:16:31 UTC
I was thinking to see the pptp support with 4.3 release, is there any hope to see it in 4.3.1? I see that is in the to-do list since february but which is the satus of the work?
Comment 7 Will Stephenson 2009-08-06 14:07:24 UTC
I'm not working on it and it's a low priority for me.

I will advise if anyone else wants to do it, it's just some basic UI programming.
Comment 8 Pavel Andreev 2009-08-10 03:15:40 UTC
I can help with UI (*. ui files), if it necessary. If you release simple programming part to bind UI with functional component.
Comment 9 Pavel Andreev 2009-08-10 06:07:36 UTC
Created attachment 36024 [details]
main dialog for editing pptp-vpn connection
Comment 10 Pavel Andreev 2009-08-10 06:09:13 UTC
Created attachment 36025 [details]
VPN connection options dialog

secondary dialog which calls on button Preferences in "VPN" tab
Comment 11 Pavel Andreev 2009-08-10 06:09:57 UTC
Created attachment 36026 [details]
vpn routes settings dialog

secondary dialog which allows to setup routing table
Comment 12 Pavel Andreev 2009-08-10 06:10:19 UTC
UI files in attachment.
Comment 13 Will Stephenson 2009-08-12 22:06:02 UTC
SVN commit 1010553 by wstephens:

Add skeleton PPTP plugin implementation using contributed UI files.

Now you need to implement the readConfig(), writeConfig() and
readSecrets() methods.  Use the other VPN plugins as a guide.

CCBUG: 174439



 M  +1 -0      CMakeLists.txt  
 A             pptp (directory)   vpnc#1010269
 M  +8 -8      pptp/CMakeLists.txt  
 A             pptp/networkmanagement_pptpui.desktop   vpnc/networkmanagement_vpncui.desktop#1010269
 D             pptp/networkmanagement_vpncui.desktop  
 A             pptp/nm-pptp-service.h   [License: GPL (v2+)]
 D             pptp/nm-vpnc-service.h  
 A             pptp/pptp.cpp   vpnc/vpnc.cpp#1010269 [License: GPL (v2/3)]
 A             pptp/pptp.h   vpnc/vpnc.h#1010269 [License: GPL (v2/3)]
 A             pptp/pptpadvanced.ui  
 A             pptp/pptpauth.ui   vpnc/vpncauth.ui#1010269
 A             pptp/pptpprop.ui   vpnc/vpncprop.ui#1010269
 A             pptp/pptpwidget.cpp   vpnc/vpncwidget.cpp#1010269 [License: GPL (v2/3)]
 A             pptp/pptpwidget.h   vpnc/vpncwidget.h#1010269 [License: GPL (v2/3)]
 D             pptp/vpnc.cpp  
 D             pptp/vpnc.h  
 D             pptp/vpncauth.ui  
 D             pptp/vpncprop.ui  
 D             pptp/vpncwidget.cpp  
 D             pptp/vpncwidget.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1010553
Comment 14 Will Stephenson 2009-08-12 22:06:53 UTC
BTW I tweaked the UI files to use the elements that I need. Some are already present elsewhere in NM and reused.
Comment 15 Pavel Andreev 2009-08-13 16:52:26 UTC
Created attachment 36134 [details]
Patch. Implementation of readConfig(), writeConfig(), readSecrets() functions.

I implement those 3 functions, but I'm not sure, that I correctly understood mechanism of MPPE switch. Please check it.
Look the code in comment block, by keyword "LOOK:" (case sensitive), cause I realy don't know, if option not used it necessary to store it with "no" value, or not?
Comment 16 Pavel Andreev 2009-08-13 16:55:01 UTC
Oops!
In this block:

// LOOK: I don't know if it needed.
/*    else
    {
        data.insert(NM_PPTP_KEY_LCP_ECHO_FAILURE, "5");
        data.insert(NM_PPTP_KEY_LCP_ECHO_INTERVAL, "30");
    }
*/

change 5 and 30 integers to 0 and 0.

P.S. Sorry for my English.
Comment 17 Will Stephenson 2009-08-13 21:27:20 UTC
SVN commit 1011013 by wstephens:

commit another excellent patch by Pavel Andreev <apavelm@gmail.com> for
PPTP support loading saving.

I had to adapt the way advanced widgets are referenced to go with what
was committed yesterday.

Also the LOOK blocks that were queried should be unnecessary, NM
generally accepts a missing key as the default value.

Does the plugin work now?  I will add the IPV4 settings page and
check the MPPE settings tomorrow.

CCBUG:174439



 M  +3 -0      pptpprop.ui  
 M  +159 -2    pptpwidget.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1011013
Comment 18 Pavel Andreev 2009-08-14 02:01:20 UTC
I suppose, that some UI modifications is necessary to do.
Such as, wnen cb_MPPE is set to "unchecked" other MPPE elements below must be unenabled and reseted to default value. And when it set to "checked" MPPE elements below should be enabled.

Also, I think, that LCP_ECHO parameters value must be more flexible, user should be change integer values, not only "true"/"false".

And if NM supports changing parameters MTU and MRU - make a way to make possible to change it.
Comment 19 Pavel Andreev 2009-08-14 03:19:16 UTC
Question: this plugin will be included only on KDE 4.4, or it also be included in KDE 4.3.* branch?
Comment 20 Will Stephenson 2009-08-14 10:01:41 UTC
KNetworkManager is not part of the KDE release cycle yet so it can be built with and shipped vs 4.3 already.

You should look at the source of the NetworkManager-pptp-gnome code to see if it sends MTU and MRU using the vpn settings or using a separate PPP settings group  (NetworkManager does define such a group, see libs/internals/settings/ppp.h but I don't know if PPTP has its own copies of MTU and MRU).
Comment 21 Pavel Andreev 2009-08-14 16:09:17 UTC
I haven't seen libs/internals/settings/ppp.h but I have seen NetworkManager-pptp-gnome. Their plugin doesn't support MTU or MRU change, but the pptp via pon/poff scripts does.

I supposed, that this plugin is assigned for plasma plugin network management, not for knetworkmanager, isn't it?
Comment 22 Will Stephenson 2009-08-14 19:28:42 UTC
It's assigned to Network Management which is shared between knetworkmanager (KDE4) and the plasmoid.
Comment 23 Pavel Andreev 2009-08-25 14:22:05 UTC
2 Will Stephenson: 
today I update my KDE (with PPTP support), but when I try to activate VPN connection - nothing happens. Absolutely nothing. Is it a bug of plasma-widget-networkmanagment or our plugin? Have you test this plugin, and what result you had?
Comment 24 Will Stephenson 2009-08-30 10:57:48 UTC
*** Bug 205079 has been marked as a duplicate of this bug. ***
Comment 25 Will Stephenson 2009-08-30 11:00:28 UTC
Pavel: No, I don't have access to a PPTP VPN to test this.

Can you attach the NetworkManager logs from when KNetworkManager is started up
with a PPTP vpn conneciton configured, and compare the connection with a
working one from nm-applet on DBUS as described here?

http://userbase.kde.org/NetworkManagement#It.27s_All_KDE.27s_Fault.21
Comment 26 Pavel Andreev 2009-08-30 12:38:52 UTC
Created attachment 36573 [details]
screen shot with Log

I connect to my local Wifi. And then try to connect to my PPTP VPN connection HDS or HDS2 (thats same).

Log:

Aug 30 21:29:04 irq-laptop NetworkManager: <info>  (eth1): writing resolv.conf to /sbin/resolvconf
Aug 30 21:29:14 irq-laptop NetworkManager: <info>  (eth1): device state change: 7 -> 8 (reason 0)
Aug 30 21:29:14 irq-laptop NetworkManager: <info>  (eth1): writing resolv.conf to /sbin/resolvconf
Aug 30 21:29:14 irq-laptop NetworkManager: <info>  Policy set 'IrQ-WiFi' (eth1) as default for routing and DNS.
Aug 30 21:29:14 irq-laptop NetworkManager: <info>  Activation (eth1) successful, device activated.
Aug 30 21:29:14 irq-laptop NetworkManager: <info>  Activation (eth1) Stage 5 of 5 (IP Configure Commit) complete.
Aug 30 21:29:21 irq-laptop ntpdate[3704]: no server suitable for synchronization found
Aug 30 21:29:38 irq-laptop wpa_supplicant[2914]: CTRL-EVENT-SCAN-RESULTS
Aug 30 21:30:18 irq-laptop wpa_supplicant[2914]: CTRL-EVENT-SCAN-RESULTS
Aug 30 21:31:18 irq-laptop wpa_supplicant[2914]: CTRL-EVENT-SCAN-RESULTS

After click on menuItem after some timeout (not on screenshot) next strings were added.

Aug 30 21:32:12 irq-laptop NetworkManager: <WARN>  wait_for_connection_expired(): Connection (2) /org/freedesktop/NetworkManagerSettings/15 failed to activate (timeout): (0) Connection was not provided by any settings service
Aug 30 21:32:34 irq-laptop NetworkManager: <WARN>  wait_for_connection_expired(): Connection (2) /org/freedesktop/NetworkManagerSettings/15 failed to activate (timeout): (0) Connection was not provided by any settings service
Aug 30 21:32:38 irq-laptop wpa_supplicant[2914]: CTRL-EVENT-SCAN-RESULTS
Comment 27 Pavel Andreev 2009-08-30 12:43:26 UTC
In thats log after creating new PPTP VPN connection:
Aug 30 21:41:15 irq-laptop NetworkManager: <WARN>  user_connection_get_settings_cb(): user_connection_get_settings_cb: Invalid connection: 'NMSettingVPN' / 'user-name' invalid: 1
Comment 28 Will Stephenson 2009-08-30 16:31:26 UTC
Ok, show me the connection with qdbus as explained at the link in comment #25 - i need to know what user-name contains (or not).   If you can compare with nm-applet so much the better.
Comment 29 Pavel Andreev 2009-08-31 12:32:34 UTC
Where I can look for it (DBUS log)?
username contains only latin symbols and digits.
Comment 30 Will Stephenson 2009-08-31 13:07:45 UTC
Like this (quoted from http://userbase.kde.org/NetworkManagement#It.27s_All_KDE.27s_Fault.21)
"
You should now try to figure out how the connection provided by Network Management differs from that provided by the other client. If you build Network Management from source you can use the tool 'qdbusfornm', which is a version of qdbus extended to handle NM's data types.

If you do not build from source, just replace ./qdbusfornm --system by qdbus --system --literal in the command shown below. It is a bit harder to read but should give you the same output.

If you use qdbus --system --literal, please take the time to format the output so there is one key per line, similar to the qdbusfornm output below. This is easy and just takes time, so it is better for you to do this than a developer.

The value 0 below identifies the connection. Change it if you have more than one until you find the relevant connection.

./qdbusfornm --system org.freedesktop.NetworkManagerUserSettings /org/freedesktop/NetworkManagerSettings/0 org.freedesktop.NetworkManagerSettings.Connection.GetSettings

returns here

a{sa{sv}}(==802-11-wireless==
band: bg
mode: infrastructure
security: 802-11-wireless-security
ssid: opensuse-guest
==802-11-wireless-security==
auth-alg: open
key-mgmt: wpa-psk
wep-tx-keyidx: 0
==connection==
autoconnect: true
id: openSUSE
type: 802-11-wireless
uuid: {951cc7d9-1fa0-4525-9ab7-7199849e1b19}
==ipv4==
dns-search:
method: auto
)

Now you should repeat using the other, working client and copy both sets of output, before attaching them securely to a bug report at bugs.kde.org. With this information we will quickly be able to implement a fix. 
"
Comment 31 Pavel Andreev 2009-08-31 14:30:37 UTC
I used qdbusviewer to view this settings.

When I try to call this method Error message box appered: "Unable to find method GetSettings on path /org/freedesktop/NetworkManagerSettings/1 in interface org.freedesktop.NetworkManagerSettings.Connection"
Comment 32 Pavel Andreev 2009-08-31 15:18:19 UTC
DONT READ PREVIOUS MESSAGE!

// For WiFi
qdbus --literal --system org.freedesktop.NetworkManagerUserSettings /org/freedesktop/NetworkManagerSettings/0 org.freedesktop.NetworkManagerSettings.Connection.GetSettings

[Argument: a{sa{sv}} {"802-11-wireless" = [Argument: a{sv} {
"mode" = [Variant(QString): "infrastructure"], 
"seen-bssids" = [Variant(QStringList): {"00:21:XX:XX:XX:XX"}], 
"ssid" = [Variant(QByteArray): {73, 114, 81, 45, 87, 105, 70, 105}]}], "connection" = [Argument: a{sv} {
"autoconnect" = [Variant(bool): false], 
"id" = [Variant(QString): "My-WiFi"], 
"timestamp" = [Variant(uint): 1251723964], 
"type" = [Variant(QString): "802-11-wireless"], 
"uuid" = [Variant(QString): "abccc8f1-1ef1-467d-b6db-641dcb878652"]}]}]

//For VPPN
qdbus --literal --system org.freedesktop.NetworkManagerUserSettings /org/freedesktop/NetworkManagerSettings/1 org.freedesktop.NetworkManagerSettings.Connection.GetSettings

[Argument: a{sa{sv}} {"connection" = [Argument: a{sv} {
"autoconnect" = [Variant(bool): false], 
"id" = [Variant(QString): "VPN connection name"], 
"type" = [Variant(QString): "vpn"], 
"uuid" = [Variant(QString): "3d749648-3a5f-4e4c-a9da-a180fea34369"]}], 
"vpn" = [Argument: a{sv} {"data" = [Variant: [Argument: a{ss} {
"domain" = "", 
"gateway" = "vpn.lan", 
"no-vj-comp" = "no", 
"nobsdcomp" = "yes", 
"nodeflate" = "yes", 
"refuse-chap" = "no", 
"refuse-eap" = "yes", 
"refuse-mschap" = "no", 
"refuse-mschapv2" = "no", 
"refuse-pap" = "yes", 
"user" = "pppmylogin"}]], 
"secrets" = [Variant: [Argument: a{ss} {}]], 
"service-type" = [Variant(QString): "org.freedesktop.NetworkManager.pptp"], "user-name" = [Variant(QString): ""]}]}]
Comment 33 Pavel Andreev 2009-08-31 15:22:50 UTC
DONT READ PREVIOUS MESSAGE!

// For WiFi
qdbus --literal --system org.freedesktop.NetworkManagerUserSettings /org/freedesktop/NetworkManagerSettings/0 org.freedesktop.NetworkManagerSettings.Connection.GetSettings

[Argument: a{sa{sv}} {"802-11-wireless" = [Argument: a{sv} {
"mode" = [Variant(QString): "infrastructure"], 
"seen-bssids" = [Variant(QStringList): {"00:21:XX:XX:XX:XX"}], 
"ssid" = [Variant(QByteArray): {73, 114, 81, 45, 87, 105, 70, 105}]}], "connection" = [Argument: a{sv} {
"autoconnect" = [Variant(bool): false], 
"id" = [Variant(QString): "My-WiFi"], 
"timestamp" = [Variant(uint): 1251723964], 
"type" = [Variant(QString): "802-11-wireless"], 
"uuid" = [Variant(QString): "abccc8f1-1ef1-467d-b6db-641dcb878652"]}]}]

//For VPPN
qdbus --literal --system org.freedesktop.NetworkManagerUserSettings /org/freedesktop/NetworkManagerSettings/1 org.freedesktop.NetworkManagerSettings.Connection.GetSettings

[Argument: a{sa{sv}} {"connection" = [Argument: a{sv} {
"autoconnect" = [Variant(bool): false], 
"id" = [Variant(QString): "VPN connection name"], 
"type" = [Variant(QString): "vpn"], 
"uuid" = [Variant(QString): "3d749648-3a5f-4e4c-a9da-a180fea34369"]}], 
"vpn" = [Argument: a{sv} {"data" = [Variant: [Argument: a{ss} {
"domain" = "", 
"gateway" = "vpn.lan", 
"no-vj-comp" = "no", 
"nobsdcomp" = "yes", 
"nodeflate" = "yes", 
"refuse-chap" = "no", 
"refuse-eap" = "yes", 
"refuse-mschap" = "no", 
"refuse-mschapv2" = "no", 
"refuse-pap" = "yes", 
"user" = "pppmylogin"}]], 
"secrets" = [Variant: [Argument: a{ss} {}]], 
"service-type" = [Variant(QString): "org.freedesktop.NetworkManager.pptp"], "user-name" = [Variant(QString): ""]}]}]
Comment 34 Pavel Andreev 2009-09-05 15:25:12 UTC
any variants, what the reason?
Comment 35 Pavel Andreev 2009-09-26 02:04:05 UTC
1)I tried same settings in gnome-NM-pptp and in KDE.
In kde dbus output:
"domain" = "",
"gateway" = "<vpn-gateway>",
"no-vj-comp" = "no",
"nobsdcomp" = "yes",
"nodeflate" = "yes",
"refuse-chap" = "no",
"refuse-eap" = "yes",
"refuse-mschap" = "no",
"refuse-mschapv2" = "no",
"refuse-pap" = "yes",
"user" = "<login>"

In gnome dbus output:
"refuse-eap" = "yes",
"refuse-pap" = "yes",
"nodeflate" = "yes",
"gateway" = "<vpn-gateway>",
"user" = "<login>",
"nobsdcomp" = "yes"

Settings are: only chap, mschap, mschapv2 and 'use tcp-headers compression'checked. In gnome it works, and in KDE doesn't.

2) By the way, I found second bug in KDE (our) applet.
First, ONLY "USE MPPE" checkbox checked with "ANY" combobox value, dbus output:
"require-mppe" = "yes",
"require-mppe-128" = "yes",
"require-mppe-40" = "yes"

Second, change combobox value to 128 bit:
"require-mppe-128" = "yes",
"require-mppe-40" = "yes"
As you can see mppe-40 is still turned on.
Comment 36 Will Stephenson 2009-09-27 17:15:20 UTC
SVN commit 1028542 by wstephens:

1) Fix missing break statements in switch causing all mppe options to be
sent
2) Don't send 'no' values for flags, just don't put them in the data
3) Simplify reading/writing of flags, use a single QString to compare to
4) Fix language used in the UI
5) Use a QGroupBox for MPPE dependent options so these are disabled when
MPPE is disabled
6) Use QAbstractButton::isChecked() instead of QCheckBox::checkState()
for better readability; checkState is only needed with tristate
checkboxes
7) Use buddies and accelerators for UI labels.

I recreated the PPTP connection Pavel describes in Comment #35 and it
now appears the same as the described nm-applet connection - let me know
if it works now.

CCBUG: 174439


 M  +81 -85    pptpadvanced.ui  
 M  +29 -6     pptpprop.ui  
 M  +61 -39    pptpwidget.cpp  
 M  +1 -0      pptpwidget.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1028542
Comment 37 Pavel Andreev 2009-10-04 11:49:52 UTC
it works!
Comment 38 Marcos Marado 2010-07-01 19:00:00 UTC
It seems to be working now, so I think you can mark this as closed.
Thanks.
Comment 39 a.horsfield 2010-07-09 09:48:11 UTC
Using kubuntu 10.04. Network manager crashes (segmentation fault) when I try to establish a vpn connection using pptp. Unable to install debug packages through bug reporting wizard.
Comment 40 a.horsfield 2010-07-12 08:31:49 UTC
(In reply to comment #39)
> Using kubuntu 10.04. Network manager crashes (segmentation fault) when I try to
> establish a vpn connection using pptp. Unable to install debug packages through
> bug reporting wizard.

Works with ethernet -- problem just with wireless connections.
Comment 41 Lamarque V. Souza 2011-03-19 00:40:13 UTC
*** Bug 234672 has been marked as a duplicate of this bug. ***
Comment 42 Lamarque V. Souza 2011-07-19 13:25:21 UTC
I will close this bug since it is about adding support to pptp, which already happened. If there is any problem with pptp support please open a new bug entry in bugs.kde.org.