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:

84544

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-04-21
awscli - 1.44.82
Ebuild name:

app-admin/awscli-1.44.82

Description

Universal Command Line Environment for AWS

Added to portage

2026-04-21

boto3 - 1.42.92
Ebuild name:

dev-python/boto3-1.42.92

Description

The AWS SDK for Python

Added to portage

2026-04-21

botocore - 1.42.92
Ebuild name:

dev-python/botocore-1.42.92

Description

Low-level, data-driven core of boto 3

Added to portage

2026-04-21

cachetools - 7.0.6
Ebuild name:

dev-python/cachetools-7.0.6

Description

Extensible memoizing collections and decorators

Added to portage

2026-04-21

cfn-lint - 1.49.0
Ebuild name:

dev-python/cfn-lint-1.49.0

Description

CloudFormation Linter

Added to portage

2026-04-21

clang - 22.1.4
Ebuild name:

dev-python/clang-22.1.4

Description

Python bindings for llvm-core/clang

Added to portage

2026-04-21

clang - 22.1.4
Ebuild name:

llvm-core/clang-22.1.4

Description

C language family frontend for LLVM

Added to portage

2026-04-21

clang-common - 22.1.4
Ebuild name:

llvm-core/clang-common-22.1.4

Description

Common files shared between multiple slots of clang

Added to portage

2026-04-21

firefox - 140.10.0
Ebuild name:

www-client/firefox-140.10.0

Description

Firefox Web Browser

Added to portage

2026-04-21

firefox - 150.0
Ebuild name:

www-client/firefox-150.0

Description

Firefox Web Browser

Added to portage

2026-04-21

firefox-bin - 140.10.0
Ebuild name:

www-client/firefox-bin-140.10.0

Description

Firefox Web Browser

Added to portage

2026-04-21

firefox-l10n - 150.0
Ebuild name:

www-client/firefox-l10n-150.0

Description

Firefox Web Browser's translation files

Added to portage

2026-04-21

flang - 22.1.4
Ebuild name:

llvm-core/flang-22.1.4

Description

LLVM's Fortran frontend

Added to portage

2026-04-21

git - 2.54.0
Ebuild name:

dev-vcs/git-2.54.0

Description

Stupid content tracker distributed VCS designed for speed and efficiency

Added to portage

2026-04-21

htmlcxx - 0.87-r1
Ebuild name:

dev-cpp/htmlcxx-0.87-r1

Description

A simple non-validating CSS 1 and HTML parser for C++

Added to portage

2026-04-21

jupyter-events - 0.12.1
Ebuild name:

dev-python/jupyter-events-0.12.1

Description

Jupyter Event System library

Added to portage

2026-04-21

libclc - 22.1.4
Ebuild name:

llvm-core/libclc-22.1.4

Description

OpenCL C library

Added to portage

2026-04-21

libdbusmenu-lxqt - 0.4.0
Ebuild name:

dev-libs/libdbusmenu-lxqt-0.4.0

Description

LXQt DBusMenu Implementation

Added to portage

2026-04-21

liblouis - 3.37.0-r1
Ebuild name:

dev-libs/liblouis-3.37.0-r1

Description

An open-source braille translator and back-translator

Added to portage

2026-04-21

libqtxdg - 4.4.0
Ebuild name:

dev-libs/libqtxdg-4.4.0

Description

Qt Implementation of XDG Standards

Added to portage

2026-04-21

lit - 22.1.4
Ebuild name:

dev-python/lit-22.1.4

Description

A stand-alone install of the LLVM suite testing tool

Added to portage

2026-04-21

lld - 22.1.4
Ebuild name:

llvm-core/lld-22.1.4

Description

The LLVM linker (link editor)

Added to portage

2026-04-21

lldb - 22.1.4
Ebuild name:

llvm-core/lldb-22.1.4

Description

The LLVM debugger

Added to portage

2026-04-21

llvm - 22.1.4
Ebuild name:

dev-ml/llvm-22.1.4

Description

OCaml bindings for LLVM

Added to portage

2026-04-21

llvm - 22.1.4
Ebuild name:

llvm-core/llvm-22.1.4

Description

Low Level Virtual Machine

Added to portage

2026-04-21

llvm-common - 22.1.4
Ebuild name:

llvm-core/llvm-common-22.1.4

Description

Common files shared between multiple slots of LLVM

Added to portage

2026-04-21

lxqt-archiver - 1.4.0
Ebuild name:

app-arch/lxqt-archiver-1.4.0

Description

Qt GUI File Archiver

Added to portage

2026-04-21

lxqt-build-tools - 2.4.0
Ebuild name:

dev-util/lxqt-build-tools-2.4.0

Description

LXQt Build Tools

Added to portage

2026-04-21

meson - 1.11.1
Ebuild name:

dev-build/meson-1.11.1

Description

Open source build system

Added to portage

2026-04-21

mlir - 22.1.4
Ebuild name:

llvm-core/mlir-22.1.4

Description

