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:

84441

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-16
algol68g - 3.11.1
Ebuild name:

dev-lang/algol68g-3.11.1

Description

Algol 68 Genie compiler-interpreter

Added to portage

2026-04-16

ansible-molecule - 26.3.0
Ebuild name:

app-admin/ansible-molecule-26.3.0

Description

A toolkit designed to aid in the development and testing of Ansib

Added to portage

2026-04-16

cadical - 3.0.0
Ebuild name:

sci-mathematics/cadical-3.0.0

Description

Simplified Satisfiability Solver

Added to portage

2026-04-16

chrome-binary-plugins - 147.0.7727.101
Ebuild name:

www-plugins/chrome-binary-plugins-147.0.7727.101

Description

Binary plugins from Google Chrome for use in Chrom

Added to portage

2026-04-16

chromedriver-bin - 147.0.7727.101
Ebuild name:

www-apps/chromedriver-bin-147.0.7727.101

Description

WebDriver for Chrome

Added to portage

2026-04-16

chromium - 147.0.7727.101
Ebuild name:

www-client/chromium-147.0.7727.101

Description

Open-source version of Google Chrome web browser

Added to portage

2026-04-16

claude-code - 2.1.110
Ebuild name:

dev-util/claude-code-2.1.110

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2026-04-16

closure-compiler-bin - 20260412
Ebuild name:

dev-lang/closure-compiler-bin-20260412

Description

JavaScript optimizing compiler

Added to portage

2026-04-16

commons-lang - 3.20.0-r1
Ebuild name:

dev-java/commons-lang-3.20.0-r1

Description

Commons components to manipulate core java classes

Added to portage

2026-04-16

coreutils - 9.10_p20260415
Ebuild name:

sys-apps/coreutils-9.10_p20260415

Description

