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:

83806

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-03-18
Dist-Zilla-Plugin-Test-Compile - 2.59.0
Ebuild name:

dev-perl/Dist-Zilla-Plugin-Test-Compile-2.59.0

Description

Common tests to check syntax of your modules, using

Added to portage

2026-03-18

Dist-Zilla-Plugin-Test-MinimumVersion - 2.0.11
Ebuild name:

dev-perl/Dist-Zilla-Plugin-Test-MinimumVersion-2.0.11

Description

Release tests for minimum required versions

Added to portage

2026-03-18

Dist-Zilla-Plugin-Test-Perl-Critic - 3.5.0
Ebuild name:

dev-perl/Dist-Zilla-Plugin-Test-Perl-Critic-3.5.0

Description

Tests to check your code against best practices

Added to portage

2026-03-18

EV - 4.370.0
Ebuild name:

dev-perl/EV-4.370.0

Description

Perl interface to libev, a high performance full-featured event loop

Added to portage

2026-03-18

Exporter-Tiny - 1.6.3
Ebuild name:

dev-perl/Exporter-Tiny-1.6.3

Description

An exporter with the features of Sub but only core dependencies

Added to portage

2026-03-18

File-DesktopEntry - 0.230.0
Ebuild name:

dev-perl/File-DesktopEntry-0.230.0

Description

Object to handle .desktop files

Added to portage

2026-03-18

File-MimeInfo - 0.360.0
Ebuild name:

dev-perl/File-MimeInfo-0.360.0

Description

Determine file type

Added to portage

2026-03-18

File-Scan-ClamAV - 1.960.0
Ebuild name:

dev-perl/File-Scan-ClamAV-1.960.0

Description

Connect to a local Clam Anti-Virus clamd service and send command

Added to portage

2026-03-18

Graphics-Toolkit-Color - 1.972.0
Ebuild name:

dev-perl/Graphics-Toolkit-Color-1.972.0

Description

Color palette constructor

Added to portage

2026-03-18

HTML-HTMLDoc - 0.250.0
Ebuild name:

dev-perl/HTML-HTMLDoc-0.250.0

Description

Perl interface to the htmldoc program for producing PDF-Files from HT

Added to portage

2026-03-18

aurorae - 6.6.3
Ebuild name:

kde-plasma/aurorae-6.6.3

Description

Themeable window decoration for KWin

Added to portage

2026-03-18

bluedevil - 6.6.3
Ebuild name:

kde-plasma/bluedevil-6.6.3

Description

Bluetooth stack for KDE Plasma

Added to portage

2026-03-18

breeze - 6.6.3
Ebuild name:

kde-plasma/breeze-6.6.3

Description

Breeze visual style for the Plasma desktop

Added to portage

2026-03-18

breeze-grub - 6.6.3
Ebuild name:

kde-plasma/breeze-grub-6.6.3

Description

Breeze theme for GRUB

Added to portage

2026-03-18

breeze-gtk - 6.6.3
Ebuild name:

kde-plasma/breeze-gtk-6.6.3

Description

Official GTK+ port of Plasma's Breeze widget style

Added to portage

2026-03-18

breeze-plymouth - 6.6.3
Ebuild name:

kde-plasma/breeze-plymouth-6.6.3

Description

Breeze theme for Plymouth

Added to portage

2026-03-18

discover - 6.6.3
Ebuild name:

kde-plasma/discover-6.6.3

Description

KDE Plasma resources management GUI

Added to portage

2026-03-18

drkonqi - 6.6.3
Ebuild name:

kde-plasma/drkonqi-6.6.3

Description

Plasma crash handler, gives the user feedback if a program crashed

Added to portage

2026-03-18

expat - 2.7.5
Ebuild name:

dev-libs/expat-2.7.5

Description

Stream-oriented XML parser library

Added to portage

2026-03-18

flatpak-kcm - 6.6.3
Ebuild name:

kde-plasma/flatpak-kcm-6.6.3

Description

Flatpak Permissions Management KCM

Added to portage

2026-03-18

kactivitymanagerd - 6.6.3
Ebuild name:

kde-plasma/kactivitymanagerd-6.6.3

Description

System service to manage user's activities, track the usage patt

Added to portage

2026-03-18

kde-cli-tools - 6.6.3
Ebuild name:

kde-plasma/kde-cli-tools-6.6.3

Description

Tools based on KDE Frameworks 6 to better interact with the system

Added to portage

2026-03-18

kde-cli-tools-common - 6.6.3
Ebuild name:

kde-plasma/kde-cli-tools-common-6.6.3

Description

Added to portage

2026-03-18

kde-gtk-config - 6.6.3
Ebuild name:

kde-plasma/kde-gtk-config-6.6.3

Description

Syncs KDE Plasma theme settings to GTK applications

Added to portage

2026-03-18

kdecoration - 6.6.3
Ebuild name:

kde-plasma/kdecoration-6.6.3

Description

Plugin based library to create window decorations

Added to portage

2026-03-18

kdeplasma-addons - 6.6.3
Ebuild name:

kde-plasma/kdeplasma-addons-6.6.3

Description

Extra Plasma applets and engines

Added to portage

2026-03-18

kdesu-gui - 6.6.3
Ebuild name:

kde-plasma/kdesu-gui-6.6.3

Description

Graphical frontend for KDE Frameworks' kdesu

Added to portage

2026-03-18

keditfiletype - 6.6.3
Ebuild name:

kde-plasma/keditfiletype-6.6.3

Description

File Type Editor

Added to portage

2026-03-18

kgamma - 6.6.3
Ebuild name:

kde-plasma/kgamma-6.6.3

Description

Screen gamma values kcontrol module

Added to portage

2026-03-18

kglobalacceld - 6.6.3
Ebuild name:

kde-plasma/kglobalacceld-6.6.3

Description

Daemon providing Global Keyboard Shortcut (Accelerator) functionalit

Added to portage

2026-03-18

kinfocenter - 6.6.3
Ebuild name:

kde-plasma/kinfocenter-6.6.3

Description

Utility providing information about the computer hardware

Added to portage

2026-03-18

kmenuedit - 6.6.3
Ebuild name:

kde-plasma/kmenuedit-6.6.3

Description

KDE Plasma menu editor

Added to portage

2026-03-18

knighttime - 6.6.3
Ebuild name:

kde-plasma/knighttime-6.6.3

Description

Helpers for scheduling the dark-light cycle

Added to portage

2026-03-18

kpipewire - 6.6.3
Ebuild name:

kde-plasma/kpipewire-6.6.3

Description

Components relating to Flatpak pipewire use in Plasma

Added to portage

2026-03-18

krdp - 6.6.3
Ebuild name:

kde-plasma/krdp-6.6.3

Description

Library and examples for creating an RDP server

Added to portage

2026-03-18

kscreen - 6.6.3
Ebuild name:

kde-plasma/kscreen-6.6.3

Description

KDE Plasma screen management

Added to portage

2026-03-18

kscreenlocker - 6.6.3
Ebuild name:

kde-plasma/kscreenlocker-6.6.3

Description

Library and components for secure lock screen architecture

Added to portage

2026-03-18

ksshaskpass - 6.6.3
Ebuild name:

kde-plasma/ksshaskpass-6.6.3

Description

Implementation of ssh-askpass with KDE Wallet integration

Added to portage

2026-03-18

ksystemstats - 6.6.3
Ebuild name:

kde-plasma/ksystemstats-6.6.3

Description

Plugin-based system monitoring daemon

Added to portage

2026-03-18

kwallet-pam - 6.6.3
Ebuild name:

kde-plasma/kwallet-pam-6.6.3

Description

PAM module to not enter KWallet password again after login

Added to portage

2026-03-18

kwayland - 6.6.3
Ebuild name:

kde-plasma/kwayland-6.6.3

Description

Qt-style API to interact with the wayland-client API

Added to portage

2026-03-18

kwin - 6.6.3
Ebuild name:

kde-plasma/kwin-6.6.3

Description

Flexible, composited Window Manager for windowing systems on Linux

Added to portage

2026-03-18

kwin-x11 - 6.6.3
Ebuild name:

kde-plasma/kwin-x11-6.6.3

Description

Flexible, composited X window manager

Added to portage

2026-03-18

kwrited - 6.6.3
Ebuild name:

kde-plasma/kwrited-6.6.3

Description

KDE Plasma daemon listening for wall and write messages

Added to portage

2026-03-18

layer-shell-qt - 6.6.3
Ebuild name:

kde-plasma/layer-shell-qt-6.6.3

Description

