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:

88249

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-09
aurorae - 6.7.5
Ebuild name:

kde-plasma/aurorae-6.7.5

Description

Themeable window decoration for KWin

Added to portage

2026-09-09

bluedevil - 6.7.5
Ebuild name:

kde-plasma/bluedevil-6.7.5

Description

Bluetooth stack for KDE Plasma

Added to portage

2026-09-09

breeze - 6.7.5
Ebuild name:

kde-plasma/breeze-6.7.5

Description

Breeze visual style for the Plasma desktop

Added to portage

2026-09-09

breeze-grub - 6.7.5
Ebuild name:

kde-plasma/breeze-grub-6.7.5

Description

Breeze theme for GRUB

Added to portage

2026-09-09

breeze-gtk - 6.7.5
Ebuild name:

kde-plasma/breeze-gtk-6.7.5

Description

Official GTK+ port of Plasma's Breeze widget style

Added to portage

2026-09-09

breeze-plymouth - 6.7.5
Ebuild name:

kde-plasma/breeze-plymouth-6.7.5

Description

Breeze theme for Plymouth

Added to portage

2026-09-09

cargo-nextest - 0.9.143
Ebuild name:

dev-util/cargo-nextest-0.9.143

Description

Next-generation test runner for Rust

Added to portage

2026-09-09

cattrs - 26.2.0-r1
Ebuild name:

dev-python/cattrs-26.2.0-r1

Description

Composable complex class support for attrs and dataclasses

Added to portage

2026-09-09

clang - 23.1.1
Ebuild name:

dev-python/clang-23.1.1

Description

Python bindings for llvm-core/clang

Added to portage

2026-09-09

codespell - 2.4.3
Ebuild name:

dev-util/codespell-2.4.3

Description

Check text files for common misspellings

Added to portage

2026-09-09

discover - 6.7.5
Ebuild name:

kde-plasma/discover-6.7.5

Description

KDE Plasma resources management GUI

Added to portage

2026-09-09

drkonqi - 6.7.5
Ebuild name:

kde-plasma/drkonqi-6.7.5

Description

Plasma crash handler, gives the user feedback if a program crashed

Added to portage

2026-09-09

flatpak-kcm - 6.7.5
Ebuild name:

kde-plasma/flatpak-kcm-6.7.5

Description

Flatpak Permissions Management KCM

Added to portage

2026-09-09

kactivitymanagerd - 6.7.5
Ebuild name:

kde-plasma/kactivitymanagerd-6.7.5

Description

System service to manage user's activities, track the usage patt

Added to portage

2026-09-09

kde-cli-tools - 6.7.5
Ebuild name:

kde-plasma/kde-cli-tools-6.7.5

Description

Tools based on KDE Frameworks 6 to better interact with the system

Added to portage

2026-09-09

kde-cli-tools-common - 6.7.5
Ebuild name:

kde-plasma/kde-cli-tools-common-6.7.5

Description

Common files for

Added to portage

2026-09-09

kde-gtk-config - 6.7.5
Ebuild name:

kde-plasma/kde-gtk-config-6.7.5

Description

Syncs KDE Plasma theme settings to GTK applications

Added to portage

2026-09-09

kdecoration - 6.7.5
Ebuild name:

kde-plasma/kdecoration-6.7.5

Description

Plugin based library to create window decorations

Added to portage

2026-09-09

kdeplasma-addons - 6.7.5
Ebuild name:

kde-plasma/kdeplasma-addons-6.7.5

Description

Extra Plasma applets and engines

Added to portage

2026-09-09

kdesu-gui - 6.7.5
Ebuild name:

kde-plasma/kdesu-gui-6.7.5

Description

Graphical frontend for KDE Frameworks' kdesu

Added to portage

2026-09-09

keditfiletype - 6.7.5
Ebuild name:

kde-plasma/keditfiletype-6.7.5

Description

File Type Editor

Added to portage

2026-09-09

kgamma - 6.7.5
Ebuild name:

kde-plasma/kgamma-6.7.5

Description

Screen gamma values kcontrol module

Added to portage

2026-09-09

kglobalacceld - 6.7.5
Ebuild name:

kde-plasma/kglobalacceld-6.7.5

Description

Daemon providing Global Keyboard Shortcut (Accelerator) functionalit

Added to portage

2026-09-09

kinfocenter - 6.7.5
Ebuild name:

kde-plasma/kinfocenter-6.7.5

Description

Utility providing information about the computer hardware

Added to portage

2026-09-09

kmenuedit - 6.7.5
Ebuild name:

kde-plasma/kmenuedit-6.7.5

Description

KDE Plasma menu editor

Added to portage

2026-09-09

knighttime - 6.7.5
Ebuild name:

kde-plasma/knighttime-6.7.5

Description

Helpers for scheduling the dark-light cycle

