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:

90967

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-12-05
audit - 4.2.2
Ebuild name:

sys-process/audit-4.2.2

Description

Userspace utilities for storing and processing auditing records

Added to portage

2026-12-05

bfs - 4.1.7
Ebuild name:

sys-apps/bfs-4.1.7

Description

Breadth-first version of the UNIX find command

Added to portage

2026-12-05

bitcoin-core - 30.5
Ebuild name:

net-p2p/bitcoin-core-30.5

Description

Reference implementation of the Bitcoin cryptocurrency

Added to portage

2026-12-05

bitcoin-core - 31.3
Ebuild name:

net-p2p/bitcoin-core-31.3

Description

Reference implementation of the Bitcoin cryptocurrency

Added to portage

2026-12-05

cryptsetup - 2.8.9
Ebuild name:

sys-fs/cryptsetup-2.8.9

Description

Tool to setup encrypted devices with dm-crypt

Added to portage

2026-12-05

diffoscope - 341
Ebuild name:

dev-util/diffoscope-341

Description

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

Added to portage

2026-12-05

dropbox - 281.4.5455
Ebuild name:

net-misc/dropbox-281.4.5455

Description

Dropbox daemon (pretends to be GUI-less)

Added to portage

2026-12-05

fq - 0.18.0
Ebuild name:

dev-util/fq-0.18.0

Description

Tool for working with binary data (app-misc/jq for binary formats)

Added to portage

2026-12-05

goawk - 1.32.0
Ebuild name:

sys-apps/goawk-1.32.0

Description

POSIX-compliant AWK interpreter written in Go, with CSV support

Added to portage

2026-12-05

hexrgb - 0_p1019
Ebuild name:

app-emacs/hexrgb-0_p1019

Description

Functions to manipulate colors, including RGB hex strings

Added to portage

2026-12-05

highlight-indentation - 0.7.0_p20210221
Ebuild name:

app-emacs/highlight-indentation-0.7.0_p20210221

Description

Minor modes to highlight indentation guides in Emac

Added to portage

2026-12-05

iodine - 0.9.1
Ebuild name:

net-vpn/iodine-0.9.1

Description

IP over DNS tunnel

Added to portage

2026-12-05

kirigami-addons - 1.16.2
Ebuild name:

dev-libs/kirigami-addons-1.16.2

Description

Visual end user components for Kirigami-based applications

Added to portage

2026-12-05

kmscon - 10.1.3
Ebuild name:

sys-apps/kmscon-10.1.3

Description

KMS/DRM based virtual Console Emulator

Added to portage

2026-12-05

libfaketime - 0.9.14
Ebuild name:

sys-libs/libfaketime-0.9.14

Description

Report faked system time to programs

Added to portage

2026-12-05

libpcap - 1.11.1
Ebuild name:

net-libs/libpcap-1.11.1

Description

System-independent library for user-level network packet capture

Added to portage

2026-12-05

libtsm - 4.8.1
Ebuild name:

dev-libs/libtsm-4.8.1

Description

Terminal Emulator State Machine

Added to portage

2026-12-05

memtest86+ - 9.10
Ebuild name:

sys-apps/memtest86+-9.10

Description

Memory tester based on PCMemTest

Added to portage

2026-12-05

streamlink - 8.6.3
Ebuild name:

net-misc/streamlink-8.6.3

Description

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

Added to portage

2026-12-05

tailscale - 1.106.4
Ebuild name:

net-vpn/tailscale-1.106.4

Description

Tailscale vpn client

Added to portage

2026-12-05

tortoisehg - 7.2.6
Ebuild name:

dev-vcs/tortoisehg-7.2.6

Description

Set of graphical tools for Mercurial

Added to portage

2026-12-05

2026-12-04
Search-Xapian - 1.2.25.7
Ebuild name:

dev-perl/Search-Xapian-1.2.25.7

Description

Perl XS frontend to the Xapian C++ search library

Added to portage

2026-12-04

ada - 4.1.1
Ebuild name:

dev-cpp/ada-4.1.1

Description

WHATWG-compliant and fast URL parser written in modern C++

Added to portage

2026-12-04

ardour - 9.11.0
Ebuild name:

media-sound/ardour-9.11.0

Description

Digital Audio Workstation

Added to portage

2026-12-04

aws-c-common - 1.0.7
Ebuild name:

dev-libs/aws-c-common-1.0.7

Description

Core c99 package for AWS SDK for C

Added to portage

2026-12-04

aws-c-io - 1.1.4
Ebuild name:

dev-libs/aws-c-io-1.1.4

