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:

87319

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-01
claude-code - 2.1.220
Ebuild name:

dev-util/claude-code-2.1.220

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2026-08-01

cutlass - 4.4.2
Ebuild name:

dev-libs/cutlass-4.4.2

Description

CUDA Templates for Linear Algebra Subroutines

Added to portage

2026-08-01

meson-mode - 9999
Ebuild name:

app-emacs/meson-mode-9999

Description

A GNU Emacs major mode for Meson build-system files

Added to portage

2026-08-01

nginx - 1.29.5-r2
Ebuild name:

www-servers/nginx-1.29.5-r2

Description

Added to portage

2026-08-01

nginx - 1.29.7-r3
Ebuild name:

www-servers/nginx-1.29.7-r3

Description

Added to portage

2026-08-01

nginx - 1.30.0-r2
Ebuild name:

www-servers/nginx-1.30.0-r2

Description

Added to portage

2026-08-01

nginx - 1.30.2-r2
Ebuild name:

www-servers/nginx-1.30.2-r2

Description

Added to portage

2026-08-01

nginx - 1.30.3-r2
Ebuild name:

www-servers/nginx-1.30.3-r2

Description

Added to portage

2026-08-01

nginx - 1.30.4-r1
Ebuild name:

www-servers/nginx-1.30.4-r1

Description

Added to portage

2026-08-01

nginx - 1.31.1-r2
Ebuild name:

www-servers/nginx-1.31.1-r2

Description

Added to portage

2026-08-01

nginx - 1.31.2-r2
Ebuild name:

www-servers/nginx-1.31.2-r2

Description

Added to portage

2026-08-01

nginx - 1.31.3-r1
Ebuild name:

www-servers/nginx-1.31.3-r1

Description

Added to portage

2026-08-01

ngx-acme - 0.3.1-r1
Ebuild name:

www-nginx/ngx-acme-0.3.1-r1

Description

An NGINX module with the implementation of the ACMEv2 protocol

Added to portage

2026-08-01

pebble - 5.2.1-r1
Ebuild name:

dev-python/pebble-5.2.1-r1

Description

Threading and multiprocessing eye-candy

Added to portage

2026-08-01

php - 8.3.33
Ebuild name:

dev-lang/php-8.3.33

Description

The PHP language runtime engine

Added to portage

2026-08-01

php - 8.4.24
Ebuild name:

dev-lang/php-8.4.24

Description

The PHP language runtime engine

Added to portage

2026-08-01

pkgcheck - 0.10.42
Ebuild name:

dev-util/pkgcheck-0.10.42

Description

pkgcore-based QA utility for ebuild repos

Added to portage

2026-08-01

pkgcore - 0.12.37
Ebuild name:

sys-apps/pkgcore-0.12.37

Description

a framework for package management

Added to portage

2026-08-01

pkgdev - 0.2.16
Ebuild name:

dev-util/pkgdev-0.2.16

Description

Collection of tools for Gentoo development

Added to portage

2026-08-01

snakeoil - 0.11.3
Ebuild name:

dev-python/snakeoil-0.11.3

Description

misc common functionality and useful optimizations

Added to portage

2026-08-01

yq - 3.4.3-r1
Ebuild name:

app-misc/yq-3.4.3-r1

Description

Command-line YAML processor - jq wrapper for YAML documents

Added to portage

2026-08-01

yq - 4.1.2-r1
Ebuild name:

app-misc/yq-4.1.2-r1

Description

Command-line YAML processor - jq wrapper for YAML documents

Added to portage

2026-08-01

2026-07-31
acl - 2.4.0-r2
Ebuild name:

sys-apps/acl-2.4.0-r2

Description

Access control list utilities, libraries, and headers

Added to portage

2026-07-31

aiksaurus - 1.2.1-r4
Ebuild name:

app-text/aiksaurus-1.2.1-r4

Description

A thesaurus lib, tool, and database

Added to portage

2026-07-31

android-studio - 2026.1.3.7
Ebuild name:

dev-util/android-studio-2026.1.3.7

Description

Android development environment based on IntelliJ IDEA

Added to portage

2026-07-31

ansiweather - 1.19.1
Ebuild name:

app-misc/ansiweather-1.19.1

Description

Weather in terminal, with ANSI colors and Unicode symbols

Added to portage

2026-07-31

awscli - 1.45.61
Ebuild name:

app-admin/awscli-1.45.61

Description

Universal Command Line Environment for AWS

Added to portage

2026-07-31

bitarray - 3.10.0
Ebuild name:

dev-python/bitarray-3.10.0

Description

Efficient arrays of booleans -- C extension

Added to portage

2026-07-31

blueprint-compiler - 0.22.2
Ebuild name:

dev-util/blueprint-compiler-0.22.2

Description

Compiler for Blueprint, a markup language for GTK user interface

Added to portage

2026-07-31

boto3 - 1.43.61
Ebuild name:

dev-python/boto3-1.43.61

Description

The AWS SDK for Python

Added to portage

2026-07-31

botocore - 1.43.61
Ebuild name:

dev-python/botocore-1.43.61

Description

Low-level, data-driven core of boto 3

Added to portage

2026-07-31

buildah - 1.45.0
Ebuild name:

app-containers/buildah-1.45.0

Description

A tool that facilitates building OCI images

Added to portage

2026-07-31

cachelib - 0.15.0
Ebuild name:

dev-python/cachelib-0.15.0

Description

Collection of cache libraries in the same API interface. Extracted from

Added to portage

2026-07-31

closure-compiler-bin - 20260726
Ebuild name:

dev-lang/closure-compiler-bin-20260726

Description

JavaScript optimizing compiler

Added to portage

2026-07-31

container-libs - 0.69.0
Ebuild name:

app-containers/container-libs-0.69.0

Description

Several utilities from the containers project

Added to portage

2026-07-31

corsix-th - 0.70.0-r2
Ebuild name:

games-simulation/corsix-th-0.70.0-r2

Description

Open source clone of Theme Hospital

Added to portage

2026-07-31

crystal - 1.21.0
Ebuild name:

dev-lang/crystal-1.21.0

Description

The Crystal Programming Language

Added to portage

2026-07-31

curtail - 1.16.2-r1
Ebuild name:

media-gfx/curtail-1.16.2-r1

Description

Image compressor, supporting PNG, JPEG and WebP

Added to portage

2026-07-31

dotnet-outdated - 4.8.1
Ebuild name:

dev-dotnet/dotnet-outdated-4.8.1

Description

Display and update outdated NuGet packages in a project

Added to portage

2026-07-31

feedparser - 6.0.14
Ebuild name:

dev-python/feedparser-6.0.14

Description

Parse RSS and Atom feeds in Python

Added to portage

2026-07-31

feedparser-sgmllib - 2.0.1
Ebuild name:

dev-python/feedparser-sgmllib-2.0.1

Description

sgmllib from Python 2.7 for feedparser use

Added to portage

2026-07-31

fluidsynth - 2.5.7
Ebuild name:

media-sound/fluidsynth-2.5.7

Description

Software real-time synthesizer based on the Soundfont 2 specifications

Added to portage

2026-07-31

gpgme - 2.0.26
Ebuild name:

dev-ruby/gpgme-2.0.26

Description

Ruby language binding for GnuPG Made Easy

Added to portage

2026-07-31

guessit - 4.3.0
Ebuild name:

dev-python/guessit-4.3.0

Description

Python library for guessing information from video filenames

Added to portage

2026-07-31

hypothesis - 6.164.0
Ebuild name:

dev-python/hypothesis-6.164.0

Description

A library for property based testing

Added to portage

2026-07-31

ipython - 9.16.0
Ebuild name:

dev-python/ipython-9.16.0

Description

Advanced interactive shell for Python

Added to portage

2026-07-31

joplin-desktop - 3.7.9
Ebuild name:

app-office/joplin-desktop-3.7.9

Description

Secure note taking and to-do app with synchronization capabilities

Added to portage

2026-07-31

jupyter-builder - 1.2.0
Ebuild name:

dev-python/jupyter-builder-1.2.0

Description

JupyterLab build tools

Added to portage

2026-07-31

kineto - 0.4.0_p20260603
Ebuild name:

sci-ml/kineto-0.4.0_p20260603

Description

part of the PyTorch Profiler

Added to portage

2026-07-31

kotlin-bin - 2.4.10
Ebuild name:

dev-lang/kotlin-bin-2.4.10

Description

Statically typed language that targets the JVM and JavaScript

Added to portage

2026-07-31

lesscpy - 0.15.2
Ebuild name:

