I can use either PPTP or L2TP. All the tutorials I find require a GUI to setup the connections. However, I want to connect from a virtual server to which I have only SSH access. Any hints?
I can use either PPTP or L2TP. All the tutorials I find require a GUI to setup the connections. However, I want to connect from a virtual server to which I have only SSH access. Any hints?
To use PPTP, you need to do the following:
First, install the
pptp-linux
,pppd
,ppp
packages. Then, create a file in/etc/ppp/peers/
. The file name is irrelevant, but this name will be used to switch on the PPTP tunnel, so name it something meaningful. The file (the "peer file") should contain this:Replace the
server_ip_address
and theyour_login_name
with the appropriate values. Theidentifier
will be used for supplying a password (see below). Theipparam_id
is used by the scripts in/etc/ppp/ip-up.d/
. It is needed if you want to do something with the tunnel interface (adding routes, maybe -- see below).You need to supply your password. The password is stored in a plaintext file (which sucks, be sure to chown the file to 0600). The file is
/etc/ppp/chap-secrets
, anbd it should contain a line like this:The first two parameters is from the peer file.
If you want to do something when the PPTP tunnel starts and/or stops, you need to add scripts to the
/etc/ppp/ip-up.d/
and the/etc/ppp/ip-down.d/
directories. Every script in these directories will be run upon (de)activating a ppp tunnel. The following global variables exported for the scripts (there are others, but these are the most useful):PPPD_PID
: The PID of the pppd processPPP_IFACE
: The interface in questionPPP_IPPARAM
: The ipparam_id, which is given in the peer filePPP_LOCAL
: The local IP address assigned to the ppp interfacePPP_REMOTE
: The remote IP address assigned to the ppp interfaceAfter all this, you can use the
to start the PPTP tunnel, and the
to stop it.
This is a good site: http://pptpclient.sourceforge.net
Usually, we can setup PPTP VPN connection using "pptpsetup" command
Start the VPN connection
If something is wrong, here is the debug command
On ubuntu, I think the package you need is pptp-linux, you can install it by the command: