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:

82355

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.7 (41 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
2025-12-08
apprise - 1.9.6
Ebuild name:

dev-python/apprise-1.9.6

Description

Push Notifications that work with just about every platform

Added to portage

2025-12-08

basket - 2.49b_p20251207
Ebuild name:

kde-misc/basket-2.49b_p20251207

Description

Multiple information organizer - a DropDrawers clone

Added to portage

2025-12-08

black - 25.12.0
Ebuild name:

dev-python/black-25.12.0

Description

The uncompromising Python code formatter

Added to portage

2025-12-08

blas-lapack-aux-wrapper - 4
Ebuild name:

sci-libs/blas-lapack-aux-wrapper-4

Description

BLAS/LAPACK wrappers for FlexiBLAS

Added to portage

2025-12-08

blockbuster - 1.5.26
Ebuild name:

dev-python/blockbuster-1.5.26

Description

Utility to detect blocking calls in the async event loop

Added to portage

2025-12-08

cdrdao - 1.2.6
Ebuild name:

app-cdr/cdrdao-1.2.6

Description

Burn CDs in disk-at-once mode with a command line interface

Added to portage

2025-12-08

claude-code - 2.0.61
Ebuild name:

dev-util/claude-code-2.0.61

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2025-12-08

cmd2 - 3.0.0
Ebuild name:

dev-python/cmd2-3.0.0

Description

Extra features for standard library's cmd module

Added to portage

2025-12-08

double-conversion - 3.4.0
Ebuild name:

dev-libs/double-conversion-3.4.0

Description

Binary-decimal and decimal-binary conversion routines for IEEE dou

Added to portage

2025-12-08

e3-core - 22.6.0-r5
Ebuild name:

dev-ada/e3-core-22.6.0-r5

Description

Ease the development of portable automated build systems

Added to portage

2025-12-08

eisl - 5.61
Ebuild name:

dev-lang/eisl-5.61

Description

Interpreter and compiler compatible with the ISLisp standard

Added to portage

2025-12-08

elogviewer - 3.3_pre20251208
Ebuild name:

app-portage/elogviewer-3.3_pre20251208

Description

Elog viewer for Gentoo

Added to portage

2025-12-08

firefox-bin - 146.0-r1
Ebuild name:

www-client/firefox-bin-146.0-r1

Description

Firefox Web Browser

Added to portage

2025-12-08

fsautocomplete - 0.82.0
Ebuild name:

dev-dotnet/fsautocomplete-0.82.0

Description

F language server using the Language Server Protocol

Added to portage

2025-12-08

gcc - 16.0.0_p20251207
Ebuild name:

sys-devel/gcc-16.0.0_p20251207

Description

The GNU Compiler Collection

Added to portage

2025-12-08

gmpy2 - 2.3.0_alpha3
Ebuild name:

dev-python/gmpy2-2.3.0_alpha3

Description

Python bindings for GMP, MPC, MPFR and MPIR libraries

Added to portage

2025-12-08

guildmaster - 0_pre20250712
Ebuild name:

dev-build/guildmaster-0_pre20250712

Description

FIFO-like jobserver node via CUSE

Added to portage

2025-12-08

httpx-socks - 0.11.0
Ebuild name:

dev-python/httpx-socks-0.11.0

Description

Proxy (HTTP, SOCKS) transports for httpx

Added to portage

2025-12-08

incus - 6.19.1
Ebuild name:

app-containers/incus-6.19.1

Description

Modern, secure and powerful system container and virtual machine manage

Added to portage

2025-12-08

jitterentropy - 3.6.3
Ebuild name:

app-crypt/jitterentropy-3.6.3

Description

Hardware RNG based on CPU timing jitter

Added to portage

2025-12-08

koleo-cli - 0.2.137.24.2
Ebuild name:

app-misc/koleo-cli-0.2.137.24.2

Description

A simple CLI for koleo.pl railway planner

Added to portage

2025-12-08

libdrm - 2.4.130
Ebuild name:

x11-libs/libdrm-2.4.130

Description

X.Org libdrm library

Added to portage

2025-12-08

libinput - 1.30.1
Ebuild name:

dev-libs/libinput-1.30.1

Description

Library to handle input devices in Wayland

Added to portage

2025-12-08

libtmux - 0.52.1
Ebuild name:

dev-python/libtmux-0.52.1

Description

Typed library that provides an ORM wrapper for tmux, a terminal multiplex

Added to portage

2025-12-08

mistletoe - 1.5.1
Ebuild name:

dev-python/mistletoe-1.5.1

Description

A fast, extensible Markdown parser in pure Python

Added to portage

2025-12-08

nftables - 1.1.6
Ebuild name:

net-firewall/nftables-1.1.6

Description

Linux kernel firewall, NAT and packet mangling tools

Added to portage

2025-12-08

pdns-recursor - 5.3.3
Ebuild name:

net-dns/pdns-recursor-5.3.3

Description

The PowerDNS Recursor

Added to portage

2025-12-08

pfuture - 1.10.3
Ebuild name:

app-emacs/pfuture-1.10.3

Description

Simple wrapper around asynchronous processes

Added to portage

2025-12-08

php-mode - 1.27.0
Ebuild name:

app-emacs/php-mode-1.27.0

Description

GNU Emacs major mode for editing PHP code

Added to portage

2025-12-08

pymdown-extensions - 10.18
Ebuild name:

dev-python/pymdown-extensions-10.18

Description

Extensions for Python Markdown

Added to portage

2025-12-08

pypdf - 6.4.1
Ebuild name:

dev-python/pypdf-6.4.1

Description

Python library to work with PDF files

Added to portage

2025-12-08

pyzstd - 0.19.0
Ebuild name:

dev-python/pyzstd-0.19.0

Description

Support for Zstandard (zstd) compression

Added to portage

2025-12-08

racket-mode - 1_p20251107
Ebuild name:

app-emacs/racket-mode-1_p20251107

Description

Emacs modes for Racket edit, REPL, check-syntax, debug, profile,

Added to portage

2025-12-08

rsyslog - 8.2512.0
Ebuild name:

app-admin/rsyslog-8.2512.0

Description

An enhanced multi-threaded syslogd with database support and more

Added to portage

2025-12-08

spawn - 25.0.0-r4
Ebuild name:

dev-ada/spawn-25.0.0-r4

Description

Simple API to spawn processes

Added to portage

2025-12-08

xterm - 404
Ebuild name:

x11-terms/xterm-404

Description

Terminal Emulator for X Windows

Added to portage

2025-12-08

xvfbwrapper - 0.2.16
Ebuild name:

dev-python/xvfbwrapper-0.2.16

Description

Python wrapper for running a display inside X virtual framebuffer

Added to portage

2025-12-08

yt-dlp - 2025.12.08
Ebuild name:

net-misc/yt-dlp-2025.12.08

Description

youtube-dl fork with additional features and fixes

Added to portage

2025-12-08

yt-dlp-ejs - 0.3.2
Ebuild name:

dev-python/yt-dlp-ejs-0.3.2

Description

External JavaScript for yt-dlp supporting many runtimes

Added to portage

2025-12-08

2025-12-07
aruba - 2.3.3
Ebuild name:

dev-util/aruba-2.3.3

Description

Cucumber steps for driving out command line applications

Added to portage

2025-12-07

backports-zstd - 1.2.0
Ebuild name:

dev-python/backports-zstd-1.2.0

Description

Backport of PEP-784 adding Zstandard to the standard library

Added to portage

2025-12-07

certbot - 5.2.1
Ebuild name:

app-crypt/certbot-5.2.1

Description

Let's Encrypt client to automate deployment of X.509 certificates

Added to portage

2025-12-07

cvmfs - 2.13.3
Ebuild name:

net-fs/cvmfs-2.13.3

Description

HTTP read-only file system for distributing software

Added to portage

2025-12-07

dist-kernel - 5.10.247
Ebuild name:

virtual/dist-kernel-5.10.247

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-12-07

dist-kernel - 5.15.197
Ebuild name:

virtual/dist-kernel-5.15.197

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-12-07

dist-kernel - 6.1.159
Ebuild name:

virtual/dist-kernel-6.1.159

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-12-07

dist-kernel - 6.12.61
Ebuild name:

virtual/dist-kernel-6.12.61

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-12-07

dist-kernel - 6.17.11
Ebuild name:

virtual/dist-kernel-6.17.11

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-12-07

dist-kernel - 6.6.119
Ebuild name:

virtual/dist-kernel-6.6.119

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-12-07

django-timezone-field - 7.2.1
Ebuild name:

dev-python/django-timezone-field-7.2.1

Description

A Django app providing database and form fields for timezone

Added to portage

2025-12-07

evolution - 3.58.2-r1
Ebuild name:

mail-client/evolution-3.58.2-r1

Description

Integrated mail, addressbook and calendaring functionality

Added to portage

2025-12-07

findimports - 2.8.0
Ebuild name:

dev-python/findimports-2.8.0

Description

Python module import analysis tool

Added to portage

2025-12-07

gcc - 15.2.1_p20251206
Ebuild name:

sys-devel/gcc-15.2.1_p20251206

Description

The GNU Compiler Collection

Added to portage

2025-12-07

geant - 4.11.4.0
Ebuild name:

sci-physics/geant-4.11.4.0

Description

Toolkit for simulation of passage of particles through matter

Added to portage

2025-12-07

geant-data - 4.11.4
Ebuild name:

sci-physics/geant-data-4.11.4

Description

Data files for Geant4 physical processes

Added to portage

2025-12-07

gentoo-kernel - 5.10.247
Ebuild name:

sys-kernel/gentoo-kernel-5.10.247

Description

Linux kernel built with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel - 5.15.197
Ebuild name:

sys-kernel/gentoo-kernel-5.15.197

Description

Linux kernel built with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel - 6.1.159
Ebuild name:

sys-kernel/gentoo-kernel-6.1.159

Description

Linux kernel built with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel - 6.12.61
Ebuild name:

sys-kernel/gentoo-kernel-6.12.61

Description

Linux kernel built with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel - 6.17.11
Ebuild name:

sys-kernel/gentoo-kernel-6.17.11

Description

Linux kernel built with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel - 6.6.119
Ebuild name:

sys-kernel/gentoo-kernel-6.6.119

Description

Linux kernel built with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel-bin - 5.10.247
Ebuild name:

sys-kernel/gentoo-kernel-bin-5.10.247

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel-bin - 5.15.197
Ebuild name:

sys-kernel/gentoo-kernel-bin-5.15.197

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel-bin - 6.1.159
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.1.159

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel-bin - 6.12.61
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.61

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel-bin - 6.17.11
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.17.11

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel-bin - 6.6.119
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.6.119

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-12-07

gentoo-sources - 5.10.247
Ebuild name:

sys-kernel/gentoo-sources-5.10.247

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-12-07

gentoo-sources - 5.15.197
Ebuild name:

sys-kernel/gentoo-sources-5.15.197

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-12-07

gentoo-sources - 6.1.159
Ebuild name:

sys-kernel/gentoo-sources-6.1.159

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-12-07

gentoo-sources - 6.12.61
Ebuild name:

sys-kernel/gentoo-sources-6.12.61

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-12-07

gentoo-sources - 6.17.11
Ebuild name:

sys-kernel/gentoo-sources-6.17.11

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-12-07

gentoo-sources - 6.6.119
Ebuild name:

sys-kernel/gentoo-sources-6.6.119

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-12-07

ibus-typing-booster - 2.28.6
Ebuild name:

app-i18n/ibus-typing-booster-2.28.6

Description

Completion input method for IBus

Added to portage

2025-12-07

kwallet-pam - 6.4.5-r1
Ebuild name:

kde-plasma/kwallet-pam-6.4.5-r1

Description

PAM module to not enter KWallet password again after login

Added to portage

2025-12-07

kwallet-pam - 6.5.3-r1
Ebuild name:

kde-plasma/kwallet-pam-6.5.3-r1

Description

PAM module to not enter KWallet password again after login

Added to portage

2025-12-07

libfilezilla - 0.51.1-r1
Ebuild name:

dev-libs/libfilezilla-0.51.1-r1

Description

C++ library offering some basic functionality for platform-independ

Added to portage

2025-12-07

libfilezilla - 0.52.0-r1
Ebuild name:

dev-libs/libfilezilla-0.52.0-r1

Description

C++ library offering some basic functionality for platform-independ

Added to portage

2025-12-07

librt - 0.7.3
Ebuild name:

dev-python/librt-0.7.3

Description

Mypyc runtime library

Added to portage

2025-12-07

libtmux - 0.51.0
Ebuild name:

dev-python/libtmux-0.51.0

Description

Typed library that provides an ORM wrapper for tmux, a terminal multiplex

Added to portage

2025-12-07

libutf8proc - 2.11.2
Ebuild name:

dev-libs/libutf8proc-2.11.2

Description

A clean C Library for processing UTF-8 Unicode data

Added to portage

2025-12-07

meson - 1.9.2
Ebuild name:

dev-build/meson-1.9.2

Description

Open source build system

Added to portage

2025-12-07

nss - 3.119
Ebuild name:

dev-libs/nss-3.119

Description

Mozilla's Network Security Services library that implements PKI support

Added to portage

2025-12-07

pacparser - 1.4.6
Ebuild name:

net-libs/pacparser-1.4.6

Description

Library to parse proxy auto-config files

Added to portage

2025-12-07

perf - 6.18
Ebuild name:

dev-util/perf-6.18

Description

Userland tools for Linux Performance Counters

Added to portage

2025-12-07

postfix - 3.10.7
Ebuild name:

mail-mta/postfix-3.10.7

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2025-12-07

pudb - 2025.1.5
Ebuild name:

dev-python/pudb-2025.1.5

Description

A full-screen, console-based Python debugger

Added to portage

2025-12-07

pytest - 9.0.2
Ebuild name:

dev-python/pytest-9.0.2

Description

Simple powerful testing with Python

Added to portage

2025-12-07

root - 6.38.00
Ebuild name:

sci-physics/root-6.38.00

Description

C++ data analysis framework and interpreter from CERN

Added to portage

2025-12-07

rqrcode - 3.1.1
Ebuild name:

dev-ruby/rqrcode-3.1.1

Description

Library for encoding QR Codes

Added to portage

2025-12-07

rqrcode_core - 2.0.1
Ebuild name:

dev-ruby/rqrcode_core-2.0.1

Description

Library for encoding QR Codes

Added to portage

2025-12-07

selenium - 4.39.0
Ebuild name:

dev-python/selenium-4.39.0

Description

Python language binding for Selenium Remote Control

Added to portage

2025-12-07

selenium-manager - 4.39.0
Ebuild name:

dev-util/selenium-manager-4.39.0

Description

CLI tool that manages the browser/driver infrastructure required b

Added to portage

2025-12-07

sequel - 5.99.0
Ebuild name:

dev-ruby/sequel-5.99.0

Description

A lightweight database toolkit for Ruby

Added to portage

2025-12-07

sys-filesystem - 1.5.5
Ebuild name:

dev-ruby/sys-filesystem-1.5.5

Description

Cross-platform interface for filesystem information

Added to portage

2025-12-07

trimesh - 4.10.1
Ebuild name:

dev-python/trimesh-4.10.1

Description

Python library for loading and using triangular meshes

Added to portage

2025-12-07

uftrace - 0.18.1
Ebuild name:

dev-util/uftrace-0.18.1

Description

Function (graph) tracer for user-space

Added to portage

2025-12-07

vanilla-kernel - 5.10.247
Ebuild name:

sys-kernel/vanilla-kernel-5.10.247

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-12-07

vanilla-kernel - 5.15.197
Ebuild name:

sys-kernel/vanilla-kernel-5.15.197

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-12-07

vanilla-kernel - 6.1.159
Ebuild name:

sys-kernel/vanilla-kernel-6.1.159

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-12-07

vanilla-kernel - 6.12.61
Ebuild name:

sys-kernel/vanilla-kernel-6.12.61

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-12-07

vanilla-kernel - 6.17.11
Ebuild name:

sys-kernel/vanilla-kernel-6.17.11

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-12-07

vanilla-kernel - 6.6.119
Ebuild name:

sys-kernel/vanilla-kernel-6.6.119

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-12-07

vanilla-sources - 5.10.247
Ebuild name:

sys-kernel/vanilla-sources-5.10.247

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

vanilla-sources - 5.15.197
Ebuild name:

sys-kernel/vanilla-sources-5.15.197

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

vanilla-sources - 5.4.302
Ebuild name:

sys-kernel/vanilla-sources-5.4.302

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

vanilla-sources - 6.1.159
Ebuild name:

sys-kernel/vanilla-sources-6.1.159

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

vanilla-sources - 6.12.61
Ebuild name:

sys-kernel/vanilla-sources-6.12.61

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

vanilla-sources - 6.17.11
Ebuild name:

sys-kernel/vanilla-sources-6.17.11

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

vanilla-sources - 6.6.119
Ebuild name:

sys-kernel/vanilla-sources-6.6.119

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

webrick - 1.9.2
Ebuild name:

dev-ruby/webrick-1.9.2

Description

An HTTP server toolkit

Added to portage

2025-12-07

yard - 0.9.38
Ebuild name:

dev-ruby/yard-0.9.38

Description

Documentation generation tool for the Ruby programming language

Added to portage

2025-12-07

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