dev-python/lesscpy-0.15.2

Description

A compiler written in Python for the LESS language

Added to portage

2026-07-31

libffado - 2.5.0_p5
Ebuild name:

media-libs/libffado-2.5.0_p5

Description

Driver for IEEE1394 (Firewire) audio interfaces

Added to portage

2026-07-31

limine - 12.5.2
Ebuild name:

sys-boot/limine-12.5.2

Description

Modern, secure, portable, multiprotocol bootloader and boot manager

Added to portage

2026-07-31

llhttp - 9.4.3
Ebuild name:

net-libs/llhttp-9.4.3

Description

Port of http_parser to llparse

Added to portage

2026-07-31

logwatch - 7.15
Ebuild name:

sys-apps/logwatch-7.15

Description

Analyzes and Reports on system logs

Added to portage

2026-07-31

lorcon - 2020.06.06_p20220216-r4
Ebuild name:

net-wireless/lorcon-2020.06.06_p20220216-r4

Description

A generic library for injecting 802.11 frames

Added to portage

2026-07-31

lsprotocol - 2025.0.0-r1
Ebuild name:

dev-python/lsprotocol-2025.0.0-r1

Description

Language Server Protocol types code generator packages

Added to portage

2026-07-31

mame - 0.289
Ebuild name:

games-emulation/mame-0.289

Description

Multiple Arcade Machine Emulator

Added to portage

2026-07-31

markdown - 3.10.3
Ebuild name:

dev-python/markdown-3.10.3

Description

Python implementation of the markdown markup language

Added to portage

2026-07-31

md6sum - 1.0-r3
Ebuild name:

app-crypt/md6sum-1.0-r3

Description

A C implementation of MD6

Added to portage

2026-07-31

metamath-mode - 0_p20221005
Ebuild name:

app-emacs/metamath-mode-0_p20221005

Description

Major GNU Emacs mode for metamath files

Added to portage

2026-07-31

mew - 6.8_p20230203
Ebuild name:

app-emacs/mew-6.8_p20230203

Description

Great MIME mail reader for Emacs/XEmacs

Added to portage

2026-07-31

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-07-31

mic-paren - 3.15-r1
Ebuild name:

app-emacs/mic-paren-3.15-r1

Description

Advanced highlighting of matching parentheses

Added to portage

2026-07-31

minisign - 0.12
Ebuild name:

app-crypt/minisign-0.12

Description

Dead simple tool to sign files and verify signatures

Added to portage

2026-07-31

mit-krb5 - 1.22.2-r2
Ebuild name:

app-crypt/mit-krb5-1.22.2-r2

Description

MIT Kerberos V

Added to portage

2026-07-31

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-07-31

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-07-31

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-07-31

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-07-31

moolticute - 1.03.0-r2
Ebuild name:

app-crypt/moolticute-1.03.0-r2

Description

Mooltipass crossplatform daemon/tools

Added to portage

2026-07-31

moolticute - 9999
Ebuild name:

app-crypt/moolticute-9999

Description

Mooltipass crossplatform daemon/tools

Added to portage

2026-07-31

naps2 - 8.3.2
Ebuild name:

app-office/naps2-8.3.2

Description

Document scanning application with a focus on simplicity and ease of use

Added to portage

2026-07-31

nasty - 0.6-r2
Ebuild name:

app-crypt/nasty-0.6-r2

Description

Proof-of-concept GPG passphrase recovery tool

Added to portage

2026-07-31

nitrocli - 0.4.1-r2
Ebuild name:

app-crypt/nitrocli-0.4.1-r2

Description

A command line tool for interacting with Nitrokey devices

Added to portage

2026-07-31

nvc - 1.22.0
Ebuild name:

sci-electronics/nvc-1.22.0

Description

NVC is a VHDL compiler and simulator

Added to portage

2026-07-31

nwipe - 0.41
Ebuild name:

app-crypt/nwipe-0.41

Description

Securely erase disks using a variety of recognized methods

Added to portage

2026-07-31

ollama - 0.32.5
Ebuild name:

sci-ml/ollama-0.32.5

Description

Get up and running with Llama 3, Mistral, Gemma, and other language models

Added to portage

2026-07-31

onak - 0.6.3
Ebuild name:

app-crypt/onak-0.6.3

Description

onak is an OpenPGP keyserver