Qt component to allow applications make use of Wayland wl-layer-she

Added to portage

2026-03-18

libpciaccess - 0.19
Ebuild name:

x11-libs/libpciaccess-0.19

Description

Library providing generic access to the PCI bus and devices

Added to portage

2026-03-18

marknote - 1.5.0-r1
Ebuild name:

app-text/marknote-1.5.0-r1

Description

Markdown editor with a wide range of formating options for everyday note

Added to portage

2026-03-18

plasma-pass - 1.3.1
Ebuild name:

kde-misc/plasma-pass-1.3.1

Description

Plasma applet to access password from pass

Added to portage

2026-03-18

systemd-initctl - 3
Ebuild name:

sys-apps/systemd-initctl-3

Description

initctl Compatibility Daemon

Added to portage

2026-03-18

yt-dlp-ejs - 0.8.0
Ebuild name:

dev-python/yt-dlp-ejs-0.8.0

Description

External JavaScript for yt-dlp supporting many runtimes

Added to portage

2026-03-18

2026-03-17
Dist-Zilla-Plugin-ContributorsFile - 0.4.0
Ebuild name:

dev-perl/Dist-Zilla-Plugin-ContributorsFile-0.4.0

Description

Add a file listing all contributors

Added to portage

2026-03-17

Dist-Zilla-Plugin-Git - 2.52.0
Ebuild name:

dev-perl/Dist-Zilla-Plugin-Git-2.52.0

Description

Update your git repository after release

Added to portage

2026-03-17

Dist-Zilla-Plugin-ModuleBuildTiny - 0.20.0
Ebuild name:

dev-perl/Dist-Zilla-Plugin-ModuleBuildTiny-0.20.0

Description

Build a Build.PL that uses Module

Added to portage

2026-03-17

Dist-Zilla-Plugin-PodWeaver - 4.10.0
Ebuild name:

dev-perl/Dist-Zilla-Plugin-PodWeaver-4.10.0

Description

Weave your Pod together from configuration and Dist

Added to portage

2026-03-17

Dist-Zilla-Plugin-ReadmeFromPod - 0.400.0
Ebuild name:

dev-perl/Dist-Zilla-Plugin-ReadmeFromPod-0.400.0

Description

dzil plugin to generate README from POD

Added to portage

2026-03-17

ansible-pylibssh - 1.4.0
Ebuild name:

dev-python/ansible-pylibssh-1.4.0

Description

Python bindings for libssh client specific to Ansible use case

Added to portage

2026-03-17

awscli - 1.44.59
Ebuild name:

app-admin/awscli-1.44.59

Description

Universal Command Line Environment for AWS

Added to portage

2026-03-17

boto3 - 1.42.69
Ebuild name:

dev-python/boto3-1.42.69

Description

The AWS SDK for Python

Added to portage

2026-03-17

botocore - 1.42.69
Ebuild name:

dev-python/botocore-1.42.69

Description

Low-level, data-driven core of boto 3

Added to portage

2026-03-17

claude-code - 2.1.77
Ebuild name:

dev-util/claude-code-2.1.77

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2026-03-17

clzip - 1.16
Ebuild name:

app-arch/clzip-1.16

Description

C language version of lzip

Added to portage

2026-03-17

difftastic - 0.68.0
Ebuild name:

dev-util/difftastic-0.68.0

Description

A structural diff that understands syntax.

Added to portage

2026-03-17

dovecot - 2.4.2-r3
Ebuild name:

net-mail/dovecot-2.4.2-r3

Description

An IMAP and POP3 server written with security primarily in mind

Added to portage

2026-03-17

elfutils - 0.193-r2
Ebuild name:

dev-libs/elfutils-0.193-r2

Description

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

Added to portage

2026-03-17

elfutils - 0.194-r1
Ebuild name:

dev-libs/elfutils-0.194-r1

Description

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

Added to portage

2026-03-17

evisum - 1.0.0
Ebuild name:

sys-process/evisum-1.0.0

Description

System and process monitor written with EFL

Added to portage

2026-03-17

ffmpeg - 8.1
Ebuild name:

media-video/ffmpeg-8.1

Description

Complete solution to record/convert/stream audio and video

Added to portage

2026-03-17

hiredis - 3.3.1
Ebuild name:

dev-python/hiredis-3.3.1

Description

Python extension that wraps hiredis

