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:

84007

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-25
bitcoin-core - 31.0_rc1
Ebuild name:

net-p2p/bitcoin-core-31.0_rc1

Description

Reference implementation of the Bitcoin cryptocurrency

Added to portage

2026-03-25

dash - 0.5.13.2
Ebuild name:

app-shells/dash-0.5.13.2

Description

Debian Almquist Shell

Added to portage

2026-03-25

glib - 2.84.4-r3
Ebuild name:

dev-libs/glib-2.84.4-r3

Description

The GLib library of C routines

Added to portage

2026-03-25

glib - 2.86.4-r1
Ebuild name:

dev-libs/glib-2.86.4-r1

Description

The GLib library of C routines

Added to portage

2026-03-25

gst-plugins-libnice - 0.1.23
Ebuild name:

media-plugins/gst-plugins-libnice-0.1.23

Description

GStreamer plugin for ICE (RFC 5245) support

Added to portage

2026-03-25

libnice - 0.1.23-r1
Ebuild name:

net-libs/libnice-0.1.23-r1

Description

Implementation of the Interactice Connectivity Establishment standard (I

Added to portage

2026-03-25

marknote - 1.5.2
Ebuild name:

app-text/marknote-1.5.2

Description

Markdown editor with a wide range of formating options for everyday notes

Added to portage

2026-03-25

modus-themes - 5.1.0
Ebuild name:

app-emacs/modus-themes-5.1.0

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-03-25

qrca - 25.12.3-r1
Ebuild name:

media-gfx/qrca-25.12.3-r1

Description

Simple barcode scanner and QR code generator

Added to portage

2026-03-25

sssd - 2.12.0-r2
Ebuild name:

sys-auth/sssd-2.12.0-r2

Description

System Security Services Daemon provides access to identity and authenticat

Added to portage

2026-03-25

xpadneo - 0.10.1
Ebuild name:

games-util/xpadneo-0.10.1

Description

Advanced Linux Driver for Xbox One Wireless Controller

Added to portage

2026-03-25

2026-03-24
algol68g - 3.11.0
Ebuild name:

dev-lang/algol68g-3.11.0

Description

Algol 68 Genie compiler-interpreter

Added to portage

2026-03-24

awscli - 1.44.64
Ebuild name:

app-admin/awscli-1.44.64

Description

Universal Command Line Environment for AWS

Added to portage

2026-03-24

boto3 - 1.42.74
Ebuild name:

dev-python/boto3-1.42.74

Description

The AWS SDK for Python

Added to portage

2026-03-24

botocore - 1.42.74
Ebuild name:

dev-python/botocore-1.42.74

Description

Low-level, data-driven core of boto 3

Added to portage

2026-03-24

cdf - 3.9.1
Ebuild name:

sci-libs/cdf-3.9.1

Description

Common Data Format I/O library for multi-dimensional data sets

Added to portage

2026-03-24

cgnslib - 4.5.1
Ebuild name:

sci-libs/cgnslib-4.5.1

Description

CFD General Notation System standard library

Added to portage

2026-03-24

chrome-binary-plugins - 146.0.7680.164
Ebuild name:

www-plugins/chrome-binary-plugins-146.0.7680.164

Description

Binary plugins from Google Chrome for use in Chrom

Added to portage

2026-03-24

chromedriver-bin - 146.0.7680.165
Ebuild name:

www-apps/chromedriver-bin-146.0.7680.165

Description

WebDriver for Chrome

Added to portage

2026-03-24

chromium - 146.0.7680.164
Ebuild name:

www-client/chromium-146.0.7680.164

Description

Open-source version of Google Chrome web browser

Added to portage

2026-03-24

clblast - 1.5.3
Ebuild name:

sci-libs/clblast-1.5.3

Description

Tuned OpenCL BLAS

Added to portage

2026-03-24

clblast - 1.6.3
Ebuild name:

sci-libs/clblast-1.6.3

Description

Tuned OpenCL BLAS

Added to portage

2026-03-24

easycrypt - 2026.03
Ebuild name:

sci-mathematics/easycrypt-2026.03

Description

Computer-Aided Cryptographic Proofs

Added to portage

2026-03-24

faker - 40.11.1
Ebuild name:

dev-python/faker-40.11.1

Description

A Python package that generates fake data for you

Added to portage

2026-03-24

fcitx - 5.1.19
Ebuild name:

app-i18n/fcitx-5.1.19

Description

Fcitx 5 is a generic input method framework

Added to portage

2026-03-24

fcitx-chewing - 5.1.11
Ebuild name:

app-i18n/fcitx-chewing-5.1.11

Description

Chewing Wrapper for Fcitx.

Added to portage

2026-03-24

fcitx-chinese-addons - 5.1.12
Ebuild name:

app-i18n/fcitx-chinese-addons-5.1.12

Description

Addons related to Chinese, including IME previous bundled insi

Added to portage

2026-03-24

fcitx-configtool - 5.1.13
Ebuild name:

app-i18n/fcitx-configtool-5.1.13

Description

Configuration module for Fcitx

Added to portage

2026-03-24

fcitx-hangul - 5.1.9
Ebuild name:

app-i18n/fcitx-hangul-5.1.9

Description

Korean Hangul input method for Fcitx

Added to portage

2026-03-24

fcitx-lua - 5.0.16
Ebuild name:

app-i18n/fcitx-lua-5.0.16

Description

Lua support for fcitx

Added to portage

2026-03-24

fcitx-m17n - 5.1.6
Ebuild name:

app-i18n/fcitx-m17n-5.1.6

Description

m17n-provided input methods for Fcitx5

Added to portage

2026-03-24

fcitx-qt - 5.1.13
Ebuild name:

app-i18n/fcitx-qt-5.1.13

Description

Qt library and IM module for fcitx5

Added to portage

2026-03-24

fcitx-rime - 5.1.13
Ebuild name:

app-i18n/fcitx-rime-5.1.13

Description

Chinese RIME input methods for Fcitx

Added to portage

2026-03-24

fcitx-sayura - 5.1.6
Ebuild name:

app-i18n/fcitx-sayura-5.1.6

Description

Fcitx-Sayura is a Sinhala input method for Fcitx input method framework

Added to portage

2026-03-24

fcitx-table-extra - 5.1.11
Ebuild name:

app-i18n/fcitx-table-extra-5.1.11

Description

Provides extra table for Fcitx, including Boshiamy, Zhengma, Cang

Added to portage

2026-03-24

fcitx-table-other - 5.1.6
Ebuild name:

app-i18n/fcitx-table-other-5.1.6

Description

Provides some other tables for Fcitx, fork from ibus-table-others,

Added to portage

2026-03-24

fcitx-unikey - 5.1.10
Ebuild name:

app-i18n/fcitx-unikey-5.1.10

Description

Unikey (Vietnamese Input Method) engine support for Fcitx

Added to portage

2026-03-24

firefox - 140.9.0
Ebuild name:

www-client/firefox-140.9.0

Description

Firefox Web Browser

Added to portage

2026-03-24

firefox - 149.0
Ebuild name:

www-client/firefox-149.0

Description

Firefox Web Browser

Added to portage

2026-03-24

firefox-bin - 140.9.0
Ebuild name:

www-client/firefox-bin-140.9.0

Description

Firefox Web Browser

Added to portage

2026-03-24

firefox-l10n - 149.0
Ebuild name:

www-client/firefox-l10n-149.0

Description

Firefox Web Browser's translation files

Added to portage

2026-03-24

framework-tool-tui - 0.8.3
Ebuild name:

app-laptop/framework-tool-tui-0.8.3

Description

TUI for controlling and monitoring Framework Computers hardware

Added to portage

2026-03-24

freerdp - 3.24.0
Ebuild name:

net-misc/freerdp-3.24.0

Description

Free implementation of the Remote Desktop Protocol

Added to portage

2026-03-24

freerdp - 3.24.1
Ebuild name:

net-misc/freerdp-3.24.1

Description

Free implementation of the Remote Desktop Protocol

Added to portage

2026-03-24

glycin-loaders - 2.1.1
Ebuild name:

media-libs/glycin-loaders-2.1.1

Description

Loaders for glycin clients (glycin crate or libglycin)

Added to portage

2026-03-24

google-chrome - 146.0.7680.164
Ebuild name:

www-client/google-chrome-146.0.7680.164

Description

The web browser from Google

Added to portage

2026-03-24

handbrake - 1.11.1
Ebuild name:

media-video/handbrake-1.11.1

Description

Open-source, GPL-licensed, multiplatform, multithreaded video transcod

Added to portage

2026-03-24

hcloud - 2.17.1
Ebuild name:

dev-python/hcloud-2.17.1

Description

Official Hetzner Cloud python library

Added to portage

2026-03-24

jdupes - 1.31.1
Ebuild name:

app-misc/jdupes-1.31.1

Description

Identify duplicate files on the filesystem

Added to portage

2026-03-24

joplin-desktop - 3.6.6
Ebuild name:

app-office/joplin-desktop-3.6.6

Description

Secure note taking and to-do app with synchronization capabilities

Added to portage

2026-03-24

jsonnet - 0.22.0
Ebuild name:

dev-lang/jsonnet-0.22.0

Description

A data templating language for app and tool developers

Added to portage

2026-03-24

jsonpointer - 3.1.1
Ebuild name:

dev-python/jsonpointer-3.1.1

Description

Identify specific nodes in a JSON document (according to draft 08)

Added to portage

2026-03-24

keepsecret - 1.0.0
Ebuild name:

app-crypt/keepsecret-1.0.0

Description

Password manager GUI for SecretService providers

Added to portage

2026-03-24

kotlin-bin - 2.3.20
Ebuild name:

dev-lang/kotlin-bin-2.3.20

Description

Statically typed language that targets the JVM and JavaScript

Added to portage

2026-03-24

krita - 6.0.0
Ebuild name:

media-gfx/krita-6.0.0

Description

Free digital painting application. Digital Painting, Creative Freedom

Added to portage

2026-03-24

libavif - 1.4.1
Ebuild name:

media-libs/libavif-1.4.1

Description

Library for encoding and decoding .avif files

Added to portage

2026-03-24

libheif - 1.21.2
Ebuild name:

media-libs/libheif-1.21.2

Description

ISO/IEC 23008-12 HEIF file format decoder and encoder

Added to portage

2026-03-24

libime - 1.1.14
Ebuild name:

app-i18n/libime-1.1.14

Description

Fcitx5 Next generation of fcitx

Added to portage

2026-03-24

libjodycode - 4.1.2
Ebuild name:

dev-libs/libjodycode-4.1.2

Description

Shared code used by several utilities written by Jody Bruchon

Added to portage

2026-03-24

metakernel - 1.0.0
Ebuild name:

dev-python/metakernel-1.0.0

Description

Metakernel for Jupyter

Added to portage

2026-03-24

miniupnpd - 2.3.10
Ebuild name:

net-misc/miniupnpd-2.3.10

Description

MiniUPnP IGD Daemon

Added to portage

2026-03-24

mkp224o - 1.7.0
Ebuild name:

app-crypt/mkp224o-1.7.0

Description

Vanity address generator for v3 Tor hidden service addresses

Added to portage

2026-03-24

modus-themes - 5.2.0
Ebuild name:

app-emacs/modus-themes-5.2.0

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-03-24

monkeysphere - 0.44-r2
Ebuild name:

app-crypt/monkeysphere-0.44-r2

Description

Leverage the OpenPGP web of trust for OpenSSH and Web authentication

Added to portage

2026-03-24

nvidia-drivers - 595.58.03
Ebuild name:

x11-drivers/nvidia-drivers-595.58.03

Description

NVIDIA Accelerated Graphics Driver

Added to portage

2026-03-24

obs-move-transition - 3.2.1
Ebuild name:

media-plugins/obs-move-transition-3.2.1

Description

Move transition for OBS Studio

Added to portage

2026-03-24

obs-source-clone - 0.2.3
Ebuild name:

media-plugins/obs-source-clone-0.2.3

Description

Plugin for OBS Studio to clone sources

Added to portage

2026-03-24

obs-source-dock - 0.5.1
Ebuild name:

media-plugins/obs-source-dock-0.5.1

Description

Plugin for OBS Studio to add docks

Added to portage

2026-03-24

obs-source-record - 0.4.7
Ebuild name:

media-plugins/obs-source-record-0.4.7

Description

Plugin for OBS Studio to make sources available to record via

Added to portage

2026-03-24

obs-vkcapture - 1.5.5
Ebuild name:

media-plugins/obs-vkcapture-1.5.5

Description

OBS Linux Vulkan/OpenGL game capture

Added to portage

2026-03-24

ocaml-markdown - 0.2.1
Ebuild name:

dev-ml/ocaml-markdown-0.2.1

Description

Markdown parser and printer in OCaml

Added to portage

2026-03-24

openblas - 0.3.32
Ebuild name:

sci-libs/openblas-0.3.32

Description

Optimized BLAS library based on GotoBLAS2

Added to portage

2026-03-24

openmpi - 5.0.9-r1
Ebuild name:

sys-cluster/openmpi-5.0.9-r1

Description

A high-performance message passing library (MPI)

Added to portage

2026-03-24

openpgp-keys-handbrake - 20260311
Ebuild name:

sec-keys/openpgp-keys-handbrake-20260311

Description

OpenPGP keys used to sign HandBrake

Added to portage

2026-03-24

opera-developer - 130.0.5846.0
Ebuild name:

www-client/opera-developer-130.0.5846.0

Description

A fast and secure web browser

Added to portage

2026-03-24

pandora_box - 0.20.0
Ebuild name:

sys-apps/pandora_box-0.20.0

Description

Syd's log inspector & profile writer

Added to portage

2026-03-24

picard - 3.0.0_alpha4-r1
Ebuild name:

media-sound/picard-3.0.0_alpha4-r1

Description

Cross-platform music tagger

Added to portage

2026-03-24

pipdeptree - 2.34.0
Ebuild name:

dev-python/pipdeptree-2.34.0

Description

Utility for displaying installed packages in a dependency tree

Added to portage

2026-03-24

prek - 0.3.8
Ebuild name:

dev-util/prek-0.3.8

Description

Better `pre-commit`, re-engineered in Rust

Added to portage

2026-03-24

puremagic - 2.1.1
Ebuild name:

dev-python/puremagic-2.1.1

Description

Pure python implementation of magic file detection

Added to portage

2026-03-24

pylru - 1.2.2
Ebuild name:

dev-python/pylru-1.2.2

Description

A least recently used (LRU) cache for Python

Added to portage

2026-03-24

pypdf - 6.9.2
Ebuild name:

dev-python/pypdf-6.9.2

Description

Python library to work with PDF files

Added to portage

2026-03-24

rclone - 1.73.3
Ebuild name:

net-misc/rclone-1.73.3

Description

A program to sync files to and from various cloud storage providers

Added to portage

2026-03-24

sip - 6.15.3
Ebuild name:

dev-python/sip-6.15.3

Description

Python bindings generator for C/C++ libraries

Added to portage

2026-03-24

sphinx-autodoc-typehints - 3.9.10
Ebuild name:

dev-python/sphinx-autodoc-typehints-3.9.10

Description

Type hints support for the Sphinx autodoc extension

Added to portage

2026-03-24

sphobjinv - 2.4
Ebuild name:

dev-python/sphobjinv-2.4

Description

Sphinx objects.inv Inspection/Manipulation Tool

Added to portage

2026-03-24

subtitleeditor - 0.55.0-r1
Ebuild name:

media-video/subtitleeditor-0.55.0-r1

Description

GTK+3 subtitle editing tool

Added to portage

2026-03-24

svt-av1 - 4.0.1
Ebuild name:

media-libs/svt-av1-4.0.1

Description

Scalable Video Technology for AV1 (SVT-AV1 Encoder)

Added to portage

2026-03-24

swi-prolog - 10.0.2
Ebuild name:

dev-lang/swi-prolog-10.0.2

Description

Versatile implementation of the Prolog programming language

Added to portage

2026-03-24

syd - 3.51.0
Ebuild name:

sys-apps/syd-3.51.0

Description

seccomp and landlock based application sandbox with support for namespaces

Added to portage

2026-03-24

systemd - 260.1
Ebuild name:

sys-apps/systemd-260.1

Description

System and service manager for Linux

Added to portage

2026-03-24

systemd-utils - 260.1
Ebuild name:

sys-apps/systemd-utils-260.1

Description

Utilities split out from systemd for OpenRC users

Added to portage

2026-03-24

tempest - 46.2.0
Ebuild name:

dev-python/tempest-46.2.0

Description

OpenStack Integration Testing

Added to portage

2026-03-24

types-python-dateutil - 2.9.0.20260323
Ebuild name:

dev-python/types-python-dateutil-2.9.0.20260323

Description

Typing stubs for python-dateutil

Added to portage

2026-03-24

unzip - 6.0_p29-r1
Ebuild name:

app-arch/unzip-6.0_p29-r1

Description

unzipper for pkzip-compressed files

Added to portage

2026-03-24

uv - 0.11.0
Ebuild name:

dev-python/uv-0.11.0

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-03-24

uv-build - 0.11.0
Ebuild name:

dev-python/uv-build-0.11.0

Description

PEP517 uv build backend

Added to portage

2026-03-24

werkzeug - 3.1.7
Ebuild name:

dev-python/werkzeug-3.1.7

Description

Collection of various utilities for WSGI applications

Added to portage

2026-03-24

yoga - 3.2.1
Ebuild name:

dev-libs/yoga-3.2.1

Description

Cross-platform layout engine

Added to portage

2026-03-24

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