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:

90206

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-11-14
2026-11-13
aioquic - 1.8.0
Ebuild name:

dev-python/aioquic-1.8.0

Description

An implementation of QUIC and HTTP/3

Added to portage

2026-11-13

awkward - 2.15.0
Ebuild name:

dev-python/awkward-2.15.0

Description

Manipulate JSON-like data with NumPy-like idioms

Added to portage

2026-11-13

awkward-cpp - 58
Ebuild name:

dev-python/awkward-cpp-58

Description

CPU kernels and compiled extensions for Awkward Array

Added to portage

2026-11-13

aws-crt-cpp - 0.44.4
Ebuild name:

dev-cpp/aws-crt-cpp-0.44.4

Description

C++ wrapper around the aws-c-* libraries

Added to portage

2026-11-13

backrefs - 8.3
Ebuild name:

dev-python/backrefs-8.3

Description

Wrapper around re or regex that adds additional back references

Added to portage

2026-11-13

blender-bin - 4.2.23
Ebuild name:

media-gfx/blender-bin-4.2.23

Description

3D Creation/Animation/Publishing System

Added to portage

2026-11-13

blender-bin - 4.3.2
Ebuild name:

media-gfx/blender-bin-4.3.2

Description

3D Creation/Animation/Publishing System

Added to portage

2026-11-13

blender-bin - 4.4.3
Ebuild name:

media-gfx/blender-bin-4.4.3

Description

3D Creation/Animation/Publishing System

Added to portage

2026-11-13

blender-bin - 4.5.15
Ebuild name:

media-gfx/blender-bin-4.5.15

Description

3D Creation/Animation/Publishing System

Added to portage

2026-11-13

blender-bin - 5.0.1
Ebuild name:

media-gfx/blender-bin-5.0.1

Description

3D Creation/Animation/Publishing System

Added to portage

2026-11-13

blender-bin - 5.1.2
Ebuild name:

media-gfx/blender-bin-5.1.2

Description

3D Creation/Animation/Publishing System

Added to portage

2026-11-13

blender-bin - 5.2.3
Ebuild name:

media-gfx/blender-bin-5.2.3

Description

3D Creation/Animation/Publishing System

Added to portage

2026-11-13

blender-bin - 5.3.0
Ebuild name:

media-gfx/blender-bin-5.3.0

Description

3D Creation/Animation/Publishing System

Added to portage

2026-11-13

bluez - 5.88
Ebuild name:

net-wireless/bluez-5.88

Description

Bluetooth Tools and System Daemons for Linux

Added to portage

2026-11-13

boost - 1.91.0-r4
Ebuild name:

dev-libs/boost-1.91.0-r4

Description

Boost Libraries for C++

Added to portage

2026-11-13

bottleneck - 1.6.1
Ebuild name:

dev-python/bottleneck-1.6.1

Description

Fast NumPy array functions written in C

Added to portage

2026-11-13

bottom - 0.14.9
Ebuild name:

sys-process/bottom-0.14.9

Description

A graphical process/system monitor with a customizable interface

Added to portage

2026-11-13

bufexplorer - 7.14.0
Ebuild name:

app-vim/bufexplorer-7.14.0

Description

vim plugin easily browse vim buffers

Added to portage

2026-11-13

buildah - 1.46.1
Ebuild name:

app-containers/buildah-1.46.1

Description

A tool that facilitates building OCI images

Added to portage

2026-11-13

c-blosc2 - 3.6.2
Ebuild name:

dev-libs/c-blosc2-3.6.2

Description

Blocking, shuffling and lossless compression library

Added to portage

2026-11-13

cfn-lint - 1.60.1
Ebuild name:

dev-python/cfn-lint-1.60.1

Description

CloudFormation Linter

Added to portage

2026-11-13

chrome-binary-plugins - 157.0.8103.78
Ebuild name:

www-plugins/chrome-binary-plugins-157.0.8103.78

Description

Binary plugins from Google Chrome for use in Chromi

Added to portage

2026-11-13

chromedriver-bin - 157.0.8103.78
Ebuild name:

www-apps/chromedriver-bin-157.0.8103.78

