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:

87263

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-07-29
annotated-doc - 0.0.5
Ebuild name:

dev-python/annotated-doc-0.0.5

Description

Document parameters, variables inline, with Annotated

Added to portage

2026-07-29

awkward - 2.12.0
Ebuild name:

dev-python/awkward-2.12.0

Description

Manipulate JSON-like data with NumPy-like idioms

Added to portage

2026-07-29

awkward-cpp - 55
Ebuild name:

dev-python/awkward-cpp-55

Description

CPU kernels and compiled extensions for Awkward Array

Added to portage

2026-07-29

awscli - 1.45.58
Ebuild name:

app-admin/awscli-1.45.58

Description

Universal Command Line Environment for AWS

Added to portage

2026-07-29

borgbackup - 1.4.5
Ebuild name:

app-backup/borgbackup-1.4.5

Description

Deduplicating backup program with compression and authenticated encrypt

Added to portage

2026-07-29

boto3 - 1.43.58
Ebuild name:

dev-python/boto3-1.43.58

Description

The AWS SDK for Python

Added to portage

2026-07-29

botocore - 1.43.58
Ebuild name:

dev-python/botocore-1.43.58

Description

Low-level, data-driven core of boto 3

Added to portage

2026-07-29

cfn-lint - 1.53.3
Ebuild name:

dev-python/cfn-lint-1.53.3

Description

CloudFormation Linter

Added to portage

2026-07-29

clang - 23.1.0_rc2
Ebuild name:

dev-python/clang-23.1.0_rc2

Description

Python bindings for llvm-core/clang

Added to portage

2026-07-29

clang - 23.1.0_rc2
Ebuild name:

llvm-core/clang-23.1.0_rc2

Description

C language family frontend for LLVM

Added to portage

2026-07-29

clang-common - 23.1.0_rc2
Ebuild name:

llvm-core/clang-common-23.1.0_rc2

Description

Common files shared between multiple slots of clang

Added to portage

2026-07-29

compiler-rt - 23.1.0_rc2
Ebuild name:

llvm-runtimes/compiler-rt-23.1.0_rc2

Description

Compiler runtime library for clang (built-in part)

Added to portage

2026-07-29

compiler-rt-sanitizers - 23.1.0_rc2
Ebuild name:

llvm-runtimes/compiler-rt-sanitizers-23.1.0_rc2

Description

Compiler runtime libraries for clang (sanitizers &a

Added to portage

2026-07-29

fastapi - 0.140.13
Ebuild name:

dev-python/fastapi-0.140.13

Description

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

Added to portage

2026-07-29

flang - 23.1.0_rc2
Ebuild name:

llvm-core/flang-23.1.0_rc2

Description

LLVM's Fortran frontend

Added to portage

2026-07-29

flang-rt - 23.1.0_rc2
Ebuild name:

llvm-runtimes/flang-rt-23.1.0_rc2

Description

LLVM's Fortran runtime

Added to portage

2026-07-29

flatpak-builder - 1.4.10-r1
Ebuild name:

dev-util/flatpak-builder-1.4.10-r1

Description

Tool to build flatpaks from source

Added to portage

2026-07-29

fsspec - 2026.7.0
Ebuild name:

dev-python/fsspec-2026.7.0

Description

A specification that python filesystems should adhere to

Added to portage

2026-07-29

hypothesis - 6.163.0
Ebuild name:

dev-python/hypothesis-6.163.0

Description

A library for property based testing

Added to portage

2026-07-29

jansson - 2.15.1
Ebuild name:

dev-libs/jansson-2.15.1

Description

C library for encoding, decoding and manipulating JSON data

Added to portage

2026-07-29

kirigami-app-components - 1.0.2
Ebuild name:

dev-libs/kirigami-app-components-1.0.2

Description

Kirigami addons and modules necessary to do a full featured

Added to portage

2026-07-29

knot-resolver - 5.7.7-r1
Ebuild name:

net-dns/knot-resolver-5.7.7-r1

Description

A scaleable caching DNS resolver

Added to portage

2026-07-29

knot-resolver - 6.4.1-r1
Ebuild name:

net-dns/knot-resolver-6.4.1-r1

Description

Scaleable caching DNS resolver

Added to portage

2026-07-29

libarchive - 3.8.9
Ebuild name:

app-arch/libarchive-3.8.9

Description

Multi-format archive and compression library

Added to portage

2026-07-29

libclc - 23.1.0_rc2
Ebuild name:

llvm-runtimes/libclc-23.1.0_rc2

Description

OpenCL C library

Added to portage

2026-07-29

libcxx - 23.1.0_rc2
Ebuild name:

llvm-runtimes/libcxx-23.1.0_rc2

Description

New implementation of the C++ standard library, targeting C++11

Added to portage

2026-07-29

libcxxabi - 23.1.0_rc2
Ebuild name:

llvm-runtimes/libcxxabi-23.1.0_rc2

Description

Low level support for a standard C++ library

Added to portage

2026-07-29

libgcc - 23.1.0_rc2
Ebuild name:

llvm-runtimes/libgcc-23.1.0_rc2

Description

Compiler runtime library for clang, compatible with libgcc_s

Added to portage

2026-07-29

libunwind - 23.1.0_rc2
Ebuild name:

llvm-runtimes/libunwind-23.1.0_rc2

Description

C++ runtime stack unwinder from LLVM

Added to portage

2026-07-29

lit - 23.1.0_rc2
Ebuild name:

dev-python/lit-23.1.0_rc2

Description

A stand-alone install of the LLVM suite testing tool

Added to portage

2026-07-29

lld - 23.1.0_rc2
Ebuild name:

llvm-core/lld-23.1.0_rc2

Description

The LLVM linker (link editor)

Added to portage

2026-07-29

lldb - 23.1.0_rc2
Ebuild name:

llvm-core/lldb-23.1.0_rc2

Description

The LLVM debugger

Added to portage

2026-07-29

llvm - 23.1.0_rc2
Ebuild name:

dev-ml/llvm-23.1.0_rc2

Description

OCaml bindings for LLVM

Added to portage

2026-07-29

llvm - 23.1.0_rc2
Ebuild name:

llvm-core/llvm-23.1.0_rc2

Description

Low Level Virtual Machine

Added to portage

2026-07-29

llvm-common - 23.1.0_rc2
Ebuild name:

llvm-core/llvm-common-23.1.0_rc2

Description

Common files shared between multiple slots of LLVM

Added to portage

2026-07-29

matlab - 9999
Ebuild name:

app-emacs/matlab-9999

Description

Major modes for MATLAB .m and .tlc files

Added to portage

2026-07-29

mediawiki - 2.3.1
Ebuild name:

app-emacs/mediawiki-2.3.1

Description

MediaWiki client for Emacs

Added to portage

2026-07-29

meson-mode - 0.4
Ebuild name:

app-emacs/meson-mode-0.4

Description

A GNU Emacs major mode for Meson build-system files

Added to portage

2026-07-29

mlir - 23.1.0_rc2
Ebuild name:

llvm-core/mlir-23.1.0_rc2

Description

Multi-Level Intermediate Representation (library only)

Added to portage

2026-07-29

openmp - 23.1.0_rc2
Ebuild name:

llvm-runtimes/openmp-23.1.0_rc2

Description

OpenMP runtime libraries for LLVM/clang compiler

Added to portage

2026-07-29

openmp-amdgcn-amd-amdhsa - 23.1.0_rc2
Ebuild name:

llvm-runtimes/openmp-amdgcn-amd-amdhsa-23.1.0_rc2

Description

OpenMP target library for amdgcn devices

Added to portage

2026-07-29

openmp-nvptx64-nvidia-cuda - 23.1.0_rc2
Ebuild name:

llvm-runtimes/openmp-nvptx64-nvidia-cuda-23.1.0_rc2

Description

OpenMP target library for nvptx64 devices

Added to portage

2026-07-29

openmp-spirv64-intel - 23.1.0_rc2
Ebuild name:

llvm-runtimes/openmp-spirv64-intel-23.1.0_rc2

Description

OpenMP target library for spirv64 Intel devices

Added to portage

2026-07-29

openpgp-keys-unrealircd - 20241118
Ebuild name:

sec-keys/openpgp-keys-unrealircd-20241118

Description

OpenPGP keys used to sign UnrealIRCd releases

Added to portage

2026-07-29

pbs-installer - 2026.7.28
Ebuild name:

dev-python/pbs-installer-2026.7.28

Description

Installer for Python Build Standalone

Added to portage

2026-07-29

polly - 23.1.0_rc2
Ebuild name:

llvm-core/polly-23.1.0_rc2

Description

Polyhedral optimizations for LLVM

Added to portage

2026-07-29

pypi-attestations - 0.0.30
Ebuild name:

dev-python/pypi-attestations-0.0.30

Description

Convert between Sigstore Bundles and PEP-740 Attestation object

Added to portage

2026-07-29

pyzotero - 1.13.3
Ebuild name:

dev-python/pyzotero-1.13.3

Description

A Python client for the Zotero API

Added to portage

2026-07-29

unrealircd - 6.2.6
Ebuild name:

net-irc/unrealircd-6.2.6

Description

An advanced Internet Relay Chat daemon

Added to portage

2026-07-29

yara - 4.5.8
Ebuild name:

app-forensics/yara-4.5.8

Description

A malware identification and classification tool

Added to portage

2026-07-29

2026-07-28
accountsservice - 23.13.9-r1
Ebuild name:

sys-apps/accountsservice-23.13.9-r1

Description

D-Bus interfaces for querying and manipulating user account inf

Added to portage

2026-07-28

accountsservice - 26.27.3
Ebuild name:

sys-apps/accountsservice-26.27.3

Description

D-Bus interfaces for querying and manipulating user account inform

Added to portage

2026-07-28

awscli - 1.45.57
Ebuild name:

app-admin/awscli-1.45.57

Description

Universal Command Line Environment for AWS

Added to portage

2026-07-28

boto3 - 1.43.57
Ebuild name:

dev-python/boto3-1.43.57

Description

The AWS SDK for Python

Added to portage

2026-07-28

botocore - 1.43.57
Ebuild name:

dev-python/botocore-1.43.57

Description

Low-level, data-driven core of boto 3

Added to portage

2026-07-28

brotli - 0.8.0-r1
Ebuild name:

dev-ruby/brotli-0.8.0-r1

Description

Brotli compressor/decompressor

Added to portage

2026-07-28

c-blosc2 - 3.3.0
Ebuild name:

dev-libs/c-blosc2-3.3.0

Description

Blocking, shuffling and lossless compression library

Added to portage

2026-07-28

cachebox - 6.2.1
Ebuild name:

dev-python/cachebox-6.2.1

Description

The fastest memoizing and caching Python library written in Rust

Added to portage

2026-07-28

cssselect - 1.5.0
Ebuild name:

dev-python/cssselect-1.5.0

Description

Parse CSS3 Selectors and translate them to XPath 1.0

Added to portage

2026-07-28

deepdiff - 9.1.0
Ebuild name:

dev-python/deepdiff-9.1.0

Description

A library for comparing dictionaries, iterables, strings and other object

Added to portage

2026-07-28

fastapi - 0.140.7
Ebuild name:

dev-python/fastapi-0.140.7

Description

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

Added to portage

2026-07-28

fastbencode - 0.3.11
Ebuild name:

dev-python/fastbencode-0.3.11

Description

Implementation of bencode with Rust implementation

Added to portage

2026-07-28

fastjsonschema - 2.22.1
Ebuild name:

dev-python/fastjsonschema-2.22.1

Description

Fast JSON schema validator for Python

Added to portage

2026-07-28

gdm - 49.3-r2
Ebuild name:

gnome-base/gdm-49.3-r2

Description

GNOME Display Manager for managing graphical display servers and user logins

Added to portage

2026-07-28

gnome-control-center - 49.8-r1
Ebuild name:

gnome-base/gnome-control-center-49.8-r1

Description

GNOME's main interface to configure various aspects of the

Added to portage

2026-07-28

gnome-flashback-herbstluftwm - 1.0
Ebuild name:

x11-wm/gnome-flashback-herbstluftwm-1.0

Description

GNOME Herbstluftwm session (via GNOME Flashback)

Added to portage

2026-07-28

gnome-shell-extension-appindicator - 65
Ebuild name:

gnome-extra/gnome-shell-extension-appindicator-65

Description

Support legacy, AppIndicators and KStatusNotifier

Added to portage

2026-07-28

guile - 3.0.11-r1
Ebuild name:

dev-scheme/guile-3.0.11-r1

Description

GNU Ubiquitous Intelligent Language for Extensions

Added to portage

2026-07-28

hypothesis - 6.161.8
Ebuild name:

dev-python/hypothesis-6.161.8

Description

A library for property based testing

Added to portage

2026-07-28

inline-snapshot - 0.35.3
Ebuild name:

dev-python/inline-snapshot-0.35.3

Description

Create and update inline snapshots in your Python tests

Added to portage

2026-07-28

krita - 6.0.3
Ebuild name:

media-gfx/krita-6.0.3

Description

Free digital painting application. Digital Painting, Creative Freedom

Added to portage

2026-07-28

libwebsockets - 5.0.0-r1
Ebuild name:

net-libs/libwebsockets-5.0.0-r1

Description

A flexible pure-C library for implementing network protocols

Added to portage

2026-07-28

meson-mode - 0.4
Ebuild name:

app-emacs/meson-mode-0.4

Description

A GNU Emacs major mode for Meson build-system files

Added to portage

2026-07-28

psych - 5.4.0
Ebuild name:

dev-ruby/psych-5.4.0

Description

A YAML parser and emitter

Added to portage

2026-07-28

pyproject-fmt - 2.26.0
Ebuild name:

dev-python/pyproject-fmt-2.26.0

Description

Format your pyproject.toml file

Added to portage

2026-07-28

pyquery - 2.0.2
Ebuild name:

dev-python/pyquery-2.0.2

Description

A jQuery-like library for python

Added to portage

2026-07-28

pyquery - 2.1.0
Ebuild name:

dev-python/pyquery-2.1.0

Description

A jQuery-like library for python

Added to portage

2026-07-28

python-lsp-server - 1.15.0
Ebuild name:

dev-python/python-lsp-server-1.15.0

Description

Python Language Server for the Language Server Protocol

Added to portage

2026-07-28

ruff - 0.16.0
Ebuild name:

dev-util/ruff-0.16.0

Description

An extremely fast Python linter, written in Rust

Added to portage

2026-07-28

samba - 4.23.10
Ebuild name:

net-fs/samba-4.23.10

Description

Samba Suite Version 4

Added to portage

2026-07-28

samba - 4.24.5
Ebuild name:

net-fs/samba-4.24.5

Description

Samba Suite Version 4

Added to portage

2026-07-28

sqlglot - 30.14.0
Ebuild name:

dev-python/sqlglot-30.14.0

Description

An easily customizable SQL parser and transpiler

Added to portage

2026-07-28

tailscale - 1.102.0
Ebuild name:

net-vpn/tailscale-1.102.0

Description

Tailscale vpn client

Added to portage

2026-07-28

tekore - 6.2.0
Ebuild name:

dev-python/tekore-6.2.0

Description

Spotify Web API client

Added to portage

2026-07-28

tqdm - 4.70.0
Ebuild name:

dev-python/tqdm-4.70.0

Description

Add a progress meter to your loops in a second

Added to portage

2026-07-28

ttyd - 1.7.7-r2
Ebuild name:

www-apps/ttyd-1.7.7-r2

Description

ttyd, a simple command-line tool for sharing terminal over the web

Added to portage

2026-07-28

twine - 7.0.0
Ebuild name:

dev-python/twine-7.0.0

Description

Collection of utilities for publishing packages on PyPI

Added to portage

2026-07-28

zoom - 7.0.0.1666-r2
Ebuild name:

net-im/zoom-7.0.0.1666-r2

Description

Video conferencing and web conferencing service

Added to portage

2026-07-28

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