VPN setup in Ubuntu – General introduction

VPN (Virtual Private Network) lets you establish a secure connection over the non-secure Internet, e.g. from a notebook to an office server.

Getting a VPN to work requires general knowledge on networks, and it may require some specific knowledge on routers, firewalls and VPN protocols.

In order to use VPN on Ubuntu, you need to make sure that support for the required VPN protocol is installed. Several VPN protocols exist:

PPTP (Microsoft VPN)

sudo apt-get install network-manager-pptp

Cisco VPN

sudo apt-get install network-manager-vpnc

OpenVPN

sudo apt-get install network-manager-openvpn

IPSec VPN

Not covered on this page, so far

Usage

VPN setup in Kubuntu Feisty (7.04)

You have to install the additional package

network-manager-gnome

Please refer to WifiDocs/NetworkManager under VPN support for more information.

VPN setup using the command line

Run the following:

sudo apt-get install pptp-linux

Create file /etc/ppp/peers/YOUR_COMPANY with this content:

pty "pptp YOUR_VPN_GATEWAY --nolaunchpppd"
debug
nodetach
logfd 2
noproxyarp
ipparam YOUR_COMPANY
remotename YOUR_COMPANY
name YOUR_DOMAIN_OR_SERVER_NAME\\YOUR_VPN_LOGIN
require-mppe-128
nobsdcomp
nodeflate
lock
noauth
refuse-eap
refuse-chap
refuse-mschap

Add to /etc/ppp/chap-secrets:

YOUR_DOMAIN_OR_SERVER_NAME\\YOUR_VPN_LOGIN * YOUR_VPN_PASSWORD *

Create file /etc/ppp/ip-up.d/add-subnet with content similar to:

 #!/bin/bash
[ "$PPP_IPPARAM" = "YOUR_COMPANY" ] || exit 0
route add -net 192.168.100.0/24 dev $PPP_IFACE

In the above line, adjust subnet values (192.168.100.0/24) if needed

Then run:

sudo chmod a+x /etc/ppp/ip-up.d/add-subnet

- Connect to VPN: sudo pon YOUR_COMPANY To disconnect, press Ctrl+C or close the terminal.

- If you do not want to see VPN connection debug output, in file /etc/ppp/peers/YOUR_COMPANY delete 3 lines: debug nodetach logfd 2

In this case, “pon YOUR_COMPANY” will run as a background process. Use “poff YOUR_COMPANY” to disconnect.

VPN setup in Ubuntu 8.10

I stole these instructions written by mgmiller from http://ubuntuforums.org/showpost.php?p=7089396&postcount=196. This is for connecting to a Microsoft VPN.

VPN setup in Ubuntu 9.04

I could not get any VPN working on 9.04. There appears to be some bugs in the configuration tools, you may be able to get things to work via the command line.

VPN setup in Ubuntu 9.10

The following instructions were originally written by sweisler at http://ubuntuforums.org/showpost.php?p=8261958&postcount=6. They have been additionally tested for PPTP to an MS VPN:

VPN setup in Ubuntu 10.04

Ubuntu 10.04 comes preinstalled with VPN support.

This features is available under the networks connections tab.

VPN (last edited 2015-05-21 10:52:58 by gwlabcg)