Description

WebDriver for Chrome

Added to portage

2026-11-13

cpp-httplib - 0.66.0
Ebuild name:

dev-cpp/cpp-httplib-0.66.0

Description

C++ HTTP/HTTPS server and client library

Added to portage

2026-11-13

dash - 0.5.13.6
Ebuild name:

app-shells/dash-0.5.13.6

Description

Debian Almquist Shell

Added to portage

2026-11-13

edi - 0.9.0
Ebuild name:

dev-util/edi-0.9.0

Description

An EFL-based IDE

Added to portage

2026-11-13

entice - 0.1.0
Ebuild name:

media-gfx/entice-0.1.0

Description

A simple image viewer based on EFL

Added to portage

2026-11-13

evisum - 2.0.16
Ebuild name:

sys-process/evisum-2.0.16

Description

System and process monitor written with EFL

Added to portage

2026-11-13

exheres-syntax - 20250323
Ebuild name:

app-vim/exheres-syntax-20250323

Description

vim plugin exheres format highlighting

Added to portage

2026-11-13

gherkin-official - 43.0.0
Ebuild name:

dev-python/gherkin-official-43.0.0

Description

Gherkin parser/compiler for Python

Added to portage

2026-11-13

ghostty - 1.4.0-r1
Ebuild name:

x11-terms/ghostty-1.4.0-r1

Description

Fast, feature-rich, and cross-platform terminal emulator

Added to portage

2026-11-13

gnome-autoar - 0.5.2
Ebuild name:

app-arch/gnome-autoar-0.5.2

Description

Automatic archives creating and extracting library

Added to portage

2026-11-13

gnome-shell-extension-desktop-icons-ng - 51.4.0
Ebuild name:

gnome-extra/gnome-shell-extension-desktop-icons-ng-51.4.0

Description

Desktop icon support for GNOME Shell

Added to portage

2026-11-13

gnome-shell-extension-weather-oclock - 51.0
Ebuild name:

gnome-extra/gnome-shell-extension-weather-oclock-51.0

Description

Display the current weather inside the pill n

Added to portage

2026-11-13

google-chrome - 157.0.8103.78
Ebuild name:

www-client/google-chrome-157.0.8103.78

Description

The web browser from Google

Added to portage

2026-11-13

gunicorn - 27.0.1
Ebuild name:

www-servers/gunicorn-27.0.1

Description

A WSGI HTTP Server for UNIX

Added to portage

2026-11-13

humanize - 4.17.0
Ebuild name:

dev-python/humanize-4.17.0

Description

Common humanization utilities

Added to portage

2026-11-13

ibus - 1.5.35
Ebuild name:

app-i18n/ibus-1.5.35

Description

Intelligent Input Bus for Linux / Unix OS

Added to portage

2026-11-13

josm-bin - 19678
Ebuild name:

sci-geosciences/josm-bin-19678

Description

Java-based editor for the OpenStreetMap project

Added to portage

2026-11-13

js-comint - 1.2.0
Ebuild name:

app-emacs/js-comint-1.2.0

Description

Run a JavaScript interpreter in an Emacs inferior process window

Added to portage

2026-11-13

js2-mode - 20230408
Ebuild name:

app-emacs/js2-mode-20230408

Description

Improved JavaScript editing mode for GNU Emacs

Added to portage

2026-11-13

js2-mode - 20231224
Ebuild name:

app-emacs/js2-mode-20231224

Description

Improved JavaScript editing mode for GNU Emacs

Added to portage

2026-11-13

js2-mode - 20231224
Ebuild name:

app-emacs/js2-mode-20231224

Description

Improved JavaScript editing mode for GNU Emacs

Added to portage

2026-11-13

julia-mode - 0.4_p20211023
Ebuild name:

app-emacs/julia-mode-0.4_p20211023

Description

Emacs major mode for the Julia programming language

Added to portage

2026-11-13

julia-repl - 1.3.0_p20220225
Ebuild name:

app-emacs/julia-repl-1.3.0_p20220225

Description

Run an inferior Julia REPL in a terminal inside Emacs

Added to portage

2026-11-13

lerc - 4.3.0
Ebuild name:

