from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites: www.linuxhowtos.org
toolsntoys.linuxhowtos.org



Last additions:
How to make X listen on port 6000

How to make X listen on port 6000

words:

34

views:

88773

userrating:

average rating: 1.2 (52 votes) (1=very good 6=terrible)


May, 25th 2007:
April, 26th 2007:
Apr, 10th. 2007:
Druckversion . pdf icon
You are here: Tutorials per portage category->net-misc->openvpn

OpenVPN primer


There are as many advantages to VPN tunnels as there are different VPN scenarios. One easy implementation is the "OpenVPN via tun-device" solution. An example: you'd like to connect your laptop to your LAN at home so that you can use your mail client without reconfiguring it anytime you switch from home to internet and back. Let's say your mail-server is 192.168.1.10 in your LAN (192.168.1.0/24) at home, and you have got a router/firewall providing access to the Internet. You connect from work or school and want to read mail. OpenVPN can create two virtual devices for you when connecting two computers through an encrypted tunnel. Naturally you then have the possibility of forwarding traffic into the networks behind them, and thus would be "virtually connected" to your LAN behind the firewall. To enable this, either your firewall or a server behind it should run OpenVPN (if you choose a server in your LAN, you'll have to forward the destination port to the OpenVPN server).

Here's what you need to do:
Code Listing 1: Enable the tun module in your kernel: Kernel config - tun module
          [*] Networking support    
Networking options --->
[ ] Amateur Radio support --->
< > IrDA (infrared) subsystem support --->
< > Bluetooth subsystem support --->
[*] Network device support
< > Dummy net driver support
< > Bonding driver support
< > EQL (serial line load balancing) support
Universal TUN/TAP device driver support
// This option must be enabled


Make sure this module exists and can be loaded. Next, install OpenVPN and it dependencies.
Code Listing 2: Install OpenVPN
emerge openvpn

Now on both server and client, create a directory for your configuration:

Code Listing 3: Make directory
mkdir /etc/openvpn    
mkdir /etc/openvpn/myhomelan


Inside that directory, create a shared key for your VPN session and copy that key to the client's directory, /etc/openvpn/myhomelan.

Code Listing 4: Generate shared key
cd /etc/openvpn/myhomelan    
openvpn --genkey --secret myhomelan-key.txt


Now for the tricky part, the routing. It is important that the two tun devices on the client and server use IP addresses from the same subnet. The configuration files shown below list the type of device, the two end-points of the tunnel, the compression method and the UDP-port on which the tunnel is established. Finally privileges are dropped to user and group as listed:

Code Listing 5: Server-side configuration file /etc/openvpn/myhomelan/local.conf
dev tun    
ifconfig 172.16.1.1 172.16.1.20 // IP of the local
// tun device and its peer
secret /etc/openvpn/myhomelan/myhomelan-key.txt
comp-lzo
port 5000
user nobody
group nobody


The client's configuration needs the tunnel's destination address. This is often a dynamic DNS address, sometimes a fixed IP, depending on your ISP. You also need to route to your home LAN (192.168.1.0 in our example). You can call a shell script from the configuration file that accordingly sets a route.

Code Listing 6: Client-side configuration file /etc/openvpn/myhomelan/local.conf
remote    // or your VPN 
// server's external IP if you have a fixed one
dev tun
ifconfig 172.16.1.20 172.16.1.1 // IP of the local tun
// device and its peer
secret /etc/openvpn/myhomelan/myhomelan-key.txt
comp-lzo
port 5000
user nobody
group nobody
up /etc/openvpn/myhomelan/route.sh // sets up the route
//to the network behind the VPN server


The route command would need to set the client's gateway for the network 192.168.1.0 to its peer's address (172.16.1.1 in our setup).

Code Listing 7: /etc/openvpn/myhomelan/route.sh
#!/bin/bash    
route add -net 192.168.1.0 netmask 255.255.255.0 gw 172.16.1.1


That's it. Start OpenVPN on the server and the client, and check the devices with ifconfig and the routes with route -n. Success!

From http://www.gentoo.org/news/en/gwn/20041011-newsletter.xml
rate this article:
current rating: average rating: 1.5 (69 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back



Support us on Content Nation

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2026-09-29
aws-c-s3 - 1.3.0
Ebuild name:

dev-libs/aws-c-s3-1.3.0

Description

AWS C S3 async library

Added to portage

2026-09-29

awscli - 2.37.5
Ebuild name:

app-admin/awscli-2.37.5

Description

Universal Command Line Environment for AWS

Added to portage

2026-09-29

badkeys - 0.0.21
Ebuild name:

app-crypt/badkeys-0.0.21

Description

Check cryptographic keys for known weaknesses

Added to portage

2026-09-29

boto3 - 1.43.104
Ebuild name:

dev-python/boto3-1.43.104

Description

The AWS SDK for Python

Added to portage

2026-09-29

botocore - 1.43.104
Ebuild name:

dev-python/botocore-1.43.104

Description

Low-level, data-driven core of boto 3

Added to portage

2026-09-29

cfn-lint - 1.57.1
Ebuild name:

dev-python/cfn-lint-1.57.1

Description

CloudFormation Linter

Added to portage

2026-09-29

cftime - 1.6.6
Ebuild name:

dev-python/cftime-1.6.6

Description

Time-handling functionality from netcdf4-python

Added to portage

2026-09-29

clang - 24.0.0_pre20260929
Ebuild name:

dev-python/clang-24.0.0_pre20260929

Description

Python bindings for llvm-core/clang

Added to portage

2026-09-29

codeblocks - 25.03-r3
Ebuild name:

dev-util/codeblocks-25.03-r3

Description

The open source, cross platform, free C, C++ and Fortran IDE

Added to portage

2026-09-29

configargparse - 1.8.0
Ebuild name:

dev-python/configargparse-1.8.0

Description

Drop-in replacement for argparse supporting config files and env va

Added to portage

2026-09-29

cysignals - 1.13.0
Ebuild name:

dev-python/cysignals-1.13.0

Description

Interrupt and signal handling for Cython

Added to portage

2026-09-29

dbus-python - 1.5.0
Ebuild name:

dev-python/dbus-python-1.5.0

Description

Python bindings for the D-Bus messagebus

Added to portage

2026-09-29

faker - 40.40.0
Ebuild name:

dev-python/faker-40.40.0

Description

A Python package that generates fake data for you

Added to portage

2026-09-29

filelock - 4.0.6
Ebuild name:

dev-python/filelock-4.0.6

Description

A platform independent file lock for Python

Added to portage

2026-09-29

firefox - 157.0
Ebuild name:

www-client/firefox-157.0

Description

Firefox Web Browser

Added to portage

2026-09-29

firefox-l10n - 157.0
Ebuild name:

www-client/firefox-l10n-157.0

Description

Firefox Web Browser's translation files

Added to portage

2026-09-29

flatpak - 1.18.4
Ebuild name:

sys-apps/flatpak-1.18.4

Description

Linux application sandboxing and distribution framework

Added to portage

2026-09-29

fqdn - 1.6.0
Ebuild name:

dev-python/fqdn-1.6.0

Description

RFC-compliant FQDN validation and manipulation for Python

Added to portage

2026-09-29

freerdp - 3.32.1
Ebuild name:

net-misc/freerdp-3.32.1

Description

Free implementation of the Remote Desktop Protocol

Added to portage

2026-09-29

glibmm - 2.66.8-r1
Ebuild name:

dev-cpp/glibmm-2.66.8-r1

Description

C++ interface for glib2

Added to portage

2026-09-29

gnupg - 2.5.24-r1
Ebuild name:

app-crypt/gnupg-2.5.24-r1

Description

The GNU Privacy Guard, a GPL OpenPGP implementation

Added to portage

2026-09-29

google-auth - 2.59.0
Ebuild name:

dev-python/google-auth-2.59.0

Description

Google Authentication Library

Added to portage

2026-09-29

gumbo - 0.14.1
Ebuild name:

dev-libs/gumbo-0.14.1

Description

The HTML5 parsing algorithm implemented as a pure C99 library

Added to portage

2026-09-29

hashcat - 9999
Ebuild name:

app-crypt/hashcat-9999

Description

World's fastest and most advanced password recovery utility

Added to portage

2026-09-29

imageio - 2.38.0
Ebuild name:

dev-python/imageio-2.38.0

Description

Python library for reading and writing image data

Added to portage

2026-09-29

isort - 9.0.2
Ebuild name:

dev-python/isort-9.0.2

Description

A python utility/library to sort imports

Added to portage

2026-09-29

libpcre2 - 10.49
Ebuild name:

dev-libs/libpcre2-10.49

Description

Perl-compatible regular expression library

Added to portage

2026-09-29

libpcre2-internals - 10.49
Ebuild name:

virtual/libpcre2-internals-10.49

Description

Virtual for dev-libs/libpcre2 internals

Added to portage

2026-09-29

librt - 0.16.0
Ebuild name:

dev-python/librt-0.16.0

Description

Mypyc runtime library

Added to portage

2026-09-29

lit - 24.0.0_pre20260929
Ebuild name:

dev-python/lit-24.0.0_pre20260929

Description

A stand-alone install of the LLVM suite testing tool

Added to portage

2026-09-29

llvm - 24.0.0_pre20260929
Ebuild name:

dev-ml/llvm-24.0.0_pre20260929

Description

OCaml bindings for LLVM

Added to portage

2026-09-29

msgpack - 1.2.3
Ebuild name:

dev-python/msgpack-1.2.3

Description

MessagePack (de)serializer for Python

Added to portage

2026-09-29

nushell - 0.116.0
Ebuild name:

app-shells/nushell-0.116.0

Description

A new type of shell, written in Rust

Added to portage

2026-09-29

oauthlib - 4.0.0
Ebuild name:

dev-python/oauthlib-4.0.0

Description

Spec-compliant and thorough implementation of the OAuth request-signing l

Added to portage

2026-09-29

php - 8.2.34
Ebuild name:

dev-lang/php-8.2.34

Description

The PHP language runtime engine

Added to portage

2026-09-29

php - 8.3.35
Ebuild name:

dev-lang/php-8.3.35

Description

The PHP language runtime engine

Added to portage

2026-09-29

php - 8.4.26
Ebuild name:

dev-lang/php-8.4.26

Description

The PHP language runtime engine

Added to portage

2026-09-29

php - 8.5.11
Ebuild name:

dev-lang/php-8.5.11

Description

The PHP language runtime engine

Added to portage

2026-09-29

pikepdf - 10.15.0
Ebuild name:

dev-python/pikepdf-10.15.0

Description

Python library to work with pdf files based on qpdf

Added to portage

2026-09-29

platformdirs - 4.12.1
Ebuild name:

dev-python/platformdirs-4.12.1

Description

A small Python module for determining appropriate platform-specific

Added to portage

2026-09-29

powerdevil - 6.7.5-r3
Ebuild name:

kde-plasma/powerdevil-6.7.5-r3

Description

Power management for KDE Plasma Shell

Added to portage

2026-09-29

pyjwt - 2.15.1
Ebuild name:

dev-python/pyjwt-2.15.1

Description

JSON Web Token implementation in Python

Added to portage

2026-09-29

pysnmp - 7.1.30
Ebuild name:

dev-python/pysnmp-7.1.30

Description

Python SNMP library

Added to portage

2026-09-29

pyudev - 0.24.5
Ebuild name:

dev-python/pyudev-0.24.5

Description

Python binding to libudev

Added to portage

2026-09-29

qgpgme - 2.2.0-r1
Ebuild name:

dev-libs/qgpgme-2.2.0-r1

Description

GnuPG Made Easy is a library for making GnuPG easier to use (Qt bindings)

Added to portage

2026-09-29

regex - 2026.9.29
Ebuild name:

dev-python/regex-2026.9.29

Description

Alternative regular expression module to replace re

Added to portage

2026-09-29

sc-controller - 1.0.1
Ebuild name:

games-util/sc-controller-1.0.1

Description

User-mode driver and GTK-based GUI for Steam Controllers and others

Added to portage

2026-09-29

tree-sitter-css - 0.25.0-r1
Ebuild name:

dev-libs/tree-sitter-css-0.25.0-r1

Description

CSS grammar for Tree-sitter

Added to portage

2026-09-29

uv - 0.12.20
Ebuild name:

dev-python/uv-0.12.20

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-09-29

xdg-dbus-proxy - 0.1.9
Ebuild name:

sys-apps/xdg-dbus-proxy-0.1.9

Description

Filtering proxy for D-Bus connections

Added to portage

2026-09-29

2026-09-28
4ti2 - 1.6.10-r1
Ebuild name:

sci-mathematics/4ti2-1.6.10-r1

Description

Software package for algebraic, geometric and combinatorial problems

Added to portage

2026-09-28

4ti2 - 1.6.15
Ebuild name:

sci-mathematics/4ti2-1.6.15

Description

Software package for algebraic, geometric and combinatorial problems

Added to portage

2026-09-28

aiohttp - 3.14.3-r1
Ebuild name:

dev-python/aiohttp-3.14.3-r1

Description

HTTP client/server for asyncio

Added to portage

2026-09-28

anydesk - 8.1.0
Ebuild name:

net-misc/anydesk-8.1.0

Description

Feature rich multi-platform remote desktop application

Added to portage

2026-09-28

aws-sdk-cpp - 1.11.901
Ebuild name:

dev-cpp/aws-sdk-cpp-1.11.901

Description

AWS SDK for C++

Added to portage

2026-09-28

chrome-binary-plugins - 156.0.8072.0_alpha
Ebuild name:

www-plugins/chrome-binary-plugins-156.0.8072.0_alpha

Description

Binary plugins from Google Chrome for use in C

Added to portage

2026-09-28

coverage - 7.16.2
Ebuild name:

dev-python/coverage-7.16.2

Description

Code coverage measurement for Python

Added to portage

2026-09-28

cypari2 - 2.2.4-r1
Ebuild name:

dev-python/cypari2-2.2.4-r1

Description

Cython interface to PARI

Added to portage

2026-09-28

egl-wayland - 1.1.23
Ebuild name:

gui-libs/egl-wayland-1.1.23

Description

NVIDIA wayland EGL external platform library

Added to portage

2026-09-28

elementary-xfce-icon-theme - 0.23
Ebuild name:

x11-themes/elementary-xfce-icon-theme-0.23

Description

Elementary icons forked from upstream, extended and main

Added to portage

2026-09-28

ffmpeg-soc-udev-rules - 0
Ebuild name:

media-video/ffmpeg-soc-udev-rules-0

Description

Common udev rules for ffmpeg and ffmpeg-compat with USE=soc

Added to portage

2026-09-28

firefox-bin - 153.4.0
Ebuild name:

www-client/firefox-bin-153.4.0

Description

Firefox Web Browser

Added to portage

2026-09-28

firefox-bin - 157.0
Ebuild name:

www-client/firefox-bin-157.0

Description

Firefox Web Browser

Added to portage

2026-09-28

gcc - 14.4.1_p20260924
Ebuild name:

sys-devel/gcc-14.4.1_p20260924

Description

The GNU Compiler Collection

Added to portage

2026-09-28

gcc - 15.3.1_p20260925
Ebuild name:

sys-devel/gcc-15.3.1_p20260925

Description

The GNU Compiler Collection

Added to portage

2026-09-28

gcc - 16.2.1_p20260926
Ebuild name:

sys-devel/gcc-16.2.1_p20260926

Description

The GNU Compiler Collection

Added to portage

2026-09-28

gcc - 17.0.0_p20260927
Ebuild name:

sys-devel/gcc-17.0.0_p20260927

Description

The GNU Compiler Collection

Added to portage

2026-09-28

ghostscript-gpl - 10.08.0
Ebuild name:

app-text/ghostscript-gpl-10.08.0

Description

Interpreter for the PostScript language and PDF

Added to portage

2026-09-28

git-sources - 7.3_rc5
Ebuild name:

sys-kernel/git-sources-7.3_rc5

Description

The very latest -git version of the Linux kernel

Added to portage

2026-09-28

glpk - 5.0-r5
Ebuild name:

sci-mathematics/glpk-5.0-r5

Description

GNU Linear Programming Kit

Added to portage

2026-09-28

google-chrome-unstable - 156.0.8072.0
Ebuild name:

www-client/google-chrome-unstable-156.0.8072.0

Description

The web browser from Google

Added to portage

2026-09-28

gramps - 6.0.8-r1
Ebuild name:

app-misc/gramps-6.0.8-r1

Description

Community genealogy program aiming to be both intuitive and feature-comple

Added to portage

2026-09-28

haproxy - 3.0.29
Ebuild name:

net-proxy/haproxy-3.0.29

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-09-28

haproxy - 3.2.25
Ebuild name:

net-proxy/haproxy-3.2.25

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-09-28

haproxy - 3.4.6
Ebuild name:

net-proxy/haproxy-3.4.6

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-09-28

hashcat - 7.1.2-r1
Ebuild name:

app-crypt/hashcat-7.1.2-r1

Description

World's fastest and most advanced password recovery utility

Added to portage

2026-09-28

hypothesis - 6.168.2
Ebuild name:

dev-python/hypothesis-6.168.2

Description

A library for property based testing

Added to portage

2026-09-28

imagemagick - 7.1.2.32
Ebuild name:

media-gfx/imagemagick-7.1.2.32

Description

A collection of tools and libraries for many image formats

Added to portage

2026-09-28

intel-graphics-compiler - 2.41.9-r1
Ebuild name:

dev-util/intel-graphics-compiler-2.41.9-r1

Description

LLVM-based OpenCL compiler for OpenCL targetting Intel G

Added to portage

2026-09-28

lmdb - 1.0.2
Ebuild name:

dev-db/lmdb-1.0.2

Description

An ultra-fast, ultra-compact key-value embedded data store

Added to portage

2026-09-28

meson - 1.12.1
Ebuild name:

dev-build/meson-1.12.1

Description

Open source build system

Added to portage

2026-09-28

microsoft-edge - 154.0.4258.37
Ebuild name:

www-client/microsoft-edge-154.0.4258.37

Description

The web browser from Microsoft

Added to portage

2026-09-28

microsoft-edge-beta - 155.0.4283.18
Ebuild name:

www-client/microsoft-edge-beta-155.0.4283.18

Description

The web browser from Microsoft

Added to portage

2026-09-28

netcdf-cxx - 4.3.1-r3
Ebuild name:

sci-libs/netcdf-cxx-4.3.1-r3

Description

C++ library for netCDF

Added to portage

2026-09-28

nodejs - 26.10.0-r2
Ebuild name:

net-libs/nodejs-26.10.0-r2

Description

A JavaScript runtime built on Chrome's V8 JavaScript engine

Added to portage

2026-09-28

opera - 136.0.6008.52
Ebuild name:

www-client/opera-136.0.6008.52

Description

A fast and secure web browser

Added to portage

2026-09-28

opera-developer - 137.0.6029.0
Ebuild name:

www-client/opera-developer-137.0.6029.0

Description

A fast and secure web browser

Added to portage

2026-09-28

opera-gx - 135.0.5973.153
Ebuild name:

www-client/opera-gx-135.0.5973.153

Description

Opera, but for 'gamers'

Added to portage

2026-09-28

pari - 2.17.4
Ebuild name:

sci-mathematics/pari-2.17.4

Description

Computer-aided number theory C library and tools

Added to portage

2026-09-28

peewee - 4.5.2
Ebuild name:

dev-python/peewee-4.5.2

Description

Small Python ORM

Added to portage

2026-09-28

pytest-mock - 3.16.0
Ebuild name:

dev-python/pytest-mock-3.16.0

Description

Thin-wrapper around the mock package for easier use with pytest

Added to portage

2026-09-28

python-slugify - 9.1.2
Ebuild name:

dev-python/python-slugify-9.1.2

Description

A Python Slugify application that handles Unicode

Added to portage

2026-09-28

siegfried - 1.11.9
Ebuild name:

app-misc/siegfried-1.11.9

Description

Signature-based file format identification

Added to portage

2026-09-28

sipp - 3.7.8
Ebuild name:

net-misc/sipp-3.7.8

Description

A free Open Source test tool / traffic generator for the SIP protocol

Added to portage

2026-09-28

sonata - 1.7.3-r1
Ebuild name:

media-sound/sonata-1.7.3-r1

Description

Elegant GTK+ music client for the Music Player Daemon (MPD)

Added to portage

2026-09-28

sqlglot - 30.20.0
Ebuild name:

dev-python/sqlglot-30.20.0

Description

An easily customizable SQL parser and transpiler

Added to portage

2026-09-28

talk-desktop-bin - 2.3.2
Ebuild name:

net-im/talk-desktop-bin-2.3.2

Description

Nextcloud Talk Desktop client

Added to portage

2026-09-28

tox - 4.64.4
Ebuild name:

dev-python/tox-4.64.4

Description

virtualenv-based automation of test activities

Added to portage

2026-09-28

v4l2loopback - 0.15.4
Ebuild name:

media-video/v4l2loopback-0.15.4

Description

v4l2 loopback device whose output is its own input

Added to portage

2026-09-28

vivaldi - 8.2.4133.64
Ebuild name:

www-client/vivaldi-8.2.4133.64

Description

A browser for our friends

Added to portage

2026-09-28

vivaldi - 8.2.4133.68
Ebuild name:

www-client/vivaldi-8.2.4133.68

Description

A browser for our friends

Added to portage

2026-09-28

vivaldi-snapshot - 8.3.4161.3
Ebuild name:

www-client/vivaldi-snapshot-8.3.4161.3

Description

A browser for our friends

Added to portage

2026-09-28

vivaldi-snapshot - 8.3.4171.3
Ebuild name:

www-client/vivaldi-snapshot-8.3.4171.3

Description

A browser for our friends

Added to portage

2026-09-28

werkzeug - 3.1.9
Ebuild name:

dev-python/werkzeug-3.1.9

Description

Collection of various utilities for WSGI applications

Added to portage

2026-09-28

wrapt - 2.5.0
Ebuild name:

dev-python/wrapt-2.5.0

Description

Module for decorators, wrappers and monkey patching

Added to portage

2026-09-28

rdf newsfeed | rss newsfeed | Atom newsfeed
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
- Copyright and legal notices -
Time to create this page: 67.2 ms