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:

86391

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-06-29
botan - 3.12.0
Ebuild name:

dev-libs/botan-3.12.0

Description

C++ crypto library

Added to portage

2026-06-29

clang - 23.0.0_pre20260628
Ebuild name:

dev-python/clang-23.0.0_pre20260628

Description

Python bindings for llvm-core/clang

Added to portage

2026-06-29

clang - 23.0.0_pre20260628
Ebuild name:

llvm-core/clang-23.0.0_pre20260628

Description

C language family frontend for LLVM

Added to portage

2026-06-29

clang-common - 23.0.0_pre20260628
Ebuild name:

llvm-core/clang-common-23.0.0_pre20260628

Description

Common files shared between multiple slots of clang

Added to portage

2026-06-29

compiler-rt - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/compiler-rt-23.0.0_pre20260628

Description

Compiler runtime library for clang (built-in part)

Added to portage

2026-06-29

compiler-rt-sanitizers - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/compiler-rt-sanitizers-23.0.0_pre20260628

Description

Compiler runtime libraries for clang (sanit

Added to portage

2026-06-29

flang - 23.0.0_pre20260628
Ebuild name:

llvm-core/flang-23.0.0_pre20260628

Description

LLVM's Fortran frontend

Added to portage

2026-06-29

flang-rt - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/flang-rt-23.0.0_pre20260628

Description

LLVM's Fortran runtime

Added to portage

2026-06-29

gcc - 17.0.0_p20260628
Ebuild name:

sys-devel/gcc-17.0.0_p20260628

Description

The GNU Compiler Collection

Added to portage

2026-06-29

gdbus-codegen - 2.88.2
Ebuild name:

dev-util/gdbus-codegen-2.88.2

Description

GDBus code and documentation generator

Added to portage

2026-06-29

gentoo-zsh-completions - 20260628.1
Ebuild name:

app-shells/gentoo-zsh-completions-20260628.1

Description

Gentoo specific zsh completion support (includes emerg

Added to portage

2026-06-29

git-sources - 7.2_rc1
Ebuild name:

sys-kernel/git-sources-7.2_rc1

Description

The very latest -git version of the Linux kernel

Added to portage

2026-06-29

glib - 2.88.2
Ebuild name:

dev-libs/glib-2.88.2

Description

The GLib library of C routines

Added to portage

2026-06-29

glib-utils - 2.88.2
Ebuild name:

dev-util/glib-utils-2.88.2

Description

Build utilities for GLib using projects

Added to portage

2026-06-29

glibmm - 2.88.1
Ebuild name:

dev-cpp/glibmm-2.88.1

Description

C++ interface for glib2

Added to portage

2026-06-29

ldns - 1.9.2
Ebuild name:

net-libs/ldns-1.9.2

Description

Library that aims to simplify DNS programming in C

Added to portage

2026-06-29

libclc - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/libclc-23.0.0_pre20260628

Description

OpenCL C library

Added to portage

2026-06-29

libcxx - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/libcxx-23.0.0_pre20260628

Description

New implementation of the C++ standard library, targeting C

Added to portage

2026-06-29

libcxxabi - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/libcxxabi-23.0.0_pre20260628

Description

Low level support for a standard C++ library

Added to portage

2026-06-29

libgcc - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/libgcc-23.0.0_pre20260628

Description

Compiler runtime library for clang, compatible with libgcc_

Added to portage

2026-06-29

libunwind - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/libunwind-23.0.0_pre20260628

Description

C++ runtime stack unwinder from LLVM

Added to portage

2026-06-29

lit - 23.0.0_pre20260628
Ebuild name:

dev-python/lit-23.0.0_pre20260628

Description

A stand-alone install of the LLVM suite testing tool

Added to portage

2026-06-29

lld - 23.0.0_pre20260628
Ebuild name:

llvm-core/lld-23.0.0_pre20260628

Description

The LLVM linker (link editor)

Added to portage

2026-06-29

lldb - 23.0.0_pre20260628
Ebuild name:

llvm-core/lldb-23.0.0_pre20260628

Description

The LLVM debugger

Added to portage

2026-06-29

llvm - 23.0.0_pre20260628
Ebuild name:

dev-ml/llvm-23.0.0_pre20260628

Description

OCaml bindings for LLVM

Added to portage

2026-06-29

llvm - 23.0.0_pre20260628
Ebuild name:

llvm-core/llvm-23.0.0_pre20260628

Description

Low Level Virtual Machine

Added to portage

2026-06-29

llvm-common - 23.0.0_pre20260628
Ebuild name:

llvm-core/llvm-common-23.0.0_pre20260628

Description

Common files shared between multiple slots of LLVM

Added to portage

2026-06-29

mlir - 23.0.0_pre20260628
Ebuild name:

llvm-core/mlir-23.0.0_pre20260628

Description

Multi-Level Intermediate Representation (library only)

Added to portage

2026-06-29

moor - 2.15.1
Ebuild name:

sys-apps/moor-2.15.1

Description

Pager designed to do the right thing without any configuration

Added to portage

2026-06-29

openmp - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/openmp-23.0.0_pre20260628

Description

OpenMP runtime libraries for LLVM/clang compiler

Added to portage

2026-06-29

openmp-amdgcn-amd-amdhsa - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/openmp-amdgcn-amd-amdhsa-23.0.0_pre20260628

Description

OpenMP target library for amdgcn devices

Added to portage

2026-06-29

openmp-nvptx64-nvidia-cuda - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/openmp-nvptx64-nvidia-cuda-23.0.0_pre20260628

Description

OpenMP target library for nvptx64 devic

Added to portage

2026-06-29

openmp-spirv64-intel - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/openmp-spirv64-intel-23.0.0_pre20260628

Description

OpenMP target library for spirv64 Intel devic

Added to portage

2026-06-29

polly - 23.0.0_pre20260628
Ebuild name:

llvm-core/polly-23.0.0_pre20260628

Description

Polyhedral optimizations for LLVM

Added to portage

2026-06-29

quimup - 2.1.2
Ebuild name:

media-sound/quimup-2.1.2

Description

Qt client for the music player daemon (MPD)

Added to portage

2026-06-29

sqlite - 3.53.3
Ebuild name:

dev-db/sqlite-3.53.3

Description

SQL database engine

Added to portage

2026-06-29

squid - 7.6
Ebuild name:

net-proxy/squid-7.6

Description

Full-featured web proxy cache

Added to portage

2026-06-29

2026-06-28
GnuPG-Interface - 1.70.0
Ebuild name:

dev-perl/GnuPG-Interface-1.70.0

Description

Perl interface to GnuPG

Added to portage

2026-06-28

ardour - 9.7.0-r1
Ebuild name:

media-sound/ardour-9.7.0-r1

Description

Digital Audio Workstation

Added to portage

2026-06-28

asyncssh - 2.24.0
Ebuild name:

dev-python/asyncssh-2.24.0

Description

Asynchronous SSHv2 client and server library

Added to portage

2026-06-28

atari800 - 7.0.0
Ebuild name:

games-emulation/atari800-7.0.0

Description

Emulator of Atari 8-bit computer systems and 5200 game console

Added to portage

2026-06-28

audacity - 3.7.8
Ebuild name:

media-sound/audacity-3.7.8

Description

Free crossplatform audio editor

Added to portage

2026-06-28

chromium - 149.0.7827.200
Ebuild name:

www-client/chromium-149.0.7827.200

Description

Open-source version of Google Chrome web browser

Added to portage

2026-06-28

fastfetch - 2.65.2
Ebuild name:

app-misc/fastfetch-2.65.2

Description

Fast neofetch-like system information tool

Added to portage

2026-06-28

gcc - 13.4.1_p20260624
Ebuild name:

sys-devel/gcc-13.4.1_p20260624

Description

The GNU Compiler Collection

Added to portage

2026-06-28

gcc - 14.4.0
Ebuild name:

sys-devel/gcc-14.4.0

Description

The GNU Compiler Collection

Added to portage

2026-06-28

gcc - 14.5.9999
Ebuild name:

sys-devel/gcc-14.5.9999

Description

The GNU Compiler Collection

Added to portage

2026-06-28

gcc - 15.3.1_p20260626
Ebuild name:

sys-devel/gcc-15.3.1_p20260626

Description

The GNU Compiler Collection

Added to portage

2026-06-28

gcc - 16.1.1_p20260627
Ebuild name:

sys-devel/gcc-16.1.1_p20260627

Description

The GNU Compiler Collection

Added to portage

2026-06-28

gentoolkit - 0.7.5
Ebuild name:

app-portage/gentoolkit-0.7.5

Description

Collection of administration scripts for Gentoo

Added to portage

2026-06-28

gpgme - 2.1.1
Ebuild name:

app-crypt/gpgme-2.1.1

Description

GnuPG Made Easy is a library for making GnuPG easier to use

Added to portage

2026-06-28

hypopg - 1.4.3-r1
Ebuild name:

dev-db/hypopg-1.4.3-r1

Description

Hypothetical Indexes for PostgreSQL

Added to portage

2026-06-28

imapfilter - 2.8.5
Ebuild name:

mail-filter/imapfilter-2.8.5

Description

An IMAP mail filtering utility

Added to portage

2026-06-28

jakartaee-migration - 1.0.12
Ebuild name:

dev-java/jakartaee-migration-1.0.12

Description

Apache Tomcat tool for migration from Java EE 8 to Jakarta EE 9

Added to portage

2026-06-28

libbgcode - 0.0.20260521
Ebuild name:

media-gfx/libbgcode-0.0.20260521

Description

Prusa Block & Binary G-code reader / writer / converter

Added to portage

2026-06-28

libredwg - 0.14
Ebuild name:

media-gfx/libredwg-0.14

Description

C library to handle DWG files

Added to portage

2026-06-28

libsass - 0.23.0-r1
Ebuild name:

dev-python/libsass-0.23.0-r1

Description

A straightforward binding of libsass for Python

Added to portage

2026-06-28

libtmux - 0.59.0
Ebuild name:

dev-python/libtmux-0.59.0

Description

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

Added to portage

2026-06-28

libvpl - 2.17.0
Ebuild name:

media-libs/libvpl-2.17.0

Description

Intel Video Processing Library dispatcher

Added to portage

2026-06-28

libvpl-tools - 1.6.0
Ebuild name:

media-libs/libvpl-tools-1.6.0

Description

Intel Video Processing Library tools

Added to portage

2026-06-28

lxqt-panel - 2.4.1-r1
Ebuild name:

lxqt-base/lxqt-panel-2.4.1-r1

Description

LXQt desktop panel and plugins

Added to portage

2026-06-28

lxqt-panel - 2.4.1-r2
Ebuild name:

lxqt-base/lxqt-panel-2.4.1-r2

Description

LXQt desktop panel and plugins

Added to portage

2026-06-28

magit - 9999
Ebuild name:

app-emacs/magit-9999

Description

A Git porcelain inside Emacs

Added to portage

2026-06-28

mirrorselect - 2.6.5
Ebuild name:

app-portage/mirrorselect-2.6.5

Description

Tool to help select distfiles mirrors for Gentoo

Added to portage

2026-06-28

nawk - 20260426
Ebuild name:

sys-apps/nawk-20260426

Description

Brian Kernighan's pattern scanning and processing language

Added to portage

2026-06-28

netpbm - 11.15.0
Ebuild name:

media-libs/netpbm-11.15.0

Description

A set of utilities for converting to/from the netpbm (and related) format

Added to portage

2026-06-28

obs-studio - 32.1.2
Ebuild name:

media-video/obs-studio-32.1.2

Description

Software for Recording and Streaming Live Video Content

Added to portage

2026-06-28

pg_background - 1.9.3
Ebuild name:

dev-db/pg_background-1.9.3

Description

Postgres Background Worker

Added to portage

2026-06-28

pg_background - 2.0.2
Ebuild name:

dev-db/pg_background-2.0.2

Description

Postgres Background Worker

Added to portage

2026-06-28

pg_qualstats - 2.1.4-r1
Ebuild name:

dev-db/pg_qualstats-2.1.4-r1

Description

Statistics about predicates for helping finding what indices are missi

Added to portage

2026-06-28

pg_stat_kcache - 2.3.2-r1
Ebuild name:

dev-db/pg_stat_kcache-2.3.2-r1

Description

Statistics about physical disk access and CPU consumption done by ba

Added to portage

2026-06-28

pg_track_settings - 2.1.2-r1
Ebuild name:

dev-db/pg_track_settings-2.1.2-r1

Description

Keeps track of PostgreSQL settings modification

Added to portage

2026-06-28

pg_wait_sampling - 1.1.9-r1
Ebuild name:

dev-db/pg_wait_sampling-1.1.9-r1

Description

Sampling based statistics of wait events

Added to portage

2026-06-28

pkgconf - 2.9.94
Ebuild name:

dev-util/pkgconf-2.9.94

Description

pkg-config compatible replacement with no dependencies other than C99

Added to portage

2026-06-28

powa-archivist - 5.1.2-r1
Ebuild name:

dev-db/powa-archivist-5.1.2-r1

Description

PostgreSQL Workload Analyzer Archivist

Added to portage

2026-06-28

prusaslicer - 2.9.6
Ebuild name:

media-gfx/prusaslicer-2.9.6

Description

A mesh slicer to generate G-code for fused-filament-fabrication (3D pri

Added to portage

2026-06-28

pulsectl-asyncio - 1.3.2
Ebuild name:

dev-python/pulsectl-asyncio-1.3.2

Description

Asyncio frontend for pulsectl, Python bindings of libpulse

Added to portage

2026-06-28

python - 0.3.14.6_p1
Ebuild name:

dev-lang/python-0.3.14.6_p1

Description

Freethreading (no-GIL) version of Python programming language

Added to portage

2026-06-28

python - 3.14.6_p1
Ebuild name:

dev-lang/python-3.14.6_p1

Description

An interpreted, interactive, object-oriented programming language

Added to portage

2026-06-28

python-tests - 0.3.14.6_p1
Ebuild name:

dev-python/python-tests-0.3.14.6_p1

Description

Test modules from dev-lang/python

Added to portage

2026-06-28

python-tests - 3.14.6_p1
Ebuild name:

dev-python/python-tests-3.14.6_p1

Description

Test modules from dev-lang/python

Added to portage

2026-06-28

qdmr - 0.15.1
Ebuild name:

net-wireless/qdmr-0.15.1

Description

GUI application for configuring and programming cheap DMR radios

Added to portage

2026-06-28

qtox - 1.18.5
Ebuild name:

net-im/qtox-1.18.5

Description

Instant messaging client using the encrypted p2p Tox protocol

Added to portage

2026-06-28

rpi-eeprom - 28.28
Ebuild name:

dev-embedded/rpi-eeprom-28.28

Description

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

Added to portage

2026-06-28

screengrab - 3.2.0-r1
Ebuild name:

x11-misc/screengrab-3.2.0-r1

Description

Qt GUI Screenshot Utility

Added to portage

2026-06-28

screengrab - 3.2.0-r2
Ebuild name:

x11-misc/screengrab-3.2.0-r2

Description

Qt GUI Screenshot Utility

Added to portage

2026-06-28

setuptools-rust - 1.13.0
Ebuild name:

dev-python/setuptools-rust-1.13.0

Description

A plugin for setuptools to build Rust Python extensions

Added to portage

2026-06-28

socat - 1.8.1.3
Ebuild name:

net-misc/socat-1.8.1.3

Description

Multipurpose relay (SOcket CAT)

Added to portage

2026-06-28

spyder - 6.1.5
Ebuild name:

dev-python/spyder-6.1.5

Description

The Scientific Python Development Environment

Added to portage

2026-06-28

strawberry - 1.2.21
Ebuild name:

media-sound/strawberry-1.2.21

Description

Modern music player and library organizer based on Clementine and Qt

Added to portage

2026-06-28

tibs - 0.11.0
Ebuild name:

dev-python/tibs-0.11.0

Description

A sleek Python library for your binary data

Added to portage

2026-06-28

tinc - 1.0.37
Ebuild name:

net-vpn/tinc-1.0.37

Description

tinc is an easy to configure VPN implementation

Added to portage

2026-06-28

tomcat - 10.1.56
Ebuild name:

www-servers/tomcat-10.1.56

Description

Tomcat Servlet-6.0/JSP-3.1/EL-5.0/WebSocket-2.1/JASPIC-3.0 Container

Added to portage

2026-06-28

tomcat - 11.0.23
Ebuild name:

www-servers/tomcat-11.0.23

Description

Tomcat Servlet-6.1/JSP-4.0/EL-6.0/WebSocket-2.2/JASPIC-3.1 Container

Added to portage

2026-06-28

tomcat - 9.0.119
Ebuild name:

www-servers/tomcat-9.0.119

Description

Tomcat Servlet-4.0/JSP-2.3/EL-3.0/WebSocket-1.1/JASPIC-1.1 Container

Added to portage

2026-06-28

tomcat-native - 1.3.8
Ebuild name:

dev-java/tomcat-native-1.3.8

Description

Allows Tomcat to use certain native resources for better performance

Added to portage

2026-06-28

tomcat-native - 2.0.15
Ebuild name:

dev-java/tomcat-native-2.0.15

Description

Allows Tomcat to use certain native resources for better performance

Added to portage

2026-06-28

uhd - 4.10.0.0-r2
Ebuild name:

net-wireless/uhd-4.10.0.0-r2

Description

Universal Software Radio Peripheral (USRP) Hardware Driver

Added to portage

2026-06-28

valentina - 1.0.4
Ebuild name:

media-gfx/valentina-1.0.4

Description

Cloth patternmaking software

Added to portage

2026-06-28

vpl-gpu-rt - 26.2.1
Ebuild name:

media-libs/vpl-gpu-rt-26.2.1

Description

Intel Video Processing Library GPU Runtime

Added to portage

2026-06-28

xclock - 1.2.0
Ebuild name:

x11-apps/xclock-1.2.0

Description

analog / digital clock for X

Added to portage

2026-06-28

xxhash - 3.8.0
Ebuild name:

dev-python/xxhash-3.8.0

Description

Python binding for the xxHash library

Added to portage

2026-06-28

zabbix - 7.0.27
Ebuild name:

net-analyzer/zabbix-7.0.27

Description

ZABBIX is software for monitoring of your applications, network and serv

Added to portage

2026-06-28

zabbix - 7.4.11
Ebuild name:

net-analyzer/zabbix-7.4.11

Description

ZABBIX is software for monitoring of your applications, network and serv

Added to portage

2026-06-28

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