Telenet Cloud Online Help

Establish VPN connection on linux (command line)

To establish a VPN connection on linux through command line you first need to install pptp-linux.

You can do this as follows:

apt-get install pptp-linux

After pptp-linux is installed on the system you can add the user credentials of the vpn connection in the file /etc/ppp/chap-secrets

vim /etc/ppp/chap-secrets

This file should look as follows:

# Secrets for authentication using CHAP
# client server secret IP addresses
username PPTP password *

* Replace "username PPTP password" with your own credentials. You can enter more credentials.

Then create a new file in the folder /etc/ppp/peers/

vim /etc/ppp/peers/vpn10-user

This file should look as follows:


pty "pptp --nolaunchpppd"

name <loginname>

remotename PPTP


file /etc/ppp/options.pptp

ipparam <name_of_script_under_etc_ppp_peers_...>


Once the file is created, you can start the VPN connection

pon vpn10-user

If you now execute the command ’ip a’, you will notice that the VPN connection is active

root@User-Ubuntu12:~# ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:15:c5:bc:ba:31 brd ff:ff:ff:ff:ff:ff
inet brd scope global eth0
inet6 fe80::215:c5ff:febc:ba31/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 00:18:de:a4:c5:b3 brd ff:ff:ff:ff:ff:ff
9: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1496 qdisc pfifo_fast state UNKNOWN qlen 3
inet peer scope global ppp0

If you would like to stop the VPN connection, you can execute the following command

poff vpn10-user

3.2 (5)
Article Rating (5 Votes)
Rate this article
There are no attachments for this article.
Related Articles
Can I run ASP.NET on a Linux Dedicated Server?
Viewed 2161 times since Fri, Nov 28, 2008
How do I connect to my Linux server?
Viewed 3206 times since Fri, Sep 18, 2009
Which Linux distributions can be installed on a dedicated server?
Viewed 2945 times since Wed, Aug 19, 2009