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:

88096

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-02
android-studio - 2026.1.4.7
Ebuild name:

dev-util/android-studio-2026.1.4.7

Description

Android development environment based on IntelliJ IDEA

Added to portage

2026-09-02

bitarray - 3.11.0
Ebuild name:

dev-python/bitarray-3.11.0

Description

Efficient arrays of booleans -- C extension

Added to portage

2026-09-02

boto3 - 1.43.86
Ebuild name:

dev-python/boto3-1.43.86

Description

The AWS SDK for Python

Added to portage

2026-09-02

botocore - 1.43.86
Ebuild name:

dev-python/botocore-1.43.86

Description

Low-level, data-driven core of boto 3

Added to portage

2026-09-02

deepmerge - 3.0.1
Ebuild name:

dev-python/deepmerge-3.0.1

Description

Tools to handle merging of nested data structures in python

Added to portage

2026-09-02

django-debug-toolbar - 8.0.0
Ebuild name:

dev-python/django-debug-toolbar-8.0.0

Description

A configurable set of panels that display various debug infor

Added to portage

2026-09-02

faker - 40.38.0
Ebuild name:

dev-python/faker-40.38.0

Description

A Python package that generates fake data for you

Added to portage

2026-09-02

fsautocomplete - 0.84.0
Ebuild name:

dev-dotnet/fsautocomplete-0.84.0

Description

F language server using the Language Server Protocol

Added to portage

2026-09-02

gajim - 2.6.0
Ebuild name:

net-im/gajim-2.6.0

Description

GTK XMPP Client

Added to portage

2026-09-02

gzip - 1.14_p20260901
Ebuild name:

app-arch/gzip-1.14_p20260901

Description

Standard GNU compressor

Added to portage

2026-09-02

ipython - 9.17.1
Ebuild name:

dev-python/ipython-9.17.1

Description

Advanced interactive shell for Python

Added to portage

2026-09-02

jwcrypto - 1.6.0
Ebuild name:

dev-python/jwcrypto-1.6.0

Description

Implements JWK,JWS,JWE specifications using python-cryptography

Added to portage

2026-09-02

libfastjson - 1.2609.0
Ebuild name:

dev-libs/libfastjson-1.2609.0

Description

Fork of the json-c library, which is optimized for liblognorm process

Added to portage

2026-09-02

libnftnl - 1.3.2
Ebuild name:

net-libs/libnftnl-1.3.2

Description

Netlink API to the in-kernel nf_tables subsystem

Added to portage

2026-09-02

lsp-ui - 9.0.0
Ebuild name:

app-emacs/lsp-ui-9.0.0

Description

UI modules for lsp-mode

Added to portage

2026-09-02

nftables - 1.1.7
Ebuild name:

net-firewall/nftables-1.1.7

Description

Linux kernel firewall, NAT and packet mangling tools

Added to portage

2026-09-02

noto - 20260901
Ebuild name:

media-fonts/noto-20260901

Description

Google's font family that aims to support all the world's languages

Added to portage

2026-09-02

openjdk - 11.0.32.1_p1
Ebuild name:

dev-java/openjdk-11.0.32.1_p1

Description

Open source implementation of the Java programming language

Added to portage

2026-09-02

openjdk - 17.0.20.1_p1
Ebuild name:

dev-java/openjdk-17.0.20.1_p1

Description

Open source implementation of the Java programming language

Added to portage

2026-09-02

openjdk - 21.0.12.1_p1
Ebuild name:

dev-java/openjdk-21.0.12.1_p1

Description

Open source implementation of the Java programming language

Added to portage

2026-09-02

openjdk - 25.0.4.1_p1
Ebuild name:

dev-java/openjdk-25.0.4.1_p1

Description

Open source implementation of the Java programming language

Added to portage

2026-09-02

openjdk - 27_beta35
Ebuild name:

dev-java/openjdk-27_beta35

Description

Open source implementation of the Java programming language

Added to portage

2026-09-02

openjdk - 28_alpha12
Ebuild name:

dev-java/openjdk-28_alpha12

Description

Open source implementation of the Java programming language

Added to portage

2026-09-02

openjdk - 8.504_p01
Ebuild name:

dev-java/openjdk-8.504_p01

Description

Open source implementation of the Java programming language