Added to portage

2026-09-09

kpipewire - 6.7.5
Ebuild name:

kde-plasma/kpipewire-6.7.5

Description

Components relating to Flatpak pipewire use in Plasma

Added to portage

2026-09-09

krdp - 6.7.5
Ebuild name:

kde-plasma/krdp-6.7.5

Description

Library and examples for creating an RDP server

Added to portage

2026-09-09

kscreen - 6.7.5
Ebuild name:

kde-plasma/kscreen-6.7.5

Description

KDE Plasma screen management

Added to portage

2026-09-09

kscreenlocker - 6.7.5
Ebuild name:

kde-plasma/kscreenlocker-6.7.5

Description

Library and components for secure lock screen architecture

Added to portage

2026-09-09

ksshaskpass - 6.7.5
Ebuild name:

kde-plasma/ksshaskpass-6.7.5

Description

Implementation of ssh-askpass with KDE Wallet integration

Added to portage

2026-09-09

ksystemstats - 6.7.5
Ebuild name:

kde-plasma/ksystemstats-6.7.5

Description

Plugin-based system monitoring daemon

Added to portage

2026-09-09

kwallet-pam - 6.7.5
Ebuild name:

kde-plasma/kwallet-pam-6.7.5

Description

PAM module to not enter KWallet password again after login

Added to portage

2026-09-09

kwayland - 6.7.5
Ebuild name:

kde-plasma/kwayland-6.7.5

Description

Qt-style API to interact with the wayland-client API

Added to portage

2026-09-09

kwin - 6.7.5
Ebuild name:

kde-plasma/kwin-6.7.5

Description

Flexible, composited Window Manager for windowing systems on Linux

Added to portage

2026-09-09

kwin-x11 - 6.7.5
Ebuild name:

kde-plasma/kwin-x11-6.7.5

Description

Flexible, composited X window manager

Added to portage

2026-09-09

kwrited - 6.7.5
Ebuild name:

kde-plasma/kwrited-6.7.5

Description

KDE Plasma daemon listening for wall and write messages

Added to portage

2026-09-09

layer-shell-qt - 6.7.5
Ebuild name:

kde-plasma/layer-shell-qt-6.7.5

Description

Qt component to allow applications make use of Wayland wl-layer-she

Added to portage

2026-09-09

libkscreen - 6.7.5
Ebuild name:

kde-plasma/libkscreen-6.7.5

Description

Plasma screen management library

Added to portage

2026-09-09

libksysguard - 6.7.5
Ebuild name:

kde-plasma/libksysguard-6.7.5

Description

Task management and system monitoring library

Added to portage

2026-09-09

libplasma - 6.7.5
Ebuild name:

kde-plasma/libplasma-6.7.5

Description

Plasma library and runtime components based upon KF6 and Qt6

Added to portage

2026-09-09

lit - 23.1.1
Ebuild name:

dev-python/lit-23.1.1

Description

A stand-alone install of the LLVM suite testing tool

Added to portage

2026-09-09

llvm - 23.1.1
Ebuild name:

dev-ml/llvm-23.1.1

Description

OCaml bindings for LLVM

Added to portage

2026-09-09

milou - 6.7.5
Ebuild name:

kde-plasma/milou-6.7.5

Description

Dedicated search application built on top of Baloo

Added to portage

2026-09-09

ocean-sound-theme - 6.7.5
Ebuild name:

kde-plasma/ocean-sound-theme-6.7.5

Description

Ocean Sound Theme for Plasma

Added to portage

2026-09-09

oxygen - 6.7.5
Ebuild name:

kde-plasma/oxygen-6.7.5

Description

Oxygen visual style for the Plasma desktop

Added to portage

2026-09-09

oxygen-sounds - 6.7.5
Ebuild name:

kde-plasma/oxygen-sounds-6.7.5

Description

Oxygen sound theme for the Plasma desktop

Added to portage

2026-09-09

packer - 1.16.0
Ebuild name:

dev-util/packer-1.16.0

Description

A tool to create identical machine images for multiple platforms

Added to portage

2026-09-09

plasma-activities - 6.7.5
Ebuild name:

kde-plasma/plasma-activities-6.7.5

Description

Core components for KDE's Activities System

Added to portage

2026-09-09

plasma-activities-stats - 6.7.5
Ebuild name:

kde-plasma/plasma-activities-stats-6.7.5

Description

Library for accessing usage data collected by the activiti

Added to portage

2026-09-09

2026-09-08
apache_exporter - 1.1.1-r1
Ebuild name:

app-metrics/apache_exporter-1.1.1-r1

Description

Prometheus exporter for apache metrics

Added to portage

2026-09-08

ast-serialize - 0.10.0
Ebuild name:

dev-python/ast-serialize-0.10.0

Description

Python bindings for mypy AST serialization