media-libs/lerc-4.3.0

Description

Limited Error Raster Compression

Added to portage

2026-11-13

libghostty-vt - 1.0.0
Ebuild name:

dev-libs/libghostty-vt-1.0.0

Description

Zero-dependency C library for parsing terminal sequences and managing

Added to portage

2026-11-13

libsecret - 0.21.7
Ebuild name:

app-crypt/libsecret-0.21.7

Description

GObject library for accessing the freedesktop.org Secret Service API

Added to portage

2026-11-13

libxmlb - 0.3.30
Ebuild name:

dev-libs/libxmlb-0.3.30

Description

Library to help create and query binary XML blobs

Added to portage

2026-11-13

logs-syslog - 0.5.0
Ebuild name:

dev-ml/logs-syslog-0.5.0

Description

Logs reporter to syslog (UDP/TCP/TLS)

Added to portage

2026-11-13

mdatp - 0
Ebuild name:

acct-group/mdatp-0

Description

Group for app-antivirus/mdatp

Added to portage

2026-11-13

mdatp - 0
Ebuild name:

acct-user/mdatp-0

Description

User for app-antivirus/mdatp

Added to portage

2026-11-13

mdatp - 101.26101.0000
Ebuild name:

app-antivirus/mdatp-101.26101.0000

Description

Microsoft Defender Advanced Threat Protection for Endpoints

Added to portage

2026-11-13

mobile-broadband-provider-info - 20261111
Ebuild name:

net-misc/mobile-broadband-provider-info-20261111

Description

Database of mobile broadband service providers

Added to portage

2026-11-13

moodle - 4.5.16
Ebuild name:

www-apps/moodle-4.5.16

Description

The Moodle Course Management System

Added to portage

2026-11-13

moodle - 5.2.5
Ebuild name:

www-apps/moodle-5.2.5

Description

The Moodle Course Management System

Added to portage

2026-11-13

moodle - 5.3.1
Ebuild name:

www-apps/moodle-5.3.1

Description

The Moodle Course Management System

Added to portage

2026-11-13

ncspot - 1.5.1
Ebuild name:

media-sound/ncspot-1.5.1

Description

ncurses Spotify client written in Rust using librespot

Added to portage

2026-11-13

opencl-icd-loader - 2026.05.29-r1
Ebuild name:

dev-libs/opencl-icd-loader-2026.05.29-r1

Description

Official Khronos OpenCL ICD Loader

Added to portage

2026-11-13

opera - 140.0.6074.18
Ebuild name:

www-client/opera-140.0.6074.18

Description

A fast and secure web browser

Added to portage

2026-11-13

opera-gx - 139.0.6053.63
Ebuild name:

www-client/opera-gx-139.0.6053.63

Description

Opera, but for 'gamers'

Added to portage

2026-11-13

oslotest - 6.2.0
Ebuild name:

dev-python/oslotest-6.2.0

Description

Oslo test framework

Added to portage

2026-11-13

pikepdf - 10.18.1
Ebuild name:

dev-python/pikepdf-10.18.1

Description

Python library to work with pdf files based on qpdf

Added to portage

2026-11-13

podman - 6.2.0
Ebuild name:

app-containers/podman-6.2.0

Description

A tool for managing OCI containers and pods with Docker-compatible CLI

Added to portage

2026-11-13

postfix - 3.12_pre20261109
Ebuild name:

mail-mta/postfix-3.12_pre20261109

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2026-11-13

postgresql - 14.25
Ebuild name:

dev-db/postgresql-14.25

Description

PostgreSQL RDBMS

Added to portage

2026-11-13

postgresql - 15.20
Ebuild name:

dev-db/postgresql-15.20

Description

PostgreSQL RDBMS

Added to portage

2026-11-13

postgresql - 16.16
Ebuild name:

dev-db/postgresql-16.16

Description

PostgreSQL RDBMS

Added to portage

2026-11-13

postgresql - 17.12
Ebuild name:

dev-db/postgresql-17.12

Description

PostgreSQL RDBMS

Added to portage

2026-11-13

postgresql - 18.7
Ebuild name:

dev-db/postgresql-18.7

Description

PostgreSQL RDBMS

Added to portage

2026-11-13

postgresql - 19_rc2
Ebuild name:

dev-db/postgresql-19_rc2

Description

PostgreSQL RDBMS

Added to portage

2026-11-13

pp_loc - 2.1.0
Ebuild name:

dev-ml/pp_loc-2.1.0

Description

Quote and highlight input fragments at a given source location

Added to portage

2026-11-13

psycopg - 3.3.9
Ebuild name:

dev-python/psycopg-3.3.9

Description

PostgreSQL database adapter for Python

Added to portage

2026-11-13

pylsqpack - 1.1.1
Ebuild name:

dev-python/pylsqpack-1.1.1

Description

Python wrapper for the ls-qpack QPACK library

Added to portage

2026-11-13

pymongo - 4.20.0
Ebuild name:

dev-python/pymongo-4.20.0

Description

Python driver for MongoDB

Added to portage

2026-11-13

pytest-asyncio - 1.5.0
Ebuild name:

dev-python/pytest-asyncio-1.5.0

Description

Library for testing asyncio code with pytest

Added to portage

2026-11-13

python-utils - 4.2.1
Ebuild name:

dev-python/python-utils-4.2.1

Description

Collection of small Python functions & classes

Added to portage

2026-11-13

qtkeychain - 0.18.0
Ebuild name:

dev-libs/qtkeychain-0.18.0

Description

Qt API for storing passwords securely

Added to portage

2026-11-13

qtwebengine - 6.140.0
Ebuild name:

dev-qt/qtwebengine-6.140.0

Description

Library for rendering dynamic web content in Qt6 C++ and QML application

Added to portage

2026-11-13

ruff - 0.17.5
Ebuild name:

dev-util/ruff-0.17.5

Description

An extremely fast Python linter, written in Rust

Added to portage

2026-11-13

signxml - 5.3.0
Ebuild name:

dev-python/signxml-5.3.0

Description

Python XML Signature and XAdES library

Added to portage

2026-11-13

skopeo - 1.25.1
Ebuild name:

app-containers/skopeo-1.25.1

Description

Work with remote container images registries

Added to portage

2026-11-13

spidermonkey - 153.7.0
Ebuild name:

dev-lang/spidermonkey-153.7.0

Description

Mozilla's JavaScript engine written in C and C++

Added to portage

2026-11-13

stevedore - 5.10.0
Ebuild name:

dev-python/stevedore-5.10.0

Description

Manage dynamic plugins for Python applications

Added to portage

2026-11-13

syslog-message - 1.2.0
Ebuild name:

dev-ml/syslog-message-1.2.0

Description

Syslog message parser

Added to portage

2026-11-13

texttable - 1.7.3
Ebuild name:

dev-python/texttable-1.7.3

Description

Module to create simple ASCII tables

Added to portage

2026-11-13

tifffile - 2026.11.12
Ebuild name:

dev-python/tifffile-2026.11.12

Description

Read and write TIFF files

Added to portage

2026-11-13

tinyssh - 20261101
Ebuild name:

net-misc/tinyssh-20261101

Description

A small SSH server with state-of-the-art cryptography

Added to portage

2026-11-13

trimesh - 5.2.1
Ebuild name:

dev-python/trimesh-5.2.1

Description

Python library for loading and using triangular meshes

Added to portage

2026-11-13

urwid - 5.1.3
Ebuild name:

dev-python/urwid-5.1.3

Description

Curses-based user interface library for Python

Added to portage

2026-11-13

uv - 0.13.8
Ebuild name:

dev-python/uv-0.13.8

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-11-13

uv-build - 0.13.8
Ebuild name:

dev-python/uv-build-0.13.8

Description

PEP517 uv build backend

Added to portage

2026-11-13

vimtex - 2.18
Ebuild name:

app-vim/vimtex-2.18

Description

vim plugin a modern vim plugin for editing LaTeX files

Added to portage

2026-11-13

yle-dl - 20261106
Ebuild name:

media-video/yle-dl-20261106

Description

Download media files from Yle Areena

Added to portage

2026-11-13

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