6

Under "System" > "Preferences" > "Network Connections" I can create PPTP VPNs. This works when I am at a GUI, I can click the network connections icon in the top right, and select a VPN from the list and connect to it.

Is it possible to connect to these PPTP sessions via the terminal if I only have SSH access, using these predefined sessions, so I don't have to type all the details in again?

Baldrick
  • 635
  • 5
  • 12
  • 20

3 Answers3

4

So it turns out this is a duplicate of another question which I couldn't previously find;

Connect/disconnect from VPN from the command line

I would like to add though, to install nmcli on my 10.04 machine I had to;

sudo add-apt-repository ppa:network-manager/trunk  
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install network-manager
Baldrick
  • 635
  • 5
  • 12
  • 20
2

try to configure pppd, this is an example. i believe you understand that your configuration file can differ.

0

use the 'pppd' to accomplish it:

sudo pppd nodetach defaultroute replacedefaultroute persist password mypassword file myvpn

replace "mypassword" with your pptp account's password. the "myvpn" is a config file, format as:

linkname myvpn 
ipparam myvpn 
pty "pptp server_address --nolaunchpppd " 
name myaccount 
usepeerdns 
require-mppe 
refuse-eap noauth

# adopt defaults from the pptp-linux package 
file /etc/ppp/options.pptp

this config file format is mentioned in here:https://help.ubuntu.com/community/VPNClient

And, "nodetach", or "defaultroute" are options for pppd, been described here:http://manpages.ubuntu.com/manpages/hardy/man8/pppd.8.html

I have use this method in java to setup a pptp client vpn connection, yes, it works.

The pid file, is in /var/run/ppp-xxx.pid, the "xxx" is your linkname that in your config file. You can read the pid of pppd from this pid file send a signal to the pppd, e.g "sudo kill -s SIGTERM pid_of_pppd", to shutdown the pppd.