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:

89538

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-10-25
amf-headers - 1.5.2
Ebuild name:

media-libs/amf-headers-1.5.2

Description

The Advanced Media Framework (AMF) SDK

Added to portage

2026-10-25

pkgcheck - 0.10.49
Ebuild name:

dev-util/pkgcheck-0.10.49

Description

pkgcore-based QA utility for ebuild repos

Added to portage

2026-10-25

pkgcore - 0.12.48
Ebuild name:

sys-apps/pkgcore-0.12.48

Description

a framework for package management

Added to portage

2026-10-25

pkgdev - 0.2.19
Ebuild name:

dev-util/pkgdev-0.2.19

Description

Collection of tools for Gentoo development

Added to portage

2026-10-25

qbittorrent - 5.3.0
Ebuild name:

net-p2p/qbittorrent-5.3.0

Description

BitTorrent client in C++ and Qt

Added to portage

2026-10-25

simdutf - 9.3.2
Ebuild name:

dev-cpp/simdutf-9.3.2

Description

Unicode validation and transcoding at billions of characters per second

Added to portage

2026-10-25

softhsm - 2.7.0
Ebuild name:

dev-libs/softhsm-2.7.0

Description

A software PKCS11 implementation

Added to portage

2026-10-25

2026-10-24
asgiref - 3.13.0
Ebuild name:

dev-python/asgiref-3.13.0

Description

ASGI utilities (successor to WSGI)

Added to portage

2026-10-24

aws-c-sdkutils - 1.0.1
Ebuild name:

dev-libs/aws-c-sdkutils-1.0.1

Description

AWS C SDKUTILS C99 library implementing AWS SDK specific utilities

Added to portage

2026-10-24

awscli - 1.46.2
Ebuild name:

app-admin/awscli-1.46.2

Description

Universal Command Line Environment for AWS

Added to portage

2026-10-24

awscli - 2.38.5
Ebuild name:

app-admin/awscli-2.38.5

Description

Universal Command Line Environment for AWS

Added to portage

2026-10-24

boto3 - 1.43.118
Ebuild name:

dev-python/boto3-1.43.118

Description

The AWS SDK for Python

Added to portage

2026-10-24

botocore - 1.43.118
Ebuild name:

dev-python/botocore-1.43.118

Description

Low-level, data-driven core of boto 3

Added to portage

2026-10-24

btrfs-progs - 7.3
Ebuild name:

sys-fs/btrfs-progs-7.3

Description

Btrfs filesystem utilities

Added to portage

2026-10-24

btrfsutil - 7.3
Ebuild name:

dev-python/btrfsutil-7.3

Description

Library for managing Btrfs filesystems

Added to portage

2026-10-24

bzip3 - 1.5.5
Ebuild name:

app-arch/bzip3-1.5.5

Description

A better and stronger spiritual successor to BZip2

Added to portage

2026-10-24

chocolate-doom - 3.1.1-r1
Ebuild name:

games-fps/chocolate-doom-3.1.1-r1

Description

A Doom source port that is minimalist and historically accurate

Added to portage

2026-10-24

crystal - 1.22.1
Ebuild name:

dev-lang/crystal-1.22.1

Description

The Crystal Programming Language

Added to portage

2026-10-24

dbus-python - 1.5.1
Ebuild name:

dev-python/dbus-python-1.5.1

Description

Python bindings for the D-Bus messagebus

Added to portage

2026-10-24

dnscrypt-proxy - 2.1.16-r2
Ebuild name:

net-dns/dnscrypt-proxy-2.1.16-r2

Description

Flexible DNS proxy, with support for encrypted DNS protocols

Added to portage

2026-10-24

dnscrypt-proxy - 2.1.20
Ebuild name:

net-dns/dnscrypt-proxy-2.1.20

Description

Flexible DNS proxy, with support for encrypted DNS protocols

Added to portage

2026-10-24

duckdb - 2.0.0-r1
Ebuild name:

dev-db/duckdb-2.0.0-r1

Description

high-performance analytical database system

Added to portage

2026-10-24

entropy - 0.4.1.11-r1
Ebuild name:

dev-haskell/entropy-0.4.1.11-r1

Description

A platform independent entropy source

Added to portage

2026-10-24

fangfrisch - 1.9.3
Ebuild name:

app-antivirus/fangfrisch-1.9.3

Description

Update and verify unofficial Clam Anti-Virus signatures

Added to portage

2026-10-24

fastapi - 0.162.0
Ebuild name:

dev-python/fastapi-0.162.0

Description

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

Added to portage

2026-10-24

findpython - 0.9.0
Ebuild name:

dev-python/findpython-0.9.0

