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:

87681

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-08-15
attica - 6.29.0
Ebuild name:

kde-frameworks/attica-6.29.0

Description

Framework providing access to Open Collaboration Services

Added to portage

2026-08-15

awkward - 2.13.0
Ebuild name:

dev-python/awkward-2.13.0

Description

Manipulate JSON-like data with NumPy-like idioms

Added to portage

2026-08-15

awkward-cpp - 56
Ebuild name:

dev-python/awkward-cpp-56

Description

CPU kernels and compiled extensions for Awkward Array

Added to portage

2026-08-15

botan - 3.13.0
Ebuild name:

dev-libs/botan-3.13.0

Description

C++ crypto library

Added to portage

2026-08-15

boto3 - 1.43.72
Ebuild name:

dev-python/boto3-1.43.72

Description

The AWS SDK for Python

Added to portage

2026-08-15

botocore - 1.43.72
Ebuild name:

dev-python/botocore-1.43.72

Description

Low-level, data-driven core of boto 3

Added to portage

2026-08-15

django-debug-toolbar - 7.1.1
Ebuild name:

dev-python/django-debug-toolbar-7.1.1

Description

A configurable set of panels that display various debug infor

Added to portage

2026-08-15

game-device-udev-rules - 20260625
Ebuild name:

games-util/game-device-udev-rules-20260625

Description

udev rules for various game hardware devices

Added to portage

2026-08-15

ggml - 0.20.0
Ebuild name:

sci-ml/ggml-0.20.0

Description

Tensor library for machine learning

Added to portage

2026-08-15

go - 1.25.13
Ebuild name:

dev-lang/go-1.25.13

Description

A concurrent garbage collected and typesafe programming language

Added to portage

2026-08-15

go - 1.26.6
Ebuild name:

dev-lang/go-1.26.6

Description

A concurrent garbage collected and typesafe programming language

Added to portage

2026-08-15

httpx-socks - 0.13.1
Ebuild name:

dev-python/httpx-socks-0.13.1

Description

Proxy (HTTP, SOCKS) transports for httpx

Added to portage

2026-08-15

huawei-lte-api - 2.0.1
Ebuild name:

dev-python/huawei-lte-api-2.0.1

Description

API For huawei LAN/WAN LTE Modems

Added to portage

2026-08-15

hypothesis - 6.165.9
Ebuild name:

dev-python/hypothesis-6.165.9

Description

A library for property based testing

Added to portage

2026-08-15

jabref - 5.15-r1
Ebuild name:

app-text/jabref-5.15-r1

Description

Graphical Java application for managing BibTeX and biblatex (.bib) database

Added to portage

2026-08-15

kitinerary - 26.04.3-r1
Ebuild name:

kde-apps/kitinerary-26.04.3-r1

Description

Data Model and Extraction System for Travel Reservation information

Added to portage

2026-08-15

libffi - 3.8.0
Ebuild name:

dev-libs/libffi-3.8.0

Description

Portable, high level programming interface to various calling conventions

Added to portage

2026-08-15

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-08-15

mu - 1.14.3
Ebuild name:

net-mail/mu-1.14.3

Description

Set of tools to deal with Maildirs, in particular, searching and indexing

Added to portage

2026-08-15

mypy - 2.3.1
Ebuild name:

dev-python/mypy-2.3.1

Description

Optional static typing for Python

Added to portage

2026-08-15

openjdk-bin - 11.0.32_p9
Ebuild name:

dev-java/openjdk-bin-11.0.32_p9

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-08-15

openjdk-bin - 17.0.20_p8
Ebuild name:

dev-java/openjdk-bin-17.0.20_p8

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-08-15

openjdk-bin - 21.0.12_p8
Ebuild name:

dev-java/openjdk-bin-21.0.12_p8

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-08-15

openjdk-bin - 25.0.4_p7
Ebuild name:

dev-java/openjdk-bin-25.0.4_p7

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-08-15

openjdk-bin - 27_beta34
Ebuild name:

dev-java/openjdk-bin-27_beta34

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-08-15

openjdk-bin - 28_alpha11
Ebuild name:

dev-java/openjdk-bin-28_alpha11

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-08-15

openjdk-bin - 8.502_p07
Ebuild name:

dev-java/openjdk-bin-8.502_p07

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-08-15

openjdk-jre-bin - 11.0.32_p9
Ebuild name:

dev-java/openjdk-jre-bin-11.0.32_p9

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2026-08-15

openjdk-jre-bin - 17.0.20_p8
Ebuild name:

dev-java/openjdk-jre-bin-17.0.20_p8

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2026-08-15

openjdk-jre-bin - 21.0.12_p8
Ebuild name:

dev-java/openjdk-jre-bin-21.0.12_p8

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2026-08-15

openjdk-jre-bin - 25.0.4_p7
Ebuild name:

dev-java/openjdk-jre-bin-25.0.4_p7

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2026-08-15

openjdk-jre-bin - 8.502_p07
Ebuild name:

dev-java/openjdk-jre-bin-8.502_p07

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2026-08-15

orjson - 3.12.0
Ebuild name:

dev-python/orjson-3.12.0

Description

Fast, correct Python JSON library supporting dataclasses, datetimes, and n

Added to portage

2026-08-15

pbs-installer - 2026.8.14
Ebuild name:

dev-python/pbs-installer-2026.8.14

Description

Installer for Python Build Standalone

Added to portage

2026-08-15

phonenumbers - 9.0.37
Ebuild name:

dev-python/phonenumbers-9.0.37

Description

Python port of Google's libphonenumber

Added to portage

2026-08-15

pypdf - 6.16.1
Ebuild name:

dev-python/pypdf-6.16.1

Description

Python library to work with PDF files

Added to portage

2026-08-15

pyzotero - 1.13.7
Ebuild name:

dev-python/pyzotero-1.13.7

Description

A Python client for the Zotero API

Added to portage

2026-08-15

simdjson - 4.6.7
Ebuild name:

dev-libs/simdjson-4.6.7

Description

SIMD accelerated C++ JSON library

Added to portage

2026-08-15

streamlink - 8.5.0
Ebuild name:

net-misc/streamlink-8.5.0

Description

CLI for extracting streams from websites to a video player of your choice

Added to portage

2026-08-15

svglib - 2.2.0
Ebuild name:

dev-python/svglib-2.2.0

Description

Pure-Python library for reading and converting SVG

Added to portage

2026-08-15

unearth - 0.18.3
Ebuild name:

dev-python/unearth-0.18.3

Description

A utility to fetch and download python packages

Added to portage

2026-08-15

unzip - 6.0_p31
Ebuild name:

app-arch/unzip-6.0_p31

Description

unzipper for pkzip-compressed files

Added to portage

2026-08-15

urwid - 4.0.9
Ebuild name:

dev-python/urwid-4.0.9

Description

Curses-based user interface library for Python

Added to portage

2026-08-15

wcmatch - 11.0.1
Ebuild name:

dev-python/wcmatch-11.0.1

Description

Wildcard/glob file name matcher

Added to portage

2026-08-15

xapian - 1.4.32
Ebuild name:

dev-libs/xapian-1.4.32

Description

Xapian Probabilistic Information Retrieval library

Added to portage

2026-08-15

xapian - 2.1.0
Ebuild name:

dev-libs/xapian-2.1.0

Description

Xapian Probabilistic Information Retrieval library

Added to portage

2026-08-15

xapian-bindings - 1.4.32
Ebuild name:

dev-libs/xapian-bindings-1.4.32

Description

SWIG and JNI bindings for Xapian

Added to portage

2026-08-15

xapian-bindings - 2.1.0
Ebuild name:

dev-libs/xapian-bindings-2.1.0

Description

SWIG and JNI bindings for Xapian

Added to portage

2026-08-15

xapian-omega - 1.4.32
Ebuild name:

app-text/xapian-omega-1.4.32

Description

An application built on Xapian, consisting of indexers and a CGI searc

Added to portage

2026-08-15

xapian-omega - 2.1.0
Ebuild name:

app-text/xapian-omega-2.1.0

Description

An application built on Xapian, consisting of indexers and a CGI search

Added to portage

2026-08-15

2026-08-14
algol68g - 3.13.3
Ebuild name:

dev-lang/algol68g-3.13.3

Description

Algol 68 Genie compiler-interpreter

Added to portage

2026-08-14

audit - 4.2.1
Ebuild name:

sys-process/audit-4.2.1

Description

Userspace utilities for storing and processing auditing records

Added to portage

2026-08-14

aws-sam-translator - 1.112.0
Ebuild name:

dev-python/aws-sam-translator-1.112.0

Description

A library that transform SAM templates into AWS CloudFormatio

Added to portage

2026-08-14

boto3 - 1.43.71
Ebuild name:

dev-python/boto3-1.43.71

Description

The AWS SDK for Python

Added to portage

2026-08-14

botocore - 1.43.71
Ebuild name:

dev-python/botocore-1.43.71

Description

Low-level, data-driven core of boto 3

Added to portage

2026-08-14

cfitsio - 4.7.0
Ebuild name:

sci-libs/cfitsio-4.7.0

Description

C and Fortran library for manipulating FITS files

Added to portage

2026-08-14

cfn-lint - 1.55.1
Ebuild name:

dev-python/cfn-lint-1.55.1

Description

CloudFormation Linter

Added to portage

2026-08-14

claude-code - 2.1.231
Ebuild name:

dev-util/claude-code-2.1.231

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2026-08-14

courier-imap - 6.0.6
Ebuild name:

net-mail/courier-imap-6.0.6

Description

An IMAP daemon designed specifically for maildirs

Added to portage

2026-08-14

cproc - 0_pre20260527
Ebuild name:

sys-devel/cproc-0_pre20260527

Description

C11 compiler using QBE as backend

Added to portage

2026-08-14

dbeaver-bin - 26.1.4
Ebuild name:

dev-db/dbeaver-bin-26.1.4

Description

Free universal database tool (community edition)

Added to portage

2026-08-14

diffoscope - 327
Ebuild name:

dev-util/diffoscope-327

Description

Will try to get to the bottom of what makes files or directories different

Added to portage

2026-08-14

duplicity - 3.2.0
Ebuild name:

app-backup/duplicity-3.2.0

Description

Secure backup system using GnuPG to encrypt data

Added to portage

2026-08-14

filelock - 3.32.3
Ebuild name:

dev-python/filelock-3.32.3

Description

A platform independent file lock for Python

Added to portage

2026-08-14

firewalld - 2.5.1
Ebuild name:

net-firewall/firewalld-2.5.1

Description

Firewall daemon with D-Bus interface providing a dynamic firewall

Added to portage

2026-08-14

gawk - 5.4.1-r1
Ebuild name:

sys-apps/gawk-5.4.1-r1

Description

GNU awk pattern-matching language

Added to portage

2026-08-14

graphicsmagick - 1.3.48
Ebuild name:

media-gfx/graphicsmagick-1.3.48

Description

Collection of tools and libraries for many image formats

Added to portage

2026-08-14

hypothesis - 6.165.6
Ebuild name:

dev-python/hypothesis-6.165.6

Description

A library for property based testing

Added to portage

2026-08-14

libgit2 - 1.9.7
Ebuild name:

dev-libs/libgit2-1.9.7

Description

A linkable library for Git

Added to portage

2026-08-14

libtsm - 4.7.0
Ebuild name:

dev-libs/libtsm-4.7.0

Description

Terminal Emulator State Machine

Added to portage

2026-08-14

mcrypt - 2.6.8-r3
Ebuild name:

app-crypt/mcrypt-2.6.8-r3

Description

Replacement of the old unix crypt(1)

Added to portage

2026-08-14

md5deep - 4.4
Ebuild name:

app-crypt/md5deep-4.4

Description

Expanded md5sum program with recursive and comparison options

Added to portage

2026-08-14

md6sum - 1.0-r3
Ebuild name:

app-crypt/md6sum-1.0-r3

Description

A C implementation of MD6

Added to portage

2026-08-14

mhash - 0.9.9.9-r4
Ebuild name:

app-crypt/mhash-0.9.9.9-r4

Description

Library providing a uniform interface to a large number of hash algorith

Added to portage

2026-08-14

minisign - 0.12
Ebuild name:

app-crypt/minisign-0.12

Description

Dead simple tool to sign files and verify signatures

Added to portage

2026-08-14

mit-krb5 - 1.22.2-r2
Ebuild name:

app-crypt/mit-krb5-1.22.2-r2

Description

MIT Kerberos V

Added to portage

2026-08-14

mit-krb5-appl - 1.0.3-r4
Ebuild name:

app-crypt/mit-krb5-appl-1.0.3-r4

Description

Kerberized applications split from the main MIT Kerberos V distrib

Added to portage

2026-08-14

mit-krb5-appl - 1.0.3-r4
Ebuild name:

app-crypt/mit-krb5-appl-1.0.3-r4

Description

Kerberized applications split from the main MIT Kerberos V distrib

Added to portage

2026-08-14

mit-krb5-appl - 1.0.3-r5
Ebuild name:

app-crypt/mit-krb5-appl-1.0.3-r5

Description

Kerberized applications split from the main MIT Kerberos V distrib

Added to portage

2026-08-14

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-08-14

ml-dtypes - 0.6.0
Ebuild name:

dev-python/ml-dtypes-0.6.0

Description

A stand-alone implementation of several NumPy dtype extensions

Added to portage

2026-08-14

nvc - 1.22.1
Ebuild name:

sci-electronics/nvc-1.22.1

Description

NVC is a VHDL compiler and simulator

Added to portage

2026-08-14

oorexx - 5.3.0_beta13196
Ebuild name:

dev-lang/oorexx-5.3.0_beta13196

Description

Open source implementation of Object Rexx

Added to portage

2026-08-14

opencl-headers - 2026.05.29
Ebuild name:

dev-util/opencl-headers-2026.05.29

Description

Unified C language headers for the OpenCL API

Added to portage

2026-08-14

opencl-icd-loader - 2025.07.22
Ebuild name:

dev-libs/opencl-icd-loader-2025.07.22

Description

Official Khronos OpenCL ICD Loader

Added to portage

2026-08-14

pandoc-bin - 3.10.2
Ebuild name:

app-text/pandoc-bin-3.10.2

Description

Conversion between markup formats (binary package)

Added to portage

2026-08-14

pbr - 7.1.0
Ebuild name:

dev-python/pbr-7.1.0

Description

Inject some useful and sensible default behaviors into setuptools

Added to portage

2026-08-14

pkgcore - 0.12.39
Ebuild name:

sys-apps/pkgcore-0.12.39

Description

a framework for package management

Added to portage

2026-08-14

pkgdev - 0.2.17
Ebuild name:

dev-util/pkgdev-0.2.17

Description

Collection of tools for Gentoo development

Added to portage

2026-08-14

platformdirs - 4.11.3
Ebuild name:

dev-python/platformdirs-4.11.3

Description

A small Python module for determining appropriate platform-specific

Added to portage

2026-08-14

postfix - 3.12_pre20260812
Ebuild name:

mail-mta/postfix-3.12_pre20260812

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2026-08-14

progressbar2 - 4.6.0
Ebuild name:

dev-python/progressbar2-4.6.0

Description

Text progressbar library for python

Added to portage

2026-08-14

pypdf - 6.16.0
Ebuild name:

dev-python/pypdf-6.16.0

Description

Python library to work with PDF files

Added to portage

2026-08-14

pyphen - 0.18.1
Ebuild name:

dev-python/pyphen-0.18.1

Description

Python module for hyphenation using hunspell dictionaries

Added to portage

2026-08-14

pytest-rerunfailures - 16.5
Ebuild name:

dev-python/pytest-rerunfailures-16.5

Description

pytest plugin to re-run tests to eliminate flaky failures

Added to portage

2026-08-14

pyzotero - 1.13.6
Ebuild name:

dev-python/pyzotero-1.13.6

Description

A Python client for the Zotero API

Added to portage

2026-08-14

racket - 9.3
Ebuild name:

dev-scheme/racket-9.3

Description

General purpose, multi-paradigm Lisp-Scheme programming language

Added to portage

2026-08-14

ruff - 0.16.3
Ebuild name:

dev-util/ruff-0.16.3

Description

An extremely fast Python linter, written in Rust

Added to portage

2026-08-14

samba - 4.24.6
Ebuild name:

net-fs/samba-4.24.6

Description

Samba Suite Version 4

Added to portage

2026-08-14

scap-driver - 0.21.0
Ebuild name:

dev-debug/scap-driver-0.21.0

Description

Kernel module for dev-debug/sysdig

Added to portage

2026-08-14

sqlparse - 0.6.0
Ebuild name:

dev-python/sqlparse-0.6.0

Description

A non-validating SQL parser module for Python

Added to portage

2026-08-14

suscan - 0.3.0_p20251029-r1
Ebuild name:

net-wireless/suscan-0.3.0_p20251029-r1

Description

a realtime DSP processing library

Added to portage

2026-08-14

sysdig - 0.41.4
Ebuild name:

dev-debug/sysdig-0.41.4

Description

A system exploration and troubleshooting tool

Added to portage

2026-08-14

system-monitoring-center - 3.4.1-r1
Ebuild name:

sys-apps/system-monitoring-center-3.4.1-r1

Description

Multi-featured system monitor GUI written in Python

Added to portage

2026-08-14

tox - 4.60.0
Ebuild name:

dev-python/tox-4.60.0

Description

virtualenv-based automation of test activities

Added to portage

2026-08-14

uutils-coreutils - 0.10.0
Ebuild name:

sys-apps/uutils-coreutils-0.10.0

Description

GNU coreutils rewritten in Rust

Added to portage

2026-08-14

uvicorn - 0.52.3
Ebuild name:

dev-python/uvicorn-0.52.3

Description

Lightning-fast ASGI server implementation

Added to portage

2026-08-14

wireshark - 4.6.8
Ebuild name:

net-analyzer/wireshark-4.6.8

Description

Network protocol analyzer (sniffer)

Added to portage

2026-08-14

wrapt - 2.4.0_rc2
Ebuild name:

dev-python/wrapt-2.4.0_rc2

Description

Module for decorators, wrappers and monkey patching

Added to portage

2026-08-14

xdg-dbus-proxy - 0.1.8
Ebuild name:

sys-apps/xdg-dbus-proxy-0.1.8

Description

Filtering proxy for D-Bus connections

Added to portage

2026-08-14

xdg-utils - 1.2.1-r10
Ebuild name:

x11-misc/xdg-utils-1.2.1-r10

Description

Portland utils for cross-platform/cross-toolkit/cross-desktop interope

Added to portage

2026-08-14

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