Multi-Level Intermediate Representation (library only)

Added to portage

2026-04-21

narwhals - 2.20.0
Ebuild name:

dev-python/narwhals-2.20.0

Description

Extremely lightweight compatibility layer between dataframe libraries

Added to portage

2026-04-21

nxml-libvirt-schemas - 11.10.0
Ebuild name:

app-emacs/nxml-libvirt-schemas-11.10.0

Description

Extension for nxml-mode with libvirt schemas

Added to portage

2026-04-21

nxml-libvirt-schemas - 12.0.0
Ebuild name:

app-emacs/nxml-libvirt-schemas-12.0.0

Description

Extension for nxml-mode with libvirt schemas

Added to portage

2026-04-21

openhab-bin - 5.1.4
Ebuild name:

app-misc/openhab-bin-5.1.4

Description

An open-source automation software for your home

Added to portage

2026-04-21

oslotest - 6.1.1
Ebuild name:

dev-python/oslotest-6.1.1

Description

Oslo test framework

Added to portage

2026-04-21

pdm - 2.26.8
Ebuild name:

dev-python/pdm-2.26.8

Description

Python package and dependency manager supporting the latest PEP standards

Added to portage

2026-04-21

pelican - 4.12.0
Ebuild name:

app-text/pelican-4.12.0

Description

A tool to generate a static blog, with restructured text or markdown input

Added to portage

2026-04-21

pixi - 0.67.1
Ebuild name:

dev-util/pixi-0.67.1

Description

A package management and workflow tool

Added to portage

2026-04-21

polly - 22.1.4
Ebuild name:

llvm-core/polly-22.1.4

Description

Polyhedral optimizations for LLVM

Added to portage

2026-04-21

psycopg - 2.9.12
Ebuild name:

dev-python/psycopg-2.9.12

Description

PostgreSQL database adapter for Python

Added to portage

2026-04-21

pydantic - 2.13.3
Ebuild name:

dev-python/pydantic-2.13.3

Description

Data parsing and validation using Python type hints

Added to portage

2026-04-21

pydantic-settings - 2.14.0
Ebuild name:

dev-python/pydantic-settings-2.14.0

Description

Settings management using Pydantic

Added to portage

2026-04-21

pymongo - 4.17.0
Ebuild name:

dev-python/pymongo-4.17.0

Description

Python driver for MongoDB

Added to portage

2026-04-21

qtxdg-tools - 4.4.0
Ebuild name:

app-misc/qtxdg-tools-4.4.0

Description

User Tools from libqtxdg

Added to portage

2026-04-21

radarr-bin - 6.2.0.10390
Ebuild name:

www-apps/radarr-bin-6.2.0.10390

Description

A fork of Sonarr to work with movies a la Couchpotato

Added to portage

2026-04-21

rpi-eeprom - 28.15_p1
Ebuild name:

dev-embedded/rpi-eeprom-28.15_p1

Description

Updater for Raspberry Pi 4/5 bootloader and the VL805 USB controll

Added to portage

2026-04-21

rutorrent - 5.3.0
Ebuild name:

www-apps/rutorrent-5.3.0

Description

ruTorrent is a front-end for the popular Bittorrent client rTorrent

Added to portage

2026-04-21

spectre-meltdown-checker - 26.33.0420460
Ebuild name:

app-admin/spectre-meltdown-checker-26.33.0420460

Description

Spectre & Meltdown vulnerability/mitigation ch

Added to portage

2026-04-21

sqlglot - 30.6.0
Ebuild name:

dev-python/sqlglot-30.6.0

Description

An easily customizable SQL parser and transpiler

Added to portage

2026-04-21

xdg-desktop-portal-lxqt - 1.4.0
Ebuild name:

gui-libs/xdg-desktop-portal-lxqt-1.4.0

Description

Backend implementation for xdg-desktop-portal using Qt/KF5/l

Added to portage

2026-04-21

2026-04-20
amule - 2.3.3-r8
Ebuild name:

net-p2p/amule-2.3.3-r8

Description

aMule, the all-platform eMule p2p client

Added to portage

2026-04-20

bluez-alsa - 4.3.1-r2
Ebuild name:

media-sound/bluez-alsa-4.3.1-r2

Description

Bluetooth Audio ALSA Backend

Added to portage

2026-04-20

coreutils - 9.11
Ebuild name:

sys-apps/coreutils-9.11

Description

Standard GNU utilities (chmod, cp, dd, ls, sort, tr, head, wc, who,...)

Added to portage

2026-04-20

filelock - 3.29.0
Ebuild name:

dev-python/filelock-3.29.0

Description

A platform independent file lock for Python

Added to portage

2026-04-20

firefox-bin - 150.0
Ebuild name:

www-client/firefox-bin-150.0

Description

Firefox Web Browser

Added to portage

2026-04-20

gcc - 16.0.1_p20260419
Ebuild name:

sys-devel/gcc-16.0.1_p20260419

Description

The GNU Compiler Collection

