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:

84085

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.6 (45 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-03-30
fcft - 3.3.3
Ebuild name:

media-libs/fcft-3.3.3

Description

Simple library for font loading and glyph rasterization

Added to portage

2026-03-30

grub - 2.14-r4
Ebuild name:

sys-boot/grub-2.14-r4

Description

GNU GRUB boot loader

Added to portage

2026-03-30

inxi - 3.3.40.1
Ebuild name:

sys-apps/inxi-3.3.40.1

Description

The CLI inxi collects and prints hardware and system information

Added to portage

2026-03-30

mmm-mode - 0.5.11
Ebuild name:

app-emacs/mmm-mode-0.5.11

Description

Enables the user to edit different parts of a file in different major mod

Added to portage

2026-03-30

2026-03-29
HTTP-Daemon-SSL - 1.05.01
Ebuild name:

dev-perl/HTTP-Daemon-SSL-1.05.01

Description

A simple http server class with SSL support

Added to portage

2026-03-29

aiohttp - 3.13.4
Ebuild name:

dev-python/aiohttp-3.13.4

Description

HTTP client/server for asyncio

Added to portage

2026-03-29

autoconf - 2.73-r1
Ebuild name:

dev-build/autoconf-2.73-r1

Description

Used to create autoconfiguration files

Added to portage

2026-03-29

bedrock-server - 1.26.11.1
Ebuild name:

games-server/bedrock-server-1.26.11.1

Description

The official bedrock (non-java) based server for the sandbox

Added to portage

2026-03-29

cares-tools - 0.3
Ebuild name:

net-dns/cares-tools-0.3

Description

c-ares tools host, nslookup

Added to portage

2026-03-29

clamtk - 6.18-r2
Ebuild name:

app-antivirus/clamtk-6.18-r2

Description

A graphical front-end for ClamAV

Added to portage

2026-03-29

dist-kernel - 6.12.79
Ebuild name:

virtual/dist-kernel-6.12.79

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-03-29

dunst - 1.13.2
Ebuild name:

x11-misc/dunst-1.13.2

Description

Lightweight replacement for common notification daemons

Added to portage

2026-03-29

fastfetch - 2.61.0
Ebuild name:

app-misc/fastfetch-2.61.0

Description

Fast neofetch-like system information tool

Added to portage

2026-03-29

faudio - 26.03
Ebuild name:

app-emulation/faudio-26.03

Description

Accuracy-focused XAudio reimplementation for open platforms

Added to portage

2026-03-29

flux - 2.8.3-r1
Ebuild name:

sys-cluster/flux-2.8.3-r1

Description

Flux is a tool for keeping Kubernetes clusters in sync

Added to portage

2026-03-29

fuse - 1.6.0-r5
Ebuild name:

app-emulation/fuse-1.6.0-r5

Description

Free Unix Spectrum Emulator by Philip Kendall

Added to portage

2026-03-29

fuse - 1.7.0
Ebuild name:

app-emulation/fuse-1.7.0

Description

Free Unix Spectrum Emulator by Philip Kendall

Added to portage

2026-03-29

fuse-utils - 1.4.3-r3
Ebuild name:

app-emulation/fuse-utils-1.4.3-r3

Description

Utils for the Free Unix Spectrum Emulator by Philip Kendall

Added to portage

2026-03-29

fuse-utils - 1.4.4
Ebuild name:

app-emulation/fuse-utils-1.4.4

Description

Utils for the Free Unix Spectrum Emulator by Philip Kendall

Added to portage

2026-03-29

gcc - 15.2.1_p20260328
Ebuild name:

sys-devel/gcc-15.2.1_p20260328

Description

The GNU Compiler Collection

Added to portage

2026-03-29

gegl - 0.4.70
Ebuild name:

media-libs/gegl-0.4.70

Description

A graph based image processing framework

Added to portage

2026-03-29

gentoo-kernel - 6.12.79
Ebuild name:

sys-kernel/gentoo-kernel-6.12.79

Description

Linux kernel built with Gentoo patches

Added to portage

2026-03-29

gentoo-kernel-bin - 6.12.79
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.79

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-03-29

gimp - 2.10.38-r5
Ebuild name:

media-gfx/gimp-2.10.38-r5

Description

GNU Image Manipulation Program

Added to portage

2026-03-29

gimp - 3.0.8-r2
Ebuild name:

media-gfx/gimp-3.0.8-r2

Description

GNU Image Manipulation Program

Added to portage

2026-03-29

gimp - 3.2.2
Ebuild name:

media-gfx/gimp-3.2.2

Description

GNU Image Manipulation Program

Added to portage

2026-03-29

hypothesis - 6.151.10
Ebuild name:

dev-python/hypothesis-6.151.10

Description

A library for property based testing

Added to portage

2026-03-29

imagemagick - 6.9.13.43
Ebuild name:

media-gfx/imagemagick-6.9.13.43

Description

A collection of tools and libraries for many image formats

Added to portage

2026-03-29

imagemagick - 7.1.2.18
Ebuild name:

media-gfx/imagemagick-7.1.2.18

Description

A collection of tools and libraries for many image formats

Added to portage

2026-03-29

intel-compute-runtime - 26.09.37435.10
Ebuild name:

dev-libs/intel-compute-runtime-26.09.37435.10

Description

Intel Graphics Compute Runtime for oneAPI Level Zero

Added to portage

2026-03-29

intel-graphics-compiler - 2.31.2
Ebuild name:

dev-util/intel-graphics-compiler-2.31.2

Description

LLVM-based OpenCL compiler for OpenCL targetting Intel Gen

Added to portage

2026-03-29

intel-metrics-discovery - 1.14.185
Ebuild name:

dev-libs/intel-metrics-discovery-1.14.185

Description

A user mode library that provides access to GPU performan

Added to portage

2026-03-29

intel-metrics-library - 1.0.209.1
Ebuild name:

dev-libs/intel-metrics-library-1.0.209.1

Description

User mode driver helper library that provides access to GP

Added to portage

2026-03-29

jsoncons - 1.6.0
Ebuild name:

dev-cpp/jsoncons-1.6.0

Description

C++ header-only library for JSON and JSON-like data formats

Added to portage

2026-03-29

kubelogin - 1.35.2-r1
Ebuild name:

sys-cluster/kubelogin-1.35.2-r1

Description

kubectl plugin for Kubernetes OpenID Connect authentication

Added to portage

2026-03-29

kubelogin - 1.36.0-r1
Ebuild name:

sys-cluster/kubelogin-1.36.0-r1

Description

kubectl plugin for Kubernetes OpenID Connect authentication

Added to portage

2026-03-29

kubeseal - 0.36.1-r1
Ebuild name:

sys-cluster/kubeseal-0.36.1-r1

Description

Client-side utility for one-way encrypted secrets in kubernetes

Added to portage

2026-03-29

kwin - 6.6.3-r1
Ebuild name:

kde-plasma/kwin-6.6.3-r1

Description

Flexible, composited Window Manager for windowing systems on Linux

Added to portage

2026-03-29

libkscreen - 6.5.5-r2
Ebuild name:

kde-plasma/libkscreen-6.5.5-r2

Description

Plasma screen management library

Added to portage

2026-03-29

libspectrum - 1.5.0-r1
Ebuild name:

app-emulation/libspectrum-1.5.0-r1

Description

Spectrum emulation library

Added to portage

2026-03-29

libspectrum - 1.6.0
Ebuild name:

app-emulation/libspectrum-1.6.0

Description

Spectrum emulation library

Added to portage

2026-03-29

libupnp - 1.18.4
Ebuild name:

net-libs/libupnp-1.18.4

Description

An Portable Open Source UPnP Development Kit

Added to portage

2026-03-29

luasystem - 0.7.0
Ebuild name:

dev-lua/luasystem-0.7.0

Description

Platform independent system calls for Lua

Added to portage

2026-03-29

mattermost-desktop-bin - 6.1.1_rc1
Ebuild name:

net-im/mattermost-desktop-bin-6.1.1_rc1

Description

Mattermost Desktop application

Added to portage

2026-03-29

minecraft-server - 26.1
Ebuild name:

games-server/minecraft-server-26.1

Description

The official server for the sandbox video game

Added to portage

2026-03-29

miniflux - 2.2.14-r1
Ebuild name:

www-apps/miniflux-2.2.14-r1

Description

Minimalist and opinionated feed reader

Added to portage

2026-03-29

miniflux - 2.2.17-r1
Ebuild name:

www-apps/miniflux-2.2.17-r1

Description

Minimalist and opinionated feed reader

Added to portage

2026-03-29

mit-krb5 - 1.22.1
Ebuild name:

app-crypt/mit-krb5-1.22.1

Description

MIT Kerberos V

Added to portage

2026-03-29

mit-krb5 - 1.22.2
Ebuild name:

app-crypt/mit-krb5-1.22.2

Description

MIT Kerberos V

Added to portage

2026-03-29

mit-krb5-appl - 1.0.3-r4
Ebuild name:

app-crypt/mit-krb5-appl-1.0.3-r4

Description

Kerberized applications split from the main MIT Kerberos V distrib

Added to portage

2026-03-29

mit-krb5-appl - 1.0.3-r5
Ebuild name:

app-crypt/mit-krb5-appl-1.0.3-r5

Description

Kerberized applications split from the main MIT Kerberos V distrib

Added to portage

2026-03-29

mixxx - 2.5.6
Ebuild name:

media-sound/mixxx-2.5.6

Description

Advanced Digital DJ tool based on Qt

Added to portage

2026-03-29

motif - 2.5.1
Ebuild name:

x11-libs/motif-2.5.1

Description

The Motif user interface component toolkit

Added to portage

2026-03-29

mpv - 0.41.0-r1
Ebuild name:

media-video/mpv-0.41.0-r1

Description

Media player for the command line

Added to portage

2026-03-29

numpy - 2.4.4
Ebuild name:

dev-python/numpy-2.4.4

Description

Fast array and numerical python library

Added to portage

2026-03-29

open-supaplex - 7.2
Ebuild name:

games-arcade/open-supaplex-7.2

Description

OSS reimplementation of Supaplex in C and SDL

Added to portage

2026-03-29

opencl-clang - 16.0.9
Ebuild name:

dev-libs/opencl-clang-16.0.9

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-03-29

opencl-clang - 17.0.4
Ebuild name:

dev-libs/opencl-clang-17.0.4

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-03-29

opencl-clang - 18.1.4
Ebuild name:

dev-libs/opencl-clang-18.1.4

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-03-29

opencl-clang - 19.1.3
Ebuild name:

dev-libs/opencl-clang-19.1.3

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-03-29

opencl-clang - 20.1.3
Ebuild name:

dev-libs/opencl-clang-20.1.3

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-03-29

opencl-clang - 21.1.3
Ebuild name:

dev-libs/opencl-clang-21.1.3

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-03-29

opencl-clang - 22.1.0
Ebuild name:

dev-libs/opencl-clang-22.1.0

Description

OpenCL-oriented thin wrapper library around clang

Added to portage

2026-03-29

openjdk-bin - 27_alpha15
Ebuild name:

dev-java/openjdk-bin-27_alpha15

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-03-29

openpgp-keys-imagemagick - 20260329
Ebuild name:

sec-keys/openpgp-keys-imagemagick-20260329

Description

OpenPGP key used to sign ImageMagick releases

Added to portage

2026-03-29

openrct2 - 0.4.32
Ebuild name:

games-simulation/openrct2-0.4.32

Description

An open source re-implementation of Chris Sawyer's RollerCoaster T

Added to portage

2026-03-29

pandora_box - 0.20.1
Ebuild name:

sys-apps/pandora_box-0.20.1

Description

Syd's log inspector & profile writer

Added to portage

2026-03-29

phpsysinfo - 3.4.5
Ebuild name:

www-apps/phpsysinfo-3.4.5

Description

A customizable PHP script that displays information about your system nic

Added to portage

2026-03-29

poetry - 2.3.3
Ebuild name:

dev-python/poetry-2.3.3

Description

A frontend for poetry - a python dependency management and packaging tool

Added to portage

2026-03-29

poetry-core - 2.3.2
Ebuild name:

dev-python/poetry-core-2.3.2

Description

Poetry PEP 517 Build Backend

Added to portage

2026-03-29

pygit2 - 1.19.2
Ebuild name:

dev-python/pygit2-1.19.2

Description

Python bindings for libgit2

Added to portage

2026-03-29

pymdown-extensions - 10.21.2
Ebuild name:

dev-python/pymdown-extensions-10.21.2

Description

Extensions for Python Markdown

Added to portage

2026-03-29

python-json-logger - 4.1.0
Ebuild name:

dev-python/python-json-logger-4.1.0

Description

Standard python logging to output log data as json objects

Added to portage

2026-03-29

regex - 2026.3.32
Ebuild name:

dev-python/regex-2026.3.32

Description

Alternative regular expression module to replace re

Added to portage

2026-03-29

scummvm - 2026.2.0
Ebuild name:

games-engines/scummvm-2026.2.0

Description

Reimplementation of the SCUMM game engine used in Lucasarts adventur

Added to portage

2026-03-29

spirv-llvm-translator - 16.0.22
Ebuild name:

dev-util/spirv-llvm-translator-16.0.22

Description

Bi-directional translator between SPIR-V and LLVM IR

Added to portage

2026-03-29

spirv-llvm-translator - 17.0.21
Ebuild name:

dev-util/spirv-llvm-translator-17.0.21

Description

Bi-directional translator between SPIR-V and LLVM IR

Added to portage

2026-03-29

spirv-llvm-translator - 18.1.21
Ebuild name:

dev-util/spirv-llvm-translator-18.1.21

Description

Bi-directional translator between SPIR-V and LLVM IR

Added to portage

2026-03-29

spirv-llvm-translator - 19.1.16
Ebuild name:

dev-util/spirv-llvm-translator-19.1.16

Description

Bi-directional translator between SPIR-V and LLVM IR

Added to portage

2026-03-29

spirv-llvm-translator - 20.1.11
Ebuild name:

dev-util/spirv-llvm-translator-20.1.11

Description

Bi-directional translator between SPIR-V and LLVM IR

Added to portage

2026-03-29

spirv-llvm-translator - 21.1.5
Ebuild name:

dev-util/spirv-llvm-translator-21.1.5

Description

Bi-directional translator between SPIR-V and LLVM IR

Added to portage

2026-03-29

spirv-llvm-translator - 22.1.0
Ebuild name:

dev-util/spirv-llvm-translator-22.1.0

Description

Bi-directional translator between SPIR-V and LLVM IR

Added to portage

2026-03-29

stone-soup - 0.25.1-r104
Ebuild name:

games-roguelike/stone-soup-0.25.1-r104

Description

Role-playing roguelike game of exploration and treasure-hunt

Added to portage

2026-03-29

stone-soup - 0.26.1-r3
Ebuild name:

games-roguelike/stone-soup-0.26.1-r3

Description

Role-playing roguelike game of exploration and treasure-huntin

Added to portage

2026-03-29

stone-soup - 0.27.1-r2
Ebuild name:

games-roguelike/stone-soup-0.27.1-r2

Description

Role-playing roguelike game of exploration and treasure-huntin

Added to portage

2026-03-29

stone-soup - 0.28.0-r2
Ebuild name:

games-roguelike/stone-soup-0.28.0-r2

Description

Role-playing roguelike game of exploration and treasure-huntin

Added to portage

2026-03-29

stone-soup - 0.29.1-r1
Ebuild name:

games-roguelike/stone-soup-0.29.1-r1

Description

Role-playing roguelike game of exploration and treasure-huntin

Added to portage

2026-03-29

stone-soup - 0.30.1-r1
Ebuild name:

games-roguelike/stone-soup-0.30.1-r1

Description

Role-playing roguelike game of exploration and treasure-huntin

Added to portage

2026-03-29

stone-soup - 0.31.0-r1
Ebuild name:

games-roguelike/stone-soup-0.31.0-r1

Description

Role-playing roguelike game of exploration and treasure-huntin

Added to portage

2026-03-29

stone-soup - 0.32.1-r1
Ebuild name:

games-roguelike/stone-soup-0.32.1-r1

Description

Role-playing roguelike game of exploration and treasure-huntin

Added to portage

2026-03-29

stone-soup - 0.33.1-r1
Ebuild name:

games-roguelike/stone-soup-0.33.1-r1

Description

Role-playing roguelike game of exploration and treasure-huntin

Added to portage

2026-03-29

stone-soup - 0.34.0-r1
Ebuild name:

games-roguelike/stone-soup-0.34.0-r1

Description

Role-playing roguelike game of exploration and treasure-huntin

Added to portage

2026-03-29

syd - 3.51.1
Ebuild name:

sys-apps/syd-3.51.1

Description

seccomp and landlock based application sandbox with support for namespaces

Added to portage

2026-03-29

texstudio - 4.9.3
Ebuild name:

app-office/texstudio-4.9.3

Description

Free cross-platform LaTeX editor (fork from texmakerX)

Added to portage

2026-03-29

thunar - 4.20.8
Ebuild name:

xfce-base/thunar-4.20.8

Description

File manager for the Xfce desktop environment

Added to portage

2026-03-29

thunar - 4.21.5
Ebuild name:

xfce-base/thunar-4.21.5

Description

File manager for the Xfce desktop environment

Added to portage

2026-03-29

transformers - 5.1.0
Ebuild name:

sci-ml/transformers-5.1.0

Description

State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow

Added to portage

2026-03-29

transformers - 5.2.0
Ebuild name:

sci-ml/transformers-5.2.0

Description

State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow

Added to portage

2026-03-29

tuned - 2.27.0-r1
Ebuild name:

sys-apps/tuned-2.27.0-r1

Description

Daemon for monitoring and adaptive tuning of system devices

Added to portage

2026-03-29

unrar - 7.2.5
Ebuild name:

app-arch/unrar-7.2.5

Description

Uncompress rar files

Added to portage

2026-03-29

vanilla-kernel - 6.12.79
Ebuild name:

sys-kernel/vanilla-kernel-6.12.79

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-03-29

virtctl - 1.8.0-r1
Ebuild name:

sys-cluster/virtctl-1.8.0-r1

Description

Control virtual machine related operations on your kubernetes cluster

Added to portage

2026-03-29

xfce4-appfinder - 4.21.1
Ebuild name:

xfce-base/xfce4-appfinder-4.21.1

Description

A tool to find and launch installed applications for the Xfce desk

Added to portage

2026-03-29

xmrig - 6.26.0
Ebuild name:

net-misc/xmrig-6.26.0

Description

RandomX, CryptoNight, KawPow, AstroBWT, and Argon2 CPU/GPU miner

Added to portage

2026-03-29

zxcvbn-c - 2.6
Ebuild name:

dev-libs/zxcvbn-c-2.6

Description

C/C++ version of the zxcvbn password strength estimator

Added to portage

2026-03-29

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