Added to portage

2026-03-17

libbpf - 1.7.0
Ebuild name:

dev-libs/libbpf-1.7.0

Description

Stand-alone build of libbpf from the Linux kernel

Added to portage

2026-03-17

navi2ch - 1.8.4-r2
Ebuild name:

app-emacs/navi2ch-1.8.4-r2

Description

A navigator for the Japanese textboard 2ch

Added to portage

2026-03-17

nerd-icons - 0.1.0
Ebuild name:

app-emacs/nerd-icons-0.1.0

Description

Emacs Nerd Font Icons Library

Added to portage

2026-03-17

obs-studio - 32.1.0
Ebuild name:

media-video/obs-studio-32.1.0

Description

Software for Recording and Streaming Live Video Content

Added to portage

2026-03-17

openfortivpn - 1.24.1
Ebuild name:

net-vpn/openfortivpn-1.24.1

Description

Fortinet compatible VPN client

Added to portage

2026-03-17

pipx - 1.9.0
Ebuild name:

dev-python/pipx-1.9.0

Description

Install and Run Python Applications in Isolated Environments

Added to portage

2026-03-17

plasma-pass - 1.3.0-r1
Ebuild name:

kde-misc/plasma-pass-1.3.0-r1

Description

Plasma applet to access password from pass

Added to portage

2026-03-17

postfix - 3.12_pre20260316
Ebuild name:

mail-mta/postfix-3.12_pre20260316

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2026-03-17

prek - 0.3.6
Ebuild name:

dev-util/prek-0.3.6

Description

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

Added to portage

2026-03-17

pyasn1 - 0.6.3
Ebuild name:

dev-python/pyasn1-0.6.3

Description

ASN.1 library for Python

Added to portage

2026-03-17

pyproject-fmt - 2.19.0
Ebuild name:

dev-python/pyproject-fmt-2.19.0

Description

Format your pyproject.toml file

Added to portage

2026-03-17

signal-desktop-bin - 8.2.1
Ebuild name:

net-im/signal-desktop-bin-8.2.1

Description

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

Added to portage

2026-03-17

simdjson - 4.4.1
Ebuild name:

dev-libs/simdjson-4.4.1

Description

SIMD accelerated C++ JSON library

Added to portage

2026-03-17

simpleeval - 1.0.7
Ebuild name:

dev-python/simpleeval-1.0.7

Description

A simple, safe single expression evaluator library

Added to portage

2026-03-17

solarus-quest-editor - 2.0.3-r1
Ebuild name:

games-misc/solarus-quest-editor-2.0.3-r1

Description

Quest editor for Solarus game engine

Added to portage

2026-03-17

telegram-desktop - 6.6.2
Ebuild name:

net-im/telegram-desktop-6.6.2

Description

Official desktop client for Telegram

Added to portage

2026-03-17

tg_owt - 0_pre20260309
Ebuild name:

media-libs/tg_owt-0_pre20260309

Description

WebRTC build for Telegram

Added to portage

2026-03-17

types-docutils - 0.22.3.20260316
Ebuild name:

dev-python/types-docutils-0.22.3.20260316

Description

Typing stubs for docutils

Added to portage

2026-03-17

util-linux - 2.41.3-r1
Ebuild name:

sys-apps/util-linux-2.41.3-r1

Description

Various useful Linux utilities

Added to portage

2026-03-17

uv - 0.10.11
Ebuild name:

dev-python/uv-0.10.11

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-03-17

uv-build - 0.10.11
Ebuild name:

dev-python/uv-build-0.10.11

Description

PEP517 uv build backend

Added to portage

2026-03-17

uvicorn - 0.42.0
Ebuild name:

dev-python/uvicorn-0.42.0

Description

Lightning-fast ASGI server implementation

Added to portage

2026-03-17

xfconf - 4.21.2
Ebuild name:

xfce-base/xfconf-4.21.2

Description

A configuration management system for Xfce

Added to portage

2026-03-17

xmms2 - 0.9.7
Ebuild name:

media-sound/xmms2-0.9.7

Description

X(cross)platform Music Multiplexing System, next generation of the XMMS pla

Added to portage

2026-03-17

zen-sources - 6.19.8
Ebuild name:

sys-kernel/zen-sources-6.19.8

Description

The Zen Kernel Live Sources

Added to portage

2026-03-17

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