Description

AWS C IO It handles all IO and TLS work for application protocols

Added to portage

2026-12-04

buildbot-worker - 4.3.0
Ebuild name:

dev-util/buildbot-worker-4.3.0

Description

BuildBot Worker Daemon

Added to portage

2026-12-04

chipass - 2026.11.2
Ebuild name:

app-admin/chipass-2026.11.2

Description

A slop-free, Qt6 secure password manager

Added to portage

2026-12-04

claude-code - 2.1.336
Ebuild name:

dev-util/claude-code-2.1.336

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2026-12-04

cloudflare-warp - 2026.9.3927.0
Ebuild name:

net-vpn/cloudflare-warp-2026.9.3927.0

Description

Cloudflare Warp Client

Added to portage

2026-12-04

containerd - 2.4.3
Ebuild name:

app-containers/containerd-2.4.3

Description

A daemon to control runC

Added to portage

2026-12-04

diffofdiffs - 1.1.0
Ebuild name:

dev-util/diffofdiffs-1.1.0

Description

Compare two patches or Git commits side by side

Added to portage

2026-12-04

fastapi - 0.165.1
Ebuild name:

dev-python/fastapi-0.165.1

Description

High performance framework, easy to learn, fast to code, ready for produ

Added to portage

2026-12-04

fastexcel - 0.22.0
Ebuild name:

dev-python/fastexcel-0.22.0

Description

A fast excel file reader for Python, written in Rust

Added to portage

2026-12-04

fj-cli - 0.7.0
Ebuild name:

dev-util/fj-cli-0.7.0

Description

CLI tool for Forgejo

Added to portage

2026-12-04

geant - 4.11.5.0
Ebuild name:

sci-physics/geant-4.11.5.0

Description

Toolkit for simulation of passage of particles through matter

Added to portage

2026-12-04

geant-data - 4.11.5
Ebuild name:

sci-physics/geant-data-4.11.5

Description

Data files for Geant4 physical processes

Added to portage

2026-12-04

gforth - 1.0.2
Ebuild name:

dev-lang/gforth-1.0.2

Description

GNU Forth is a fast and portable implementation of the ANSI Forth language

Added to portage

2026-12-04

gmime - 3.2.16
Ebuild name:

dev-libs/gmime-3.2.16

Description

Library for creating and parsing MIME messages

Added to portage

2026-12-04

google-api-python-client - 2.203.0
Ebuild name:

dev-python/google-api-python-client-2.203.0

Description

Google API Client for Python

Added to portage

2026-12-04

google-auth - 2.63.3
Ebuild name:

dev-python/google-auth-2.63.3

Description

Google Authentication Library

Added to portage

2026-12-04

highlight-indentation - 0.7.0_p20210221
Ebuild name:

app-emacs/highlight-indentation-0.7.0_p20210221

Description

Minor modes to highlight indentation guides in Emac

Added to portage

2026-12-04

httpx2 - 2.17.1
Ebuild name:

dev-python/httpx2-2.17.1

Description

The next generation HTTP client (Pydantic fork)

Added to portage

2026-12-04

idna - 3.21
Ebuild name:

dev-python/idna-3.21

Description

Internationalized Domain Names in Applications (IDNA)

Added to portage

2026-12-04

intellij-idea - 2026.3.1
Ebuild name:

dev-util/intellij-idea-2026.3.1

Description

A complete toolset for web, mobile and enterprise development

Added to portage

2026-12-04

iosevka - 34.9.2
Ebuild name:

media-fonts/iosevka-34.9.2

Description

Slender typeface for code, from code

Added to portage

2026-12-04

ipython-pygments-lexers - 1.2.0
Ebuild name:

dev-python/ipython-pygments-lexers-1.2.0

Description

Pygments lexers for syntax-highlighting IPython code and s

Added to portage

2026-12-04

jdk - 29
Ebuild name:

virtual/jdk-29

Description

Virtual for Java Development Kit (JDK)

Added to portage

2026-12-04

jre - 29
Ebuild name:

virtual/jre-29

Description

Virtual for Java Runtime Environment (JRE)

Added to portage

2026-12-04

jupyterlab - 4.6.7
Ebuild name:

dev-python/jupyterlab-4.6.7

Description

JupyterLab computational environment

Added to portage

2026-12-04

kcoreaddons - 6.31.0-r1
Ebuild name:

kde-frameworks/kcoreaddons-6.31.0-r1

Description

Framework for solving common problems such as caching, randomi

Added to portage

2026-12-04

kcoreaddons - 6.32.0-r1
Ebuild name:

kde-frameworks/kcoreaddons-6.32.0-r1

Description

Framework for solving common problems such as caching, randomi

Added to portage

2026-12-04

libffi - 3.8.2
Ebuild name:

dev-libs/libffi-3.8.2

Description

Portable, high level programming interface to various calling conventions

Added to portage

2026-12-04

libffi - 3.8.3
Ebuild name:

dev-libs/libffi-3.8.3

Description

Portable, high level programming interface to various calling conventions

Added to portage

2026-12-04

libhx - 5.7
Ebuild name:

sys-libs/libhx-5.7

Description

Platform independent library providing basic system functions

Added to portage

2026-12-04

libpass - 1.9.6
Ebuild name:

dev-python/libpass-1.9.6

Description

Comprehensive password hashing framework supporting over 30 schemes

Added to portage

2026-12-04

llhttp - 9.5.0
Ebuild name:

net-libs/llhttp-9.5.0

Description

Port of http_parser to llparse

Added to portage

2026-12-04

mattermost-desktop-bin - 6.2.6
Ebuild name:

net-im/mattermost-desktop-bin-6.2.6

Description

Mattermost Desktop application

Added to portage

2026-12-04

mattermost-desktop-bin - 6.4.1
Ebuild name:

net-im/mattermost-desktop-bin-6.4.1

Description

Mattermost Desktop application

Added to portage

2026-12-04

openjdk - 29_alpha0
Ebuild name:

dev-java/openjdk-29_alpha0

Description

Open source implementation of the Java programming language

Added to portage

2026-12-04

parboiled - 1.4.1-r1
Ebuild name:

dev-java/parboiled-1.4.1-r1

Description

Elegant parsing in Java and Scala - lightweight, easy-to-use, powerful

Added to portage

2026-12-04

pixi - 0.86.0
Ebuild name:

dev-util/pixi-0.86.0

Description

A package management and workflow tool

Added to portage

2026-12-04

plocate - 1.1.25
Ebuild name:

sys-apps/plocate-1.1.25

Description

Posting locate is a much faster locate

Added to portage

2026-12-04

pydantic-settings - 2.16.4
Ebuild name:

dev-python/pydantic-settings-2.16.4

Description

Settings management using Pydantic

Added to portage

2026-12-04

pyotp - 2.12.4
Ebuild name:

dev-python/pyotp-2.12.4

Description

PyOTP is a Python library for generating and verifying one-time passwords

Added to portage

2026-12-04

pypy - 3.12.8.1.1
Ebuild name:

dev-lang/pypy-3.12.8.1.1

Description

A fast, compliant alternative implementation of the Python () language

Added to portage

2026-12-04

pypy3-exe - 3.12.8.1.1
Ebuild name:

dev-lang/pypy3-exe-3.12.8.1.1

Description

PyPy3.12 executable (build from source)

Added to portage

2026-12-04

pypy3-exe-bin - 3.12.8.1.1
Ebuild name:

dev-lang/pypy3-exe-bin-3.12.8.1.1

Description

PyPy executable (pre-built version)

Added to portage

2026-12-04

pytest-check - 3.2.0
Ebuild name:

dev-python/pytest-check-3.2.0

Description

pytest plugin that allows multiple failures per test

Added to portage

2026-12-04

python-dbusmock - 0.38.2
Ebuild name:

dev-python/python-dbusmock-0.38.2

Description

Easily create mock objects on D-Bus for software testing

Added to portage

2026-12-04

qbittorrent - 5.3.1
Ebuild name:

net-p2p/qbittorrent-5.3.1

Description

BitTorrent client in C++ and Qt

Added to portage

2026-12-04

requests-credssp - 2.1.0
Ebuild name:

dev-python/requests-credssp-2.1.0

Description

HTTPS CredSSP authentication with the requests library

Added to portage

2026-12-04

shtab - 1.14.1
Ebuild name:

dev-python/shtab-1.14.1

Description

Automagic shell tab completion for Python CLI applications

Added to portage

2026-12-04

signxml - 5.4.0
Ebuild name:

dev-python/signxml-5.4.0

Description

Python XML Signature and XAdES library

Added to portage

2026-12-04

simdjson - 5.4.0
Ebuild name:

dev-libs/simdjson-5.4.0

Description

SIMD accelerated C++ JSON library

Added to portage

2026-12-04

simpleagenda - 0.51
Ebuild name:

gnustep-apps/simpleagenda-0.51

Description

Simple calendar and agenda application

Added to portage

2026-12-04

slirp4netns - 1.3.8
Ebuild name:

app-containers/slirp4netns-1.3.8

Description

User-mode networking for unprivileged network namespaces

Added to portage

2026-12-04

sourcegit - 2026.25
Ebuild name:

dev-vcs/sourcegit-2026.25

Description

Open Source Git GUI client using .NET AvaloniaUI

Added to portage

2026-12-04

terraform - 1.17.3
Ebuild name:

app-admin/terraform-1.17.3

Description

A tool for building, changing, and combining infrastructure safely

Added to portage

2026-12-04

tesseract - 5.5.5
Ebuild name:

app-text/tesseract-5.5.5

Description

An OCR Engine, originally developed at HP, now open source

Added to portage

2026-12-04

timescaledb - 2.32.2
Ebuild name:

dev-db/timescaledb-2.32.2

Description

Open-source time-series SQL database

Added to portage

2026-12-04

translate-toolkit - 3.21.2
Ebuild name:

dev-python/translate-toolkit-3.21.2

Description

Toolkit to convert between many translation formats

Added to portage

2026-12-04

ty - 1.1.0
Ebuild name:

dev-util/ty-1.1.0

Description

An extremely fast Python type checker and language server, written in Rust

Added to portage

2026-12-04

types-setuptools - 84.2.0.20261204
Ebuild name:

dev-python/types-setuptools-84.2.0.20261204

Description

Typing stubs for setuptools

Added to portage

2026-12-04

uasm - 2.60
Ebuild name:

dev-lang/uasm-2.60

Description

UASM is a free MASM-compatible assembler

Added to portage

2026-12-04

udev-hid-bpf - 2.3.0_p20260703
Ebuild name:

sys-kernel/udev-hid-bpf-2.3.0_p20260703

Description

Automatic HID-BPF loader based on udev events for device wo

Added to portage

2026-12-04

vec - 0.5.1.1
Ebuild name:

dev-haskell/vec-0.5.1.1

Description

Vec length-indexed (sized) list

Added to portage

2026-12-04

vkd3d-proton - 3.2
Ebuild name:

app-emulation/vkd3d-proton-3.2

Description

Fork of VKD3D, development branches for Proton's Direct3D 12 impleme

Added to portage

2026-12-04

wcwidth - 0.9.6
Ebuild name:

dev-python/wcwidth-0.9.6

Description

Measures number of Terminal column cells of wide-character codes

Added to portage

2026-12-04

wdiff - 1.2.3-r1
Ebuild name:

app-text/wdiff-1.2.3-r1

Description

Create a diff disregarding formatting

Added to portage

2026-12-04

webkit-gtk - 2.54.4-r410
Ebuild name:

net-libs/webkit-gtk-2.54.4-r410

Description

Open source web browser engine

Added to portage

2026-12-04

webkit-gtk - 2.54.4-r600
Ebuild name:

net-libs/webkit-gtk-2.54.4-r600

Description

Open source web browser engine

Added to portage

2026-12-04

xapian - 2.2.0
Ebuild name:

dev-libs/xapian-2.2.0

Description

Xapian Probabilistic Information Retrieval library

Added to portage

2026-12-04

xapian-bindings - 2.2.0
Ebuild name:

dev-libs/xapian-bindings-2.2.0

Description

SWIG and JNI bindings for Xapian

Added to portage

2026-12-04

xapian-omega - 2.2.0
Ebuild name:

app-text/xapian-omega-2.2.0

Description

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

Added to portage

2026-12-04

xarray - 2026.12.0
Ebuild name:

dev-python/xarray-2026.12.0

Description

N-D labeled arrays and datasets in Python

Added to portage

2026-12-04

xfce4-appfinder - 4.21.2
Ebuild name:

xfce-base/xfce4-appfinder-4.21.2

Description

A tool to find and launch installed applications for the Xfce desk

Added to portage

2026-12-04

xfce4-screenshooter - 1.11.4
Ebuild name:

xfce-extra/xfce4-screenshooter-1.11.4

Description

Xfce4 screenshooter application and panel plugin

Added to portage

2026-12-04

youtube-search-python - 1.6.6-r4
Ebuild name:

dev-python/youtube-search-python-1.6.6-r4

Description

Get YouTube video information using link WITHOUT YouTube

Added to portage

2026-12-04

z3 - 5.4.2
Ebuild name:

sci-mathematics/z3-5.4.2

Description

An efficient theorem prover

Added to portage

2026-12-04

zoxide - 0.11.0
Ebuild name:

app-shells/zoxide-0.11.0

Description

A smarter cd command for your terminal

Added to portage

2026-12-04

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