Added to portage

2026-09-08

bpf-linker - 0.11.1
Ebuild name:

dev-util/bpf-linker-0.11.1

Description

Simple BPF static linker

Added to portage

2026-09-08

bzip3 - 1.5.4
Ebuild name:

app-arch/bzip3-1.5.4

Description

A better and stronger spiritual successor to BZip2

Added to portage

2026-09-08

cairosvg - 2.9.1
Ebuild name:

media-gfx/cairosvg-2.9.1

Description

CLI and library to export SVG to PDF, PostScript, and PNG

Added to portage

2026-09-08

ccache - 4.14
Ebuild name:

dev-util/ccache-4.14

Description

Fast compiler cache

Added to portage

2026-09-08

cmake - 4.3.5
Ebuild name:

dev-build/cmake-4.3.5

Description

Cross platform Make

Added to portage

2026-09-08

cmake - 4.4.2
Ebuild name:

dev-build/cmake-4.4.2

Description

Cross platform Make

Added to portage

2026-09-08

cmake - 4.4.3
Ebuild name:

dev-build/cmake-4.4.3

Description

Cross platform Make

Added to portage

2026-09-08

curl - 8.22.0
Ebuild name:

net-misc/curl-8.22.0

Description

A Client that groks URLs

Added to portage

2026-09-08

cutlass - 4.6.1
Ebuild name:

dev-libs/cutlass-4.6.1

Description

CUDA Templates for Linear Algebra Subroutines

Added to portage

2026-09-08

dist-kernel - 6.12.109
Ebuild name:

virtual/dist-kernel-6.12.109

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-09-08

dist-kernel - 6.18.50
Ebuild name:

virtual/dist-kernel-6.18.50

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-09-08

dist-kernel - 7.2.4
Ebuild name:

virtual/dist-kernel-7.2.4

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-09-08

djangorestframework - 3.18.1
Ebuild name:

dev-python/djangorestframework-3.18.1

Description

Web APIs with django made easy

Added to portage

2026-09-08

gallery-dl - 1.32.11
Ebuild name:

net-misc/gallery-dl-1.32.11

Description

Download image galleries and collections from several image hosting sit

Added to portage

2026-09-08

gentoo-kernel - 6.12.109
Ebuild name:

sys-kernel/gentoo-kernel-6.12.109

Description

Linux kernel built with Gentoo patches

Added to portage

2026-09-08

gentoo-kernel - 6.18.50
Ebuild name:

sys-kernel/gentoo-kernel-6.18.50

Description

Linux kernel built with Gentoo patches

Added to portage

2026-09-08

gentoo-kernel - 7.2.4
Ebuild name:

sys-kernel/gentoo-kernel-7.2.4

Description

Linux kernel built with Gentoo patches

Added to portage

2026-09-08

gentoo-kernel-bin - 6.12.109
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.109

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-09-08

gentoo-kernel-bin - 6.18.50
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.18.50

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-09-08

gentoo-kernel-bin - 7.2.4
Ebuild name:

sys-kernel/gentoo-kernel-bin-7.2.4

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-09-08

gentoo-kernel-modprep - 6.12.109
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.12.109

Description

Minimal subset of gentoo-kernel-bin for building modules,

Added to portage

2026-09-08

gentoo-kernel-modprep - 6.18.50
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.18.50

Description

Minimal subset of gentoo-kernel-bin for building modules,

Added to portage

2026-09-08

gentoo-kernel-modprep - 7.2.4
Ebuild name:

sys-kernel/gentoo-kernel-modprep-7.2.4

Description

Minimal subset of gentoo-kernel-bin for building modules, fo

Added to portage

2026-09-08

gitpython - 3.1.62
Ebuild name:

dev-python/gitpython-3.1.62

Description

Library used to interact with Git repositories

Added to portage

2026-09-08

hiredis - 1.1.1
Ebuild name:

dev-libs/hiredis-1.1.1

Description

Minimalistic C client library for the Redis database

Added to portage

2026-09-08

hiredis - 1.2.1
Ebuild name:

dev-libs/hiredis-1.2.1

Description

Minimalistic C client library for the Redis database

Added to portage

2026-09-08

hiredis - 1.3.1
Ebuild name:

dev-libs/hiredis-1.3.1

Description

Minimalistic C client library for the Redis database

Added to portage

2026-09-08

hiredis - 1.4.1
Ebuild name:

dev-libs/hiredis-1.4.1

Description

Minimalistic C client library for the Redis database

Added to portage

2026-09-08

jellyfin-bin - 12.0
Ebuild name:

www-apps/jellyfin-bin-12.0

Description

Jellyfin puts you in control of managing and streaming your media

Added to portage

2026-09-08

keymap-popup - 0.3.0
Ebuild name:

app-emacs/keymap-popup-0.3.0