Description

A utility to find python versions on your system

Added to portage

2026-10-24

gamescope - 3.17.0
Ebuild name:

gui-wm/gamescope-3.17.0

Description

Efficient micro-compositor for running games

Added to portage

2026-10-24

git-lfs - 3.8.1
Ebuild name:

dev-vcs/git-lfs-3.8.1

Description

Command line extension and specification for managing large files with git

Added to portage

2026-10-24

heirloom-tools - 070715-r8
Ebuild name:

sys-apps/heirloom-tools-070715-r8

Description

Heirloom toolchest - original Unix tools

Added to portage

2026-10-24

hypothesis - 6.170.9
Ebuild name:

dev-python/hypothesis-6.170.9

Description

A library for property based testing

Added to portage

2026-10-24

ibus-typing-booster - 2.31.2
Ebuild name:

app-i18n/ibus-typing-booster-2.31.2

Description

Completion input method for IBus

Added to portage

2026-10-24

importlib-metadata - 10.1.0
Ebuild name:

dev-python/importlib-metadata-10.1.0

Description

Read metadata from Python packages

Added to portage

2026-10-24

json-c - 0.19-r3
Ebuild name:

dev-libs/json-c-0.19-r3

Description

A JSON implementation in C

Added to portage

2026-10-24

jsonpath-ng - 1.13.0
Ebuild name:

dev-python/jsonpath-ng-1.13.0

Description

Python JSONPath Next-Generation

Added to portage

2026-10-24

libp11 - 0.4.21
Ebuild name:

dev-libs/libp11-0.4.21

Description

Abstraction layer to simplify PKCS11 API

Added to portage

2026-10-24

libtorrent-rasterbar - 2.1.2
Ebuild name:

net-libs/libtorrent-rasterbar-2.1.2

Description

C++ BitTorrent implementation focusing on efficiency and scalab

Added to portage

2026-10-24

libva - 2.23.0-r1
Ebuild name:

media-libs/libva-2.23.0-r1

Description

Video Acceleration (VA) API for Linux

Added to portage

2026-10-24

libva - 2.24.1-r1
Ebuild name:

media-libs/libva-2.24.1-r1

Description

Video Acceleration (VA) API for Linux

Added to portage

2026-10-24

libva-compat - 1.8.3-r4
Ebuild name:

media-libs/libva-compat-1.8.3-r4

Description

Video Acceleration (VA) API for Linux

Added to portage

2026-10-24

libva-intel-driver - 2.4.5-r1
Ebuild name:

media-libs/libva-intel-driver-2.4.5-r1

Description

HW video decode support for Intel integrated graphics

Added to portage

2026-10-24

libva-intel-media-driver - 26.1.6-r1
Ebuild name:

media-libs/libva-intel-media-driver-26.1.6-r1

Description

Intel Media Driver for VA-API (iHD)

Added to portage

2026-10-24

libva-intel-media-driver - 26.2.0-r1
Ebuild name:

media-libs/libva-intel-media-driver-26.2.0-r1

Description

Intel Media Driver for VA-API (iHD)

Added to portage

2026-10-24

libva-intel-media-driver - 26.2.1-r1
Ebuild name:

media-libs/libva-intel-media-driver-26.2.1-r1

Description

Intel Media Driver for VA-API (iHD)

Added to portage

2026-10-24

libva-intel-media-driver - 26.2.3-r1
Ebuild name:

media-libs/libva-intel-media-driver-26.2.3-r1

Description

Intel Media Driver for VA-API (iHD)

Added to portage

2026-10-24

libva-intel-media-driver - 26.2.4-r1
Ebuild name:

media-libs/libva-intel-media-driver-26.2.4-r1

Description

Intel Media Driver for VA-API (iHD)

Added to portage

2026-10-24

libva-intel-media-driver - 26.3.1-r1
Ebuild name:

media-libs/libva-intel-media-driver-26.3.1-r1

Description

Intel Media Driver for VA-API (iHD)

Added to portage

2026-10-24

libva-intel-media-driver - 26.3.2-r1
Ebuild name:

media-libs/libva-intel-media-driver-26.3.2-r1

Description

Intel Media Driver for VA-API (iHD)

Added to portage

2026-10-24

libva-intel-media-driver - 26.3.3-r1
Ebuild name:

media-libs/libva-intel-media-driver-26.3.3-r1

Description

Intel Media Driver for VA-API (iHD)

Added to portage

2026-10-24

libva-intel-media-driver - 26.3.5-r1
Ebuild name:

media-libs/libva-intel-media-driver-26.3.5-r1

Description

Intel Media Driver for VA-API (iHD)

Added to portage

2026-10-24

lmfit - 9.0-r2
Ebuild name:

sci-libs/lmfit-9.0-r2

Description

library for Levenberg-Marquardt least-squares minimization and curve fitting

Added to portage

2026-10-24

man-pages-ja - 20261015
Ebuild name:

app-i18n/man-pages-ja-20261015

Description

Collection of manual pages translated into Japanese

Added to portage

2026-10-24

mesa - 26.1.8-r1
Ebuild name:

media-libs/mesa-26.1.8-r1

Description

OpenGL-like graphic library for Linux

Added to portage

2026-10-24

mesa - 26.2.2-r1
Ebuild name:

media-libs/mesa-26.2.2-r1

Description

OpenGL-like graphic library for Linux

Added to portage

2026-10-24

mesa - 26.2.3-r1
Ebuild name:

media-libs/mesa-26.2.3-r1

Description

OpenGL-like graphic library for Linux

Added to portage

2026-10-24

mesa - 26.2.4-r1
Ebuild name:

media-libs/mesa-26.2.4-r1

Description

OpenGL-like graphic library for Linux

Added to portage

2026-10-24

mesa - 26.2.5-r1
Ebuild name:

media-libs/mesa-26.2.5-r1

Description

OpenGL-like graphic library for Linux

Added to portage

2026-10-24

netcdf4 - 1.7.5.1_p1
Ebuild name:

dev-python/netcdf4-1.7.5.1_p1

Description

Python/numpy interface to the netCDF C library

Added to portage

2026-10-24

obs-studio - 33.0.0
Ebuild name:

media-video/obs-studio-33.0.0

Description

Software for Recording and Streaming Live Video Content

Added to portage

2026-10-24

opensc - 0.27.1-r1
Ebuild name:

dev-libs/opensc-0.27.1-r1

Description

Libraries and applications to access smartcards

Added to portage

2026-10-24

openssh-legacy - 9.9_p2
Ebuild name:

net-misc/openssh-legacy-9.9_p2

Description

Old versions of OpenSSH installed separately for legacy machines

Added to portage

2026-10-24

openssl - 4.1.0
Ebuild name:

dev-libs/openssl-4.1.0

Description

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

Added to portage

2026-10-24

openssl - 4.1.9999
Ebuild name:

dev-libs/openssl-4.1.9999

Description

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

Added to portage

2026-10-24

openssl-compat - 1.1.1w
Ebuild name:

dev-libs/openssl-compat-1.1.1w

Description

