Skip to content
www.mytechnote.ru
Menu
  • Administration
    • Scripts
  • Equipment
    • Reviews
    • Instructions
  • Other
  • English
    • English
    • Русский
Menu

How to Set Up a Simple PPTP VPN on Ubuntu 16.04: A Step-by-Step Guide

Looking for a beginner-friendly VPN setup for your Ubuntu system? You’re in the right place! Today, I’ll walk you through the easiest way to create a PPTP VPN server on Ubuntu 16.04. While PPTP might not be the most advanced option out there, its simplicity and wide compatibility make it a favorite for many.

What You’ll Learn:

  • Setting up PPTP on Ubuntu 16.04
  • Configuration essentials for a VPN server
  • Enabling users to access the internet securely

Step 1: Initialization

First things first, let’s get started by entering the superuser mode:

sudo su

Step 2: Installing PPTP

Execute the following commands to install the pptpd package:

apt-get update && apt-get upgrade
apt-get install pptpd

Step 3: Configuration Details

Now, let’s fine-tune our configurations:

  • PPTP Configuration

Edit with:

nano /etc/pptpd.conf

Ensure it reads:

option /etc/ppp/pptpd-options
logwtmp
#internal server address which will be seen by clients
localip 192.168.6.1
#clients address pool
remoteip 192.168.6.10-210
connections 100

  • Options Configuration

Edit the pptpd-options using:

nano /etc/ppp/pptpd-options

Update its content to:

name pptpd
refuse-pap
nobsdcomp
#turn on encryption
require-mschap-v2
require-mppe-128
ms-dns 8.8.8.8
ms-dns 8.8.4.4
proxyarp
novjccomp
nodefaultroute
lock
nobsdcomp
#you can enable radius connection, but it’s different story =)
#plugin radius.so
#plugin radattr.so
lcp-echo-failure 50
#you can change mtu values if required.
mtu 1400
mru 1400

  • Usernames & Passwords

Set up client usernames and passwords:

nano /etc/ppp/chap-secrets

For example:

# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
test1   pptpd   testtest        192.168.6.100

Step 4: Internet Access through VPN

Allow secure internet access for your users. Here’s how:

nano /etc/sysctl.conf

Add or uncomment the line:

net.ipv4.ip_forward=1

After this, perform masquerading from your VPN network to the internet. The method varies depending on which firewall you are using. I will demonstrate the process for bare iptables and for ufw.

In the first case, for pure iptables:

iptables -t nat -A POSTROUTING -s 192.168.6.0/24 -o eth0 -j MASQUERADE

Here, eth0 is your interface facing the internet, and 192.168.6.0 is the VPN network.

iptables-save > /etc/iptables.up.rules
nano /etc/network/interfaces

At the end of the file, add:

pre-up iptables-restore < /etc/iptables.up.rules

In the second case, for ufw:

nano /etc/default/ufw

Find the DEFAULT_FORWARD_POLICY and set it to ACCEPT:

DEFAULT_FORWARD_POLICY=”ACCEPT”

Next:

nano /etc/ufw/before.rules

In this file, right after the initial comments, add:

*nat
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 192.168.6.0/24 -o eth0 -j MASQUERADE
COMMIT

To apply the new rule, execute:

ufw disable && ufw enable

Step 5: Testing & Troubleshooting

Once set up, you can attempt to connect. Remember to enable encryption and use the mschapv2 protocol for successful connections. For insights into connection processes, check logs at /var/log/syslog.

If you want to kill all conections:

killall ppp

Setting up a simple PPTP VPN on Ubuntu 16.04 is straightforward. Follow our step-by-step guide and secure your connections today! If you found this guide helpful, consider sharing it with fellow Ubuntu enthusiasts.

Posted on 22.03.201730.05.2024 by sanglyb

Post navigation

← Setting Up RemoteApp on Windows Server 2012 without Active Directory Domain: A Step-by-Step Guide
Ultimate April Fools’ Computer Prank: Make Them Think It’s Broken →

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Подписывайтесь

Youtube
vk
telegram
github
twitter
rss
  • Форум
  • Об авторе
  • Поддержать автора

Популярные записи

Новые записи

  • How to Extend an LVM Partition in Linux
  • SCCM Reporting Errors After Migrating from SQL Server 2016 to 2019
  • Problem Using PassFiltEx on Older CPUs
  • How to remove attachments from old calendar events in Exchange using a script
  • How to download and install Office 2024 LTSC

Архивы

  • 2026 (3)
  • 2025 (5)
  • 2024 (7)
  • 2023 (30)
  • 2022 (4)
  • 2020 (17)
  • 2017 (82)
  • 2016 (5)
© 2015-2026 www.mytechnote.ru
Использование материалов сайта возможно только с разрешения владельца или обязательна индексируемая, прямая, передающая вес ссылка на материал.