Description

Described keymaps with popup help

Added to portage

2026-09-08

keywiz - 1.4
Ebuild name:

app-emacs/keywiz-1.4

Description

Emacs key sequence quiz

Added to portage

2026-09-08

kind-icon - 0.2.2
Ebuild name:

app-emacs/kind-icon-0.2.2

Description

Completion kind icons

Added to portage

2026-09-08

lc0 - 0.33.0_rc0
Ebuild name:

games-board/lc0-0.33.0_rc0

Description

Neural-network chess engine

Added to portage

2026-09-08

meson-python - 0.21.0
Ebuild name:

dev-python/meson-python-0.21.0

Description

Meson PEP 517 Python build backend

Added to portage

2026-09-08

netcdf - 4.10.1
Ebuild name:

sci-libs/netcdf-4.10.1

Description

Scientific library and interface for array oriented data access

Added to portage

2026-09-08

nlopt - 2.10.1
Ebuild name:

sci-libs/nlopt-2.10.1

Description

Non-linear optimization library

Added to portage

2026-09-08

ogdi - 4.1.1
Ebuild name:

sci-libs/ogdi-4.1.1

Description

Open Geographical Datastore Interface, a GIS support library

Added to portage

2026-09-08

openpgp-keys-bradking - 20260908
Ebuild name:

sec-keys/openpgp-keys-bradking-20260908

Description

OpenPGP keys used by Brad King

Added to portage

2026-09-08

peewee - 4.5.1
Ebuild name:

dev-python/peewee-4.5.1

Description

Small Python ORM

Added to portage

2026-09-08

pixi - 0.80.0
Ebuild name:

dev-util/pixi-0.80.0

Description

A package management and workflow tool

Added to portage

2026-09-08

pypdf - 6.18.0
Ebuild name:

dev-python/pypdf-6.18.0

Description

Python library to work with PDF files

Added to portage

2026-09-08

python-pkcs11 - 0.10.0
Ebuild name:

dev-python/python-pkcs11-0.10.0

Description

PKCS11/Cryptoki support for Python

Added to portage

2026-09-08

pytorch - 2.14.0-r2
Ebuild name:

sci-ml/pytorch-2.14.0-r2

Description

Tensors and Dynamic neural networks in Python with strong GPU acceleration

Added to portage

2026-09-08

pywavelets - 1.10.0
Ebuild name:

dev-python/pywavelets-1.10.0

Description

Discrete Wavelet Transforms in Python

Added to portage

2026-09-08

redis - 8.10.1
Ebuild name:

dev-db/redis-8.10.1

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-09-08

redis - 8.2.9
Ebuild name:

dev-db/redis-8.2.9

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-09-08

redis - 8.4.6
Ebuild name:

dev-db/redis-8.4.6

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-09-08

redis - 8.6.6
Ebuild name:

dev-db/redis-8.6.6

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-09-08

redis - 8.8.2
Ebuild name:

dev-db/redis-8.8.2

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-09-08

rg - 2.4.1
Ebuild name:

app-emacs/rg-2.4.1

Description

GNU Emacs search tool based on ripgrep

Added to portage

2026-09-08

roundcube - 1.6.19
Ebuild name:

mail-client/roundcube-1.6.19

Description

Browser-based multilingual IMAP client with an application-like user i

Added to portage

2026-09-08

roundcube - 1.7.4
Ebuild name:

mail-client/roundcube-1.7.4

Description

A browser-based multilingual IMAP client with an application-like user

Added to portage

2026-09-08

sip - 6.16.1-r1
Ebuild name:

dev-python/sip-6.16.1-r1

Description

Python bindings generator for C/C++ libraries

Added to portage

2026-09-08

smartctl_exporter - 0.12.0-r2
Ebuild name:

app-metrics/smartctl_exporter-0.12.0-r2

Description

Export smartctl statistics to prometheus

Added to portage

2026-09-08

torchvision - 0.29.0-r1
Ebuild name:

sci-ml/torchvision-0.29.0-r1

Description

Datasets, transforms and models to specific to computer vision

Added to portage

2026-09-08

urwid - 4.1.2
Ebuild name:

dev-python/urwid-4.1.2

Description

Curses-based user interface library for Python

Added to portage

2026-09-08

valkey - 9.1.2
Ebuild name:

dev-db/valkey-9.1.2

Description

Persistent key-value store, fork of dev-db/redis

Added to portage

2026-09-08

vanilla-kernel - 6.12.109
Ebuild name:

sys-kernel/vanilla-kernel-6.12.109

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-09-08

vanilla-kernel - 6.18.50
Ebuild name:

sys-kernel/vanilla-kernel-6.18.50

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-09-08

vanilla-kernel - 7.2.4
Ebuild name:

sys-kernel/vanilla-kernel-7.2.4

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-09-08

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