Full-strength general purpose cryptography library (including SSL an

Added to portage

2026-10-24

openssl-compat - 3.6.5
Ebuild name:

dev-libs/openssl-compat-3.6.5

Description

Full-strength general purpose cryptography library (including SSL and

Added to portage

2026-10-24

pshs - 0.4.4
Ebuild name:

www-servers/pshs-0.4.4

Description

Pretty small HTTP server -- a command-line tool to share files

Added to portage

2026-10-24

pyicu - 2.17
Ebuild name:

dev-python/pyicu-2.17

Description

Python bindings for dev-libs/icu

Added to portage

2026-10-24

python - 0.3.13.17_p1
Ebuild name:

dev-lang/python-0.3.13.17_p1

Description

Freethreading (no-GIL) version of Python programming language

Added to portage

2026-10-24

python - 0.3.14.9_p1
Ebuild name:

dev-lang/python-0.3.14.9_p1

Description

Freethreading (no-GIL) version of Python programming language

Added to portage

2026-10-24

python - 3.12.15_p1
Ebuild name:

dev-lang/python-3.12.15_p1

Description

An interpreted, interactive, object-oriented programming language

Added to portage

2026-10-24

python - 3.13.17_p1
Ebuild name:

dev-lang/python-3.13.17_p1

Description

An interpreted, interactive, object-oriented programming language

Added to portage

2026-10-24

python - 3.14.9_p1
Ebuild name:

dev-lang/python-3.14.9_p1

Description

An interpreted, interactive, object-oriented programming language

Added to portage

2026-10-24

python-tests - 0.3.14.9_p1
Ebuild name:

dev-python/python-tests-0.3.14.9_p1

Description

Test modules from dev-lang/python

Added to portage

2026-10-24

python-tests - 3.12.15_p1
Ebuild name:

dev-python/python-tests-3.12.15_p1

Description

Test modules from dev-lang/python

Added to portage

2026-10-24

python-tests - 3.13.17_p1
Ebuild name:

dev-python/python-tests-3.13.17_p1

Description

Test modules from dev-lang/python

Added to portage

2026-10-24

python-tests - 3.14.9_p1
Ebuild name:

dev-python/python-tests-3.14.9_p1

Description

Test modules from dev-lang/python

Added to portage

2026-10-24

recaptcha - 2.1.0
Ebuild name:

dev-php/recaptcha-2.1.0

Description

PHP client library for Google's reCAPTCHA service

Added to portage

2026-10-24

resolv - 0.7.2
Ebuild name:

dev-ruby/resolv-0.7.2

Description

Thread-aware DNS resolver library in Ruby

Added to portage

2026-10-24

ruby - 3.2.11-r1
Ebuild name:

dev-lang/ruby-3.2.11-r1

Description

An object-oriented scripting language

Added to portage

2026-10-24

ruby - 3.3.13
Ebuild name:

dev-lang/ruby-3.3.13

Description

An object-oriented scripting language

Added to portage

2026-10-24

ruby - 3.4.12
Ebuild name:

dev-lang/ruby-3.4.12

Description

An object-oriented scripting language

Added to portage

2026-10-24

ruby - 4.0.9
Ebuild name:

dev-lang/ruby-4.0.9

Description

An object-oriented scripting language

Added to portage

2026-10-24

signal-desktop-bin - 8.31.0
Ebuild name:

net-im/signal-desktop-bin-8.31.0

Description

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

Added to portage

2026-10-24

spotify - 1.3.4
Ebuild name:

media-sound/spotify-1.3.4

Description

Spotify is a social music platform

Added to portage

2026-10-24

streamlink - 8.6.2
Ebuild name:

net-misc/streamlink-8.6.2

Description

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

Added to portage

2026-10-24

subliminal - 2.8.0
Ebuild name:

media-video/subliminal-2.8.0

Description

Python library to search and download subtitles

Added to portage

2026-10-24

svglib - 2.3.2
Ebuild name:

dev-python/svglib-2.3.2

Description

Pure-Python library for reading and converting SVG

Added to portage

2026-10-24

syslog-ng - 4.12.0
Ebuild name:

app-admin/syslog-ng-4.12.0

Description

syslog replacement with advanced filtering features

Added to portage

2026-10-24

tdlib - 1.8.68
Ebuild name:

net-libs/tdlib-1.8.68

Description

Cross-platform library for building Telegram clients

Added to portage

2026-10-24

telega - 0.8.680_p20260909
Ebuild name:

app-emacs/telega-0.8.680_p20260909

Description

Full-featured unofficial GNU Emacs client for Telegram

Added to portage

2026-10-24

telegram-desktop - 7.3.1
Ebuild name:

net-im/telegram-desktop-7.3.1

Description

Official desktop client for Telegram

Added to portage

2026-10-24

telegram-desktop-bin - 7.3.3
Ebuild name:

net-im/telegram-desktop-bin-7.3.3

Description

Official desktop client for Telegram (binary package)

Added to portage

2026-10-24

tg_owt - 0_pre20261013
Ebuild name:

media-libs/tg_owt-0_pre20261013

Description

WebRTC build for Telegram

Added to portage

2026-10-24

tlottie - 1.0.6
Ebuild name:

gui-libs/tlottie-1.0.6

Description

Rust library for drawing Lottie animations

Added to portage

2026-10-24

translate-toolkit - 3.20.1
Ebuild name:

dev-python/translate-toolkit-3.20.1

Description

Toolkit to convert between many translation formats

Added to portage

2026-10-24

transmission - 4.1.4
Ebuild name:

net-p2p/transmission-4.1.4

Description

A fast, easy, and free BitTorrent client

Added to portage

2026-10-24

trimesh - 5.2.0
Ebuild name:

dev-python/trimesh-5.2.0

Description

Python library for loading and using triangular meshes

Added to portage

2026-10-24

wallet-engine-telegram - 0.0.7_p20261002
Ebuild name:

net-libs/wallet-engine-telegram-0.0.7_p20261002

Description

Cross-platform wallet engine for TON written in Rus

Added to portage

2026-10-24

wtforms - 3.3.0
Ebuild name:

dev-python/wtforms-3.3.0

Description

Flexible forms validation and rendering library for python web development

Added to portage

2026-10-24

xfsprogs - 7.2.1
Ebuild name:

sys-fs/xfsprogs-7.2.1

Description

XFS filesystem utilities

Added to portage

2026-10-24

xvfbwrapper - 0.2.37
Ebuild name:

dev-python/xvfbwrapper-0.2.37

Description

Python wrapper for running a display inside X virtual framebuffer

Added to portage

2026-10-24

zerofree - 1.1.1-r2
Ebuild name:

sys-fs/zerofree-1.1.1-r2

Description

Zeroes out all free space on a filesystem

Added to portage

2026-10-24

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