Added to portage

2026-04-20

gentoo-sources - 5.10.253
Ebuild name:

sys-kernel/gentoo-sources-5.10.253

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-04-20

gentoo-sources - 5.15.203
Ebuild name:

sys-kernel/gentoo-sources-5.15.203

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-04-20

gentoo-sources - 6.1.169
Ebuild name:

sys-kernel/gentoo-sources-6.1.169

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-04-20

gentoo-sources - 6.12.82
Ebuild name:

sys-kernel/gentoo-sources-6.12.82

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-04-20

gentoo-sources - 6.18.23
Ebuild name:

sys-kernel/gentoo-sources-6.18.23

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-04-20

gentoo-sources - 6.19.13
Ebuild name:

sys-kernel/gentoo-sources-6.19.13

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-04-20

gentoo-sources - 6.6.135
Ebuild name:

sys-kernel/gentoo-sources-6.6.135

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-04-20

gentoolkit - 0.7.2
Ebuild name:

app-portage/gentoolkit-0.7.2

Description

Collection of administration scripts for Gentoo

Added to portage

2026-04-20

ghostty - 1.3.1
Ebuild name:

x11-terms/ghostty-1.3.1

Description

Fast, feature-rich, and cross-platform terminal emulator

Added to portage

2026-04-20

ghostty-terminfo - 1.3.1
Ebuild name:

x11-terms/ghostty-terminfo-1.3.1

Description

Terminfo for ghostty, a fast, feature-rich, and cross-platform ter

Added to portage

2026-04-20

hash-slinger - 3.5
Ebuild name:

net-dns/hash-slinger-3.5

Description

Various tools to generate DNS records like SSHFP, TLSA, OPENPGPKEY, IPSECK

Added to portage

2026-04-20

img2pdf - 0.6.3
Ebuild name:

media-gfx/img2pdf-0.6.3

Description

Losslessly convert raster images to PDF

Added to portage

2026-04-20

irker - 2.25
Ebuild name:

net-irc/irker-2.25

Description

Submission tools for IRC notifications

Added to portage

2026-04-20

libquo - 1.3.1-r3
Ebuild name:

sys-cluster/libquo-1.3.1-r3

Description

Run-time tuning of process binding policies made easy

Added to portage

2026-04-20

libtmux - 0.55.1
Ebuild name:

dev-python/libtmux-0.55.1

Description

Typed library that provides an ORM wrapper for tmux, a terminal multiplex

Added to portage

2026-04-20

lyx - 2.5.1
Ebuild name:

app-office/lyx-2.5.1

Description

WYSIWYM (What You See Is What You Mean) document processor based on LaTeX

Added to portage

2026-04-20

mate-calc - 1.28.0-r2
Ebuild name:

mate-extra/mate-calc-1.28.0-r2

Description

Calculator for MATE

Added to portage

2026-04-20

md5deep - 4.4
Ebuild name:

app-crypt/md5deep-4.4

Description

Expanded md5sum program with recursive and comparison options

Added to portage

2026-04-20

md6sum - 1.0-r3
Ebuild name:

app-crypt/md6sum-1.0-r3

Description

A C implementation of MD6

Added to portage

2026-04-20

minted - 3.4.0-r1
Ebuild name:

dev-tex/minted-3.4.0-r1

Description

LaTeX package for source code syntax highlighting

Added to portage

2026-04-20

nbxmpp - 7.2.0
Ebuild name:

dev-python/nbxmpp-7.2.0

Description

Python library to use Jabber/XMPP networks in a non-blocking way

Added to portage

2026-04-20

nikola - 8.3.3-r1
Ebuild name:

www-apps/nikola-8.3.3-r1

Description

A static website and blog generator

Added to portage

2026-04-20

pybind11 - 3.0.4
Ebuild name:

dev-python/pybind11-3.0.4

Description

AST-based Python refactoring library

Added to portage

2026-04-20

pygobject - 3.56.2
Ebuild name:

dev-python/pygobject-3.56.2

Description

Python bindings for GObject Introspection

Added to portage

2026-04-20

safeeyes - 3.4.1
Ebuild name:

x11-misc/safeeyes-3.4.1

Description

Linux alternative to EyeLeo

Added to portage

2026-04-20

skopeo - 1.22.2
Ebuild name:

app-containers/skopeo-1.22.2

Description

Work with remote container images registries

Added to portage

2026-04-20

starship - 1.25.0
Ebuild name:

app-shells/starship-1.25.0

Description

The minimal, blazing-fast, and infinitely customizable prompt for any sh

Added to portage

2026-04-20

testdisk - 7.2-r1
Ebuild name:

app-admin/testdisk-7.2-r1

Description

Checks and undeletes partitions + PhotoRec, signature based recovery tool

Added to portage

2026-04-20

vlc - 4.0.0_pre20260418
Ebuild name:

media-video/vlc-4.0.0_pre20260418

Description

Media player and framework with support for most multimedia files

Added to portage

2026-04-20

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