Added to portage

2026-07-31

org-mode - 9.8.8
Ebuild name:

app-emacs/org-mode-9.8.8

Description

An Emacs mode for notes and project planning

Added to portage

2026-07-31

pam_xdg - 0.8.5
Ebuild name:

sys-auth/pam_xdg-0.8.5

Description

PAM module that manages XDG Base Directories

Added to portage

2026-07-31

pambase - 20260730
Ebuild name:

sys-auth/pambase-20260730

Description

PAM base configuration files

Added to portage

2026-07-31

parver - 1.0.1_p0
Ebuild name:

dev-python/parver-1.0.1_p0

Description

Parse and manipulate version numbers

Added to portage

2026-07-31

passt - 2026.07.28
Ebuild name:

net-misc/passt-2026.07.28

Description

User-mode networking daemons for VMs and namespaces, replacement for Slir

Added to portage

2026-07-31

pikepdf - 10.11.0
Ebuild name:

dev-python/pikepdf-10.11.0

Description

Python library to work with pdf files based on qpdf

Added to portage

2026-07-31

psutils - 3.3.15
Ebuild name:

app-text/psutils-3.3.15

Description

Utilities for manipulating PostScript documents

Added to portage

2026-07-31

redis - 8.1.0
Ebuild name:

dev-python/redis-8.1.0

Description

Python client for Redis key-value store

Added to portage

2026-07-31

rrdtool-bindings - 1.10.3
Ebuild name:

dev-ruby/rrdtool-bindings-1.10.3

Description

Ruby bindings for rrdtool

Added to portage

2026-07-31

sbcl - 2.6.7
Ebuild name:

dev-lisp/sbcl-2.6.7

Description

Steel Bank Common Lisp (SBCL) is an implementation of ANSI Common Lisp

Added to portage

2026-07-31

shtab - 1.8.2
Ebuild name:

dev-python/shtab-1.8.2

Description

Automagic shell tab completion for Python CLI applications

Added to portage

2026-07-31

skopeo - 1.24.0
Ebuild name:

app-containers/skopeo-1.24.0

Description

Work with remote container images registries

Added to portage

2026-07-31

sourcegit - 2026.17
Ebuild name:

dev-vcs/sourcegit-2026.17

Description

Open Source Git GUI client using .NET AvaloniaUI

Added to portage

2026-07-31

spectrum2 - 2.2.1_p20260727-r1
Ebuild name:

net-im/spectrum2-2.2.1_p20260727-r1

Description

An open source instant messaging transport

Added to portage

2026-07-31

spyder - 6.1.6
Ebuild name:

dev-python/spyder-6.1.6

Description

The Scientific Python Development Environment

Added to portage

2026-07-31

talk-desktop-bin - 2.2.3
Ebuild name:

net-im/talk-desktop-bin-2.2.3

Description

Nextcloud Talk Desktop client

Added to portage

2026-07-31

tea - 0.15.0
Ebuild name:

dev-util/tea-0.15.0

Description

Command line tool to interact with Gitea server

Added to portage

2026-07-31

texstudio - 4.9.6
Ebuild name:

app-office/texstudio-4.9.6

Description

Free cross-platform LaTeX editor (fork from texmakerX)

Added to portage

2026-07-31

time-machine - 3.2.0-r1
Ebuild name:

dev-python/time-machine-3.2.0-r1

Description

Travel through time in your tests

Added to portage

2026-07-31

toolz - 1.1.0-r1
Ebuild name:

dev-python/toolz-1.1.0-r1

Description

List processing tools and functional utilities

Added to portage

2026-07-31

translate-toolkit - 3.19.16
Ebuild name:

dev-python/translate-toolkit-3.19.16

Description

Toolkit to convert between many translation formats

Added to portage

2026-07-31

ubelt - 1.4.3
Ebuild name:

dev-python/ubelt-1.4.3

Description

A stdlib like feel, and extra batteries. Hashing, Caching, Timing, Progress

Added to portage

2026-07-31

virtualenv - 21.7.1
Ebuild name:

dev-python/virtualenv-21.7.1

Description

Virtual Python Environment builder

Added to portage

2026-07-31

xmlsec - 1.3.17-r1
Ebuild name:

dev-python/xmlsec-1.3.17-r1

Description

Python bindings for the XML Security Library

Added to portage

2026-07-31

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