Added to portage

2026-09-02

openjdk-bin - 11.0.32.1_p1
Ebuild name:

dev-java/openjdk-bin-11.0.32.1_p1

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-09-02

openjdk-bin - 17.0.20.1_p1
Ebuild name:

dev-java/openjdk-bin-17.0.20.1_p1

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-09-02

openjdk-bin - 21.0.12.1_p1
Ebuild name:

dev-java/openjdk-bin-21.0.12.1_p1

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-09-02

openjdk-bin - 25.0.4.1_p1
Ebuild name:

dev-java/openjdk-bin-25.0.4.1_p1

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-09-02

openjdk-bin - 27_beta35
Ebuild name:

dev-java/openjdk-bin-27_beta35

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-09-02

openjdk-bin - 28_alpha13
Ebuild name:

dev-java/openjdk-bin-28_alpha13

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-09-02

openjdk-bin - 8.504_p01
Ebuild name:

dev-java/openjdk-bin-8.504_p01

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-09-02

openjdk-jre-bin - 11.0.32.1_p1
Ebuild name:

dev-java/openjdk-jre-bin-11.0.32.1_p1

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2026-09-02

openjdk-jre-bin - 17.0.20.1_p1
Ebuild name:

dev-java/openjdk-jre-bin-17.0.20.1_p1

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2026-09-02

openjdk-jre-bin - 21.0.12.1_p1
Ebuild name:

dev-java/openjdk-jre-bin-21.0.12.1_p1

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2026-09-02

openjdk-jre-bin - 25.0.4.1_p1
Ebuild name:

dev-java/openjdk-jre-bin-25.0.4.1_p1

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2026-09-02

openjdk-jre-bin - 8.504_p01
Ebuild name:

dev-java/openjdk-jre-bin-8.504_p01

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2026-09-02

pbs-installer - 2026.9.1
Ebuild name:

dev-python/pbs-installer-2026.9.1

Description

Installer for Python Build Standalone

Added to portage

2026-09-02

php - 8.4.25
Ebuild name:

dev-lang/php-8.4.25

Description

The PHP language runtime engine

Added to portage

2026-09-02

php - 8.5.10
Ebuild name:

dev-lang/php-8.5.10

Description

The PHP language runtime engine

Added to portage

2026-09-02

platformdirs - 4.11.7
Ebuild name:

dev-python/platformdirs-4.11.7

Description

A small Python module for determining appropriate platform-specific

Added to portage

2026-09-02

python-cinderclient - 9.10.0
Ebuild name:

dev-python/python-cinderclient-9.10.0

Description

A client for the OpenStack Cinder API

Added to portage

2026-09-02

setuptools-scm - 10.2.2
Ebuild name:

dev-python/setuptools-scm-10.2.2

Description

Manage versions by scm tags via setuptools

Added to portage

2026-09-02

shtab - 1.12.1
Ebuild name:

dev-python/shtab-1.12.1

Description

Automagic shell tab completion for Python CLI applications

Added to portage

2026-09-02

sphinx-autodoc-typehints - 3.13.5
Ebuild name:

dev-python/sphinx-autodoc-typehints-3.13.5

Description

Type hints support for the Sphinx autodoc extension

Added to portage

2026-09-02

sphinxcontrib-mermaid - 2.1.1
Ebuild name:

dev-python/sphinxcontrib-mermaid-2.1.1

Description

Sphinx spelling extension

Added to portage

2026-09-02

stripe - 15.6.1
Ebuild name:

dev-python/stripe-15.6.1

Description

Stripe Python bindings

Added to portage

2026-09-02

systemd - 262_rc1
Ebuild name:

sys-apps/systemd-262_rc1

Description

System and service manager for Linux

Added to portage

2026-09-02

translate-toolkit - 3.19.19
Ebuild name:

dev-python/translate-toolkit-3.19.19

Description

Toolkit to convert between many translation formats

Added to portage

2026-09-02

uv - 0.12.9
Ebuild name:

dev-python/uv-0.12.9

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-09-02

uv-build - 0.12.9
Ebuild name:

dev-python/uv-build-0.12.9

Description

PEP517 uv build backend

Added to portage

2026-09-02

2026-09-01
blessed - 1.49.0
Ebuild name:

dev-python/blessed-1.49.0

Description

Library for making terminal apps using colors, keyboard input and positio

Added to portage

2026-09-01

boto3 - 1.43.85
Ebuild name:

dev-python/boto3-1.43.85

Description

The AWS SDK for Python

Added to portage

2026-09-01

botocore - 1.43.85
Ebuild name:

dev-python/botocore-1.43.85

Description

Low-level, data-driven core of boto 3

Added to portage

2026-09-01

c-blosc2 - 3.3.3
Ebuild name:

dev-libs/c-blosc2-3.3.3

Description

Blocking, shuffling and lossless compression library

Added to portage

2026-09-01

cachetools - 7.1.8
Ebuild name:

dev-python/cachetools-7.1.8

Description

Extensible memoizing collections and decorators

Added to portage

2026-09-01

cfn-lint - 1.56.0
Ebuild name:

dev-python/cfn-lint-1.56.0

Description

CloudFormation Linter

Added to portage

2026-09-01

cssselect2 - 0.10.1
Ebuild name:

dev-python/cssselect2-0.10.1

Description

Parses CSS3 Selectors and translates them to XPath 1.0

Added to portage

2026-09-01

darktable - 5.6.1
Ebuild name:

media-gfx/darktable-5.6.1

Description

A virtual lighttable and darkroom for photographers

Added to portage

2026-09-01

dist-kernel - 7.2.2
Ebuild name:

virtual/dist-kernel-7.2.2

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-09-01

filelock - 3.32.5
Ebuild name:

dev-python/filelock-3.32.5

Description

A platform independent file lock for Python

Added to portage

2026-09-01

firefox - 155.0
Ebuild name:

www-client/firefox-155.0

Description

Firefox Web Browser

Added to portage

2026-09-01

firefox-bin - 155.0
Ebuild name:

www-client/firefox-bin-155.0

Description

Firefox Web Browser

Added to portage

2026-09-01

firefox-l10n - 155.0
Ebuild name:

www-client/firefox-l10n-155.0

Description

Firefox Web Browser's translation files

Added to portage

2026-09-01

fonttools - 4.64.0
Ebuild name:

dev-python/fonttools-4.64.0

Description

Library for manipulating TrueType, OpenType, AFM and Type1 fonts

Added to portage

2026-09-01

gentoo-kernel - 7.2.2
Ebuild name:

sys-kernel/gentoo-kernel-7.2.2

Description

Linux kernel built with Gentoo patches

Added to portage

2026-09-01

gentoo-kernel-bin - 7.2.2
Ebuild name:

sys-kernel/gentoo-kernel-bin-7.2.2

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-09-01

gentoo-kernel-modprep - 7.2.2
Ebuild name:

sys-kernel/gentoo-kernel-modprep-7.2.2

Description

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

Added to portage

2026-09-01

google-api-python-client - 2.200.0
Ebuild name:

dev-python/google-api-python-client-2.200.0

Description

Google API Client for Python

Added to portage

2026-09-01

gpxsee - 16.14
Ebuild name:

sci-geosciences/gpxsee-16.14

Description

Viewer and analyzer that supports gpx, tcx, kml, fit, igc and nmea fil

Added to portage

2026-09-01

grub - 2.16_rc2
Ebuild name:

sys-boot/grub-2.16_rc2

Description

GNU GRUB boot loader

Added to portage

2026-09-01

joblib - 1.6.0
Ebuild name:

dev-python/joblib-1.6.0

Description

Tools to provide lightweight pipelining in Python

Added to portage

2026-09-01

kgpg - 26.04.3-r1
Ebuild name:

kde-apps/kgpg-26.04.3-r1

Description

Frontend for GnuPG, a powerful encryption utility by KDE

Added to portage

2026-09-01

kgpg - 26.08.0-r1
Ebuild name:

kde-apps/kgpg-26.08.0-r1

Description

Frontend for GnuPG, a powerful encryption utility by KDE

Added to portage

2026-09-01

kquickimageeditor - 0.7.0
Ebuild name:

media-libs/kquickimageeditor-0.7.0

Description

QtQuick components providing basic image editing capabilities

Added to portage

2026-09-01

libtlsrpt - 0.5.1
Ebuild name:

net-libs/libtlsrpt-0.5.1

Description

library to implement TLSRPT

Added to portage

2026-09-01

loky - 3.6.0
Ebuild name:

dev-python/loky-3.6.0

Description

Robust and reusable Executor for joblib

Added to portage

2026-09-01

nvidia-drivers - 595.99.02
Ebuild name:

x11-drivers/nvidia-drivers-595.99.02

Description

NVIDIA Accelerated Graphics Driver

Added to portage

2026-09-01

nxml-gentoo-schemas - 20260901
Ebuild name:

app-emacs/nxml-gentoo-schemas-20260901

Description

Extension for nxml-mode with Gentoo-specific schemas

Added to portage

2026-09-01

openpgp-keys-lsandova - 20260831
Ebuild name:

sec-keys/openpgp-keys-lsandova-20260831

Description

OpenPGP key for Leo Sandoval

Added to portage

2026-09-01

openstacksdk - 4.20.0
Ebuild name:

dev-python/openstacksdk-4.20.0

Description

A collection of libraries for building applications to work with Ope

Added to portage

2026-09-01

psycopg - 3.3.5
Ebuild name:

dev-python/psycopg-3.3.5

Description

PostgreSQL database adapter for Python

Added to portage

2026-09-01

python - 0.3.15.0_rc2
Ebuild name:

dev-lang/python-0.3.15.0_rc2

Description

Freethreading (no-GIL) version of Python programming language

Added to portage

2026-09-01

python - 3.15.0_rc2
Ebuild name:

dev-lang/python-3.15.0_rc2

Description

An interpreted, interactive, object-oriented programming language

Added to portage

2026-09-01

python-tests - 0.3.15.0_rc2
Ebuild name:

dev-python/python-tests-0.3.15.0_rc2

Description

Test modules from dev-lang/python

Added to portage

2026-09-01

python-tests - 3.15.0_rc2
Ebuild name:

dev-python/python-tests-3.15.0_rc2

Description

Test modules from dev-lang/python

Added to portage

2026-09-01

regex - 2026.9.3
Ebuild name:

dev-python/regex-2026.9.3

Description

Alternative regular expression module to replace re

Added to portage

2026-09-01

sbcl - 2.6.8
Ebuild name:

dev-lisp/sbcl-2.6.8

Description

Steel Bank Common Lisp (SBCL) is an implementation of ANSI Common Lisp

Added to portage

2026-09-01

sqlalchemy - 2.1.0_rc1
Ebuild name:

dev-python/sqlalchemy-2.1.0_rc1

Description

Python SQL toolkit and Object Relational Mapper

Added to portage

2026-09-01

tavern - 3.6.3
Ebuild name:

dev-python/tavern-3.6.3

Description

A tool, library, and Pytest plugin for testing RESTful APIs

Added to portage

2026-09-01

telegram-desktop-bin - 7.1.3
Ebuild name:

net-im/telegram-desktop-bin-7.1.3

Description

Official desktop client for Telegram (binary package)

Added to portage

2026-09-01

throttled - 0.12.2-r1
Ebuild name:

sys-power/throttled-0.12.2-r1

Description

Daemon to work around throttling issues on some Intel laptops

Added to portage

2026-09-01

tlsrpt-reporter - 0.6.0
Ebuild name:

net-mail/tlsrpt-reporter-0.6.0

Description

tools and daemons to implement TLSRPT services

Added to portage

2026-09-01

tox - 4.61.2
Ebuild name:

dev-python/tox-4.61.2

Description

virtualenv-based automation of test activities

Added to portage

2026-09-01

trimesh - 5.1.0
Ebuild name:

dev-python/trimesh-5.1.0

Description

Python library for loading and using triangular meshes

Added to portage

2026-09-01

uv - 0.12.8
Ebuild name:

dev-python/uv-0.12.8

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-09-01

uv-build - 0.12.8
Ebuild name:

dev-python/uv-build-0.12.8

Description

PEP517 uv build backend

Added to portage

2026-09-01

vanilla-kernel - 7.2.2
Ebuild name:

sys-kernel/vanilla-kernel-7.2.2

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-09-01

websocket-client - 1.9.2
Ebuild name:

dev-python/websocket-client-1.9.2

Description

WebSocket client for python with hybi13 support

Added to portage

2026-09-01

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