Standard GNU utilities (chmod, cp, dd, ls, sort, tr, head, wc, wh

Added to portage

2026-04-16

csharp-language-server - 0.23.0
Ebuild name:

dev-dotnet/csharp-language-server-0.23.0

Description

Roslyn-based LSP language server for C

Added to portage

2026-04-16

devcontainer - 0.86.0
Ebuild name:

app-containers/devcontainer-0.86.0

Description

Reference implementation of the Development Containers specifica

Added to portage

2026-04-16

elfutils - 0.195
Ebuild name:

dev-libs/elfutils-0.195

Description

Libraries/utilities to handle ELF objects (drop in replacement for libelf)

Added to portage

2026-04-16

evolution - 3.60.1
Ebuild name:

mail-client/evolution-3.60.1

Description

Integrated mail, addressbook and calendaring functionality

Added to portage

2026-04-16

evolution-data-server - 3.60.1
Ebuild name:

gnome-extra/evolution-data-server-3.60.1

Description

Evolution groupware backend

Added to portage

2026-04-16

evolution-ews - 3.60.1
Ebuild name:

gnome-extra/evolution-ews-3.60.1

Description

Evolution module for connecting to Microsoft Exchange Web Services

Added to portage

2026-04-16

fido2 - 2.2.0
Ebuild name:

dev-python/fido2-2.2.0

Description

Python based FIDO 2.0 library

Added to portage

2026-04-16

folks - 0.15.12
Ebuild name:

dev-libs/folks-0.15.12

Description

Library for aggregating people from multiple sources

Added to portage

2026-04-16

folks - 0.15.9-r3
Ebuild name:

dev-libs/folks-0.15.9-r3

Description

Library for aggregating people from multiple sources

Added to portage

2026-04-16

folks - 0.15.9-r4
Ebuild name:

dev-libs/folks-0.15.9-r4

Description

Library for aggregating people from multiple sources

Added to portage

2026-04-16

gentoo-sources - 7.0.0
Ebuild name:

sys-kernel/gentoo-sources-7.0.0

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-04-16

google-chrome - 147.0.7727.101
Ebuild name:

www-client/google-chrome-147.0.7727.101

Description

The web browser from Google

Added to portage

2026-04-16

ibus-typing-booster - 2.30.6
Ebuild name:

app-i18n/ibus-typing-booster-2.30.6

Description

Completion input method for IBus

Added to portage

2026-04-16

iverilog - 12.0-r1
Ebuild name:

sci-electronics/iverilog-12.0-r1

Description

A Verilog simulation and synthesis tool

Added to portage

2026-04-16

iverilog - 13.0
Ebuild name:

sci-electronics/iverilog-13.0

Description

A Verilog simulation and synthesis tool

Added to portage

2026-04-16

joplin-desktop - 3.6.8
Ebuild name:

app-office/joplin-desktop-3.6.8

Description

Secure note taking and to-do app with synchronization capabilities

Added to portage

2026-04-16

keepassxc - 2.7.11-r3
Ebuild name:

app-admin/keepassxc-2.7.11-r3

Description

KeePassXC - KeePass Cross-platform Community Edition

Added to portage

2026-04-16

kissat - 4.0.4
Ebuild name:

sci-mathematics/kissat-4.0.4

Description

Keep-it-simple and clean bare metal SAT solver written in C

Added to portage

2026-04-16

libgcrypt - 1.12.2
Ebuild name:

dev-libs/libgcrypt-1.12.2

Description

General purpose crypto library based on the code used in GnuPG

Added to portage

2026-04-16

m17n-db - 1.8.11
Ebuild name:

dev-db/m17n-db-1.8.11

Description

Database for the m17n library

Added to portage

2026-04-16

microsoft-edge-dev - 148.0.3967.8
Ebuild name:

www-client/microsoft-edge-dev-148.0.3967.8

Description

The web browser from Microsoft

Added to portage

2026-04-16

nvc - 1.20.0
Ebuild name:

sci-electronics/nvc-1.20.0

Description

NVC is a VHDL compiler and simulator

Added to portage

2026-04-16

opam - 2.3.0
Ebuild name:

dev-ml/opam-2.3.0

Description

A source-based package manager for OCaml

Added to portage

2026-04-16

opam-common - 2.3.0
Ebuild name:

dev-ml/opam-common-2.3.0

Description

Core libraries for opam

Added to portage

2026-04-16

opam-installer - 2.3.0
Ebuild name:

dev-ml/opam-installer-2.3.0

Description

Core installer for opam packages

Added to portage

2026-04-16

opera-developer - 131.0.5868.0
Ebuild name:

www-client/opera-developer-131.0.5868.0

Description

A fast and secure web browser

Added to portage

2026-04-16

polychromatic - 0.9.7
Ebuild name:

sys-apps/polychromatic-0.9.7

Description

RGB lighting management software for GNU/Linux powered by OpenRazer

Added to portage

2026-04-16

postfix - 3.12_pre20260415
Ebuild name:

mail-mta/postfix-3.12_pre20260415

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2026-04-16

pypdf - 6.10.2
Ebuild name:

dev-python/pypdf-6.10.2

Description

Python library to work with PDF files

Added to portage

2026-04-16

pytest-asyncio - 1.4.0_alpha1
Ebuild name:

dev-python/pytest-asyncio-1.4.0_alpha1

Description

Library for testing asyncio code with pytest

Added to portage

2026-04-16

qtpy - 2.4.3-r2
Ebuild name:

dev-python/qtpy-2.4.3-r2

Description

Abstraction layer on top of PyQt and PySide with additional custom QWidget

Added to portage

2026-04-16

signal-desktop-bin - 8.6.1
Ebuild name:

net-im/signal-desktop-bin-8.6.1

Description

Allows you to send and receive messages of Signal Messenger on your

Added to portage

2026-04-16

sphinx-autodoc-typehints - 3.10.2
Ebuild name:

dev-python/sphinx-autodoc-typehints-3.10.2

Description

Type hints support for the Sphinx autodoc extension

Added to portage

2026-04-16

testscenarios - 0.6
Ebuild name:

dev-python/testscenarios-0.6

Description

A pyunit extension for dependency injection

Added to portage

2026-04-16

uv - 0.11.7
Ebuild name:

dev-python/uv-0.11.7

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-04-16

uv-build - 0.11.7
Ebuild name:

dev-python/uv-build-0.11.7

Description

PEP517 uv build backend

Added to portage

2026-04-16

valgrind - 3.27.0_rc1
Ebuild name:

dev-debug/valgrind-3.27.0_rc1

Description

An open-source memory debugger for GNU/Linux

Added to portage

2026-04-16

vampire - 5.0.1
Ebuild name:

sci-mathematics/vampire-5.0.1

Description

The Vampire Prover, theorem prover for first-order logic

Added to portage

2026-04-16

vivaldi-snapshot - 7.10.4007.3
Ebuild name:

www-client/vivaldi-snapshot-7.10.4007.3

Description

A browser for our friends

Added to portage

2026-04-16

wrapt - 2.2.0_rc7
Ebuild name:

dev-python/wrapt-2.2.0_rc7

Description

Module for decorators, wrappers and monkey patching

Added to portage

2026-04-16

2026-04-15
atuin - 18.14.1
Ebuild name:

app-shells/atuin-18.14.1

Description

Shell history manager supporting encrypted synchronisation

Added to portage

2026-04-15

b4 - 0.15.2
Ebuild name:

net-mail/b4-0.15.2

Description

Utility for fetching patchsets from public-inbox

Added to portage

2026-04-15

bpftop - 0.8.0
Ebuild name:

dev-util/bpftop-0.8.0

Description

Dynamic real-time view of running eBPF programs

Added to portage

2026-04-15

brltty - 6.9.1
Ebuild name:

app-accessibility/brltty-6.9.1

Description

Daemon that provides access to the Linux/Unix console for a blind pe

Added to portage

2026-04-15

cargo-nextest - 0.9.133
Ebuild name:

dev-util/cargo-nextest-0.9.133

Description

Next-generation test runner for Rust

Added to portage

2026-04-15

cinnamon-settings-daemon - 6.6.3-r1
Ebuild name:

gnome-extra/cinnamon-settings-daemon-6.6.3-r1

Description

Cinnamon's settings daemon

Added to portage

2026-04-15

editables - 0.6
Ebuild name:

dev-python/editables-0.6

Description

A Python library for creating 'editable wheels'

Added to portage

2026-04-15

epiphany - 49.7
Ebuild name:

www-client/epiphany-49.7

Description

GNOME webbrowser based on Webkit

Added to portage

2026-04-15

filelock - 3.28.0
Ebuild name:

dev-python/filelock-3.28.0

Description

A platform independent file lock for Python

Added to portage

2026-04-15

hypothesis - 6.152.1
Ebuild name:

dev-python/hypothesis-6.152.1

Description

A library for property based testing

Added to portage

2026-04-15

leancrypto - 1.7.2-r3
Ebuild name:

dev-libs/leancrypto-1.7.2-r3

Description

Lean cryptographic library usable for bare-metal environments

Added to portage

2026-04-15

libbluray - 1.4.1
Ebuild name:

media-libs/libbluray-1.4.1

Description

Blu-ray playback libraries

Added to portage

2026-04-15

libexif - 0.6.26
Ebuild name:

media-libs/libexif-0.6.26

Description

Library for parsing, editing, and saving EXIF data

Added to portage

2026-04-15

liblouis - 3.37.0
Ebuild name:

dev-libs/liblouis-3.37.0

Description

An open-source braille translator and back-translator

Added to portage

2026-04-15

libraw - 0.22.1-r1
Ebuild name:

media-libs/libraw-0.22.1-r1

Description

LibRaw is a library for reading RAW files obtained from digital photo c

Added to portage

2026-04-15

makeheaders - 0_p20251008
Ebuild name:

dev-util/makeheaders-0_p20251008

Description

Tool that automatically generates .h files for a C or C++ programm

Added to portage

2026-04-15

mako - 1.3.11
Ebuild name:

dev-python/mako-1.3.11

Description

A Python templating language

Added to portage

2026-04-15

mediafile - 0.16.1
Ebuild name:

dev-python/mediafile-0.16.1

Description

Read and write audio files' tags in Python

Added to portage

2026-04-15

mesa - 26.0.5
Ebuild name:

media-libs/mesa-26.0.5

Description

OpenGL-like graphic library for Linux

Added to portage

2026-04-15

mesa_clc - 26.0.5
Ebuild name:

dev-util/mesa_clc-26.0.5

Description

mesa_clc tool used for building OpenCL C to SPIR-V

Added to portage

2026-04-15

microsoft-identity-broker - 3.0.1
Ebuild name:

sys-auth/microsoft-identity-broker-3.0.1

Description

Microsoft Authentication Broker to access a corporate envi

Added to portage

2026-04-15

openjpeg - 2.5.4-r1
Ebuild name:

media-libs/openjpeg-2.5.4-r1

Description

Open-source JPEG 2000 library

Added to portage

2026-04-15

openpgp-keys-keepass - 20260415
Ebuild name:

sec-keys/openpgp-keys-keepass-20260415

Description

OpenPGP key used by KeePass

Added to portage

2026-04-15

openpgp-keys-marcusmeissner - 20260415
Ebuild name:

sec-keys/openpgp-keys-marcusmeissner-20260415

Description

OpenPGP key used by Marcus Meissner

Added to portage

2026-04-15

openpgp-keys-openssl - 20260415
Ebuild name:

sec-keys/openpgp-keys-openssl-20260415

Description

OpenPGP keys used by OpenSSL

Added to portage

2026-04-15

openssl - 4.0.0
Ebuild name:

dev-libs/openssl-4.0.0

Description

Robust, full-featured Open Source Toolkit for the Transport Layer Security (

Added to portage

2026-04-15

osc-lib - 4.5.0
Ebuild name:

dev-python/osc-lib-4.5.0

Description

A package of common support modules for writing OSC plugins

Added to portage

2026-04-15

packaging - 26.1
Ebuild name:

dev-python/packaging-26.1

Description

Core utilities for Python packages

Added to portage

2026-04-15

passlib - 1.9.3
Ebuild name:

dev-python/passlib-1.9.3

Description

Fork of passlib, a password hashing framework

Added to portage

2026-04-15

perf - 6.19.12
Ebuild name:

dev-util/perf-6.19.12

Description

Userland tools for Linux Performance Counters

Added to portage

2026-04-15

perf - 7.0
Ebuild name:

dev-util/perf-7.0

Description

Userland tools for Linux Performance Counters

Added to portage

2026-04-15

prek - 0.3.9
Ebuild name:

dev-util/prek-0.3.9

Description

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

Added to portage

2026-04-15

pygithub - 2.9.1
Ebuild name:

dev-python/pygithub-2.9.1

Description

Python library to access the Github API v3

Added to portage

2026-04-15

pypdf - 6.10.1
Ebuild name:

dev-python/pypdf-6.10.1

Description

Python library to work with PDF files

Added to portage

2026-04-15

pytest-mpl - 0.19.0
Ebuild name:

dev-python/pytest-mpl-0.19.0

Description

Facilitate image comparison for Matplotlib figures

Added to portage

2026-04-15

qtshadertools - 6.11.0-r1
Ebuild name:

dev-qt/qtshadertools-6.11.0-r1

Description

Qt APIs and Tools for Graphics Pipelines

Added to portage

2026-04-15

rust - 1.94.1
Ebuild name:

dev-lang/rust-1.94.1

Description

Systems programming language originally developed by Mozilla

Added to portage

2026-04-15

rust - 1.95.0_beta20260404
Ebuild name:

dev-lang/rust-1.95.0_beta20260404

Description

Systems programming language originally developed by Mozilla

Added to portage

2026-04-15

rust-bin - 1.94.1
Ebuild name:

dev-lang/rust-bin-1.94.1

Description

Added to portage

2026-04-15

rust-bin - 1.95.0_beta20260404
Ebuild name:

dev-lang/rust-bin-1.95.0_beta20260404

Description

Added to portage

2026-04-15

rust-common - 1.94.1
Ebuild name:

dev-lang/rust-common-1.94.1

Description

Common files shared between multiple slots of Rust

Added to portage

2026-04-15

rust-common - 1.95.0_beta20260404
Ebuild name:

dev-lang/rust-common-1.95.0_beta20260404

Description

Common files shared between multiple slots of Rust

Added to portage

2026-04-15

rust-std - 1.94.1
Ebuild name:

sys-devel/rust-std-1.94.1

Description

Rust standard library, standalone (for crossdev)

Added to portage

2026-04-15

rust-std - 1.95.0_beta20260404
Ebuild name:

sys-devel/rust-std-1.95.0_beta20260404

Description

Rust standard library, standalone (for crossdev)

Added to portage

2026-04-15

scamp - 2.15.0
Ebuild name:

sci-astronomy/scamp-2.15.0

Description

Astrometric and photometric solutions for astronomical images

Added to portage

2026-04-15

seer - 2.7
Ebuild name:

dev-util/seer-2.7

Description

GUI frontend to gdb

Added to portage

2026-04-15

sonic - 0.2.0_p20260314
Ebuild name:

media-libs/sonic-0.2.0_p20260314

Description

Simple library to speed up or slow down speech

Added to portage

2026-04-15

tox - 4.53.0
Ebuild name:

dev-python/tox-4.53.0

Description

virtualenv-based automation of test activities

Added to portage

2026-04-15

translate-toolkit - 3.19.5
Ebuild name:

dev-python/translate-toolkit-3.19.5

Description

Toolkit to convert between many translation formats

Added to portage

2026-04-15

umockdev - 0.19.7
Ebuild name:

dev-util/umockdev-0.19.7

Description

Mock hardware devices for creating unit tests

Added to portage

2026-04-15

virtualenv - 21.2.4
Ebuild name:

dev-python/virtualenv-21.2.4

Description

Virtual Python Environment builder

Added to portage

2026-04-15

wrapt - 2.2.0_rc6
Ebuild name:

dev-python/wrapt-2.2.0_rc6

Description

Module for decorators, wrappers and monkey patching

Added to portage

2026-04-15

wtfis - 0.15.0
Ebuild name:

net-analyzer/wtfis-0.15.0

Description

Passive hostname, domain and IP lookup tool for non-robots

Added to portage

2026-04-15

xorg-server - 21.1.22
Ebuild name:

x11-base/xorg-server-21.1.22

Description

X.Org X servers

Added to portage

2026-04-15

xterm - 409
Ebuild name:

x11-terms/xterm-409

Description

Terminal Emulator for X Windows

Added to portage

2026-04-15

xwayland - 24.1.10
Ebuild name:

x11-base/xwayland-24.1.10

Description

Standalone X server running under Wayland

Added to portage

2026-04-15

yara-x - 1.15.0
Ebuild name:

app-forensics/yara-x-1.15.0

Description

A malware identification and classification tool

Added to portage

2026-04-15

zig-bin - 0.16.0
Ebuild name:

dev-lang/zig-bin-0.16.0

Description

A robust, optimal, and maintainable programming language

Added to portage

2026-04-15

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