Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Connect to a PPTP VPN Server from Linux Terminal

By editor , 13 June, 2018
Question

How to connect to a PPTP VPN Server from Debian (Ubuntu, Linux Mint ...) using linux terminal.

Step 1 : Install pptp client.

sudo apt-get -y install pptp-linux


Step 2 : Setup PPTP Client

Add secret:

File : /etc/ppp/chap-secrets
You can use:
sudo nano /etc/ppp/chap-secrets

Syntax :
<username> <server_name> <password> <ip_address>

Example :
# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
yourname         myvpn YourPassword             *

Step 3 : Create VPN connection:

Example for myvpn
sudo nano /etc/ppp/peers/myvpn

Example:
pty "pptp IP-OR-HOST-NAME --nolaunchpppd"
name yourname
remotename myvpn
require-mppe-128
file /etc/ppp/options.pptp
ipparam myvpn


Step 4 : Create a route script that will get run after the PPP connection establishes.

Create file :
sudo nano /etc/ppp/ip-up.d/99vpnroute
Then add:

#!/bin/bash
if [ "$PPP_IPPARAM" == "myvpn" ]; then
        route add -net 192.168.20.0/24 dev $PPP_IFACE
fi


Then Make the vpn route script executable:

sudo chmod +x /etc/ppp/ip-up.d/99vpnroute

 

Connecting to the PPTP VPN Server

To connect to the remote PPTP VPN server, issue the following command:

sudo pon myvpn
#or
sudo pppd call myvpn


Disconnecting from the PPTP VPN Server

The simplest way to disconnect from the PPP connection is to use the following command:

sudo poff myvpn
#To kill all active PPP connections, you can use the following:
sudo killall pppd
or
sudo kill `cat /var/run/ppp0.pid`


Log:

If the ppp connection doesn’t get established, check the /var/log/FILE log file for errors:

sudo tail -f /var/log/syslog
sudo tail -f /var/log/lastlog
sudo tail -n 25 /var/log/THE_LOG_FILE

 

 

Tags

  • Linux
  • Services
  • Add new comment
Setup PPTP VPN Server on Debian/Ubuntu Linux

Comments1

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Karyl A. Reeves (not verified)

8 years 3 months ago

Connect to a PPTP VPN Server from Linux Terminal

Thank you so much for sharing this Insightful Drupal. It's a pleasure for me to read your article. Keep spreading information. Since I am a writer I really Impressed with this information. If you want writing service, please contact   Custom dissertation  online one of the best writing service available. The better service that provides detailed and effective information with excellent writing skills related to educational basis.

  • Reply

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer