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:

87790

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-19
macrostep - 0.9.5
Ebuild name:

app-emacs/macrostep-0.9.5

Description

Interactive macro-expander for Emacs

Added to portage

2026-08-19

portage - 3.0.81.3
Ebuild name:

sys-apps/portage-3.0.81.3

Description

The package management and distribution system for Gentoo

Added to portage

2026-08-19

2026-08-18
bcachefs-tools - 1.39.2
Ebuild name:

sys-fs/bcachefs-tools-1.39.2

Description

Tools for bcachefs

Added to portage

2026-08-18

blockbuster - 1.5.27
Ebuild name:

dev-python/blockbuster-1.5.27

Description

Utility to detect blocking calls in the async event loop

Added to portage

2026-08-18

boto3 - 1.43.73
Ebuild name:

dev-python/boto3-1.43.73

Description

The AWS SDK for Python

Added to portage

2026-08-18

botocore - 1.43.73
Ebuild name:

dev-python/botocore-1.43.73

Description

Low-level, data-driven core of boto 3

Added to portage

2026-08-18

breezy - 3.3.22-r2
Ebuild name:

dev-vcs/breezy-3.3.22-r2

Description

Distributed Version Control System with a Friendly UI

Added to portage

2026-08-18

capstone - 5.0.9
Ebuild name:

dev-libs/capstone-5.0.9

Description

disassembly/disassembler framework + bindings

Added to portage

2026-08-18

capstone - 6.0.0_alpha10
Ebuild name:

dev-libs/capstone-6.0.0_alpha10

Description

disassembly/disassembler framework + bindings

Added to portage

2026-08-18

catalogus - 0.1.0
Ebuild name:

dev-python/catalogus-0.1.0

Description

Classes to provide name-to-object registry-like support

Added to portage

2026-08-18

chrome-binary-plugins - 151.0.7922.137
Ebuild name:

www-plugins/chrome-binary-plugins-151.0.7922.137

Description

Binary plugins from Google Chrome for use in Chrom

Added to portage

2026-08-18

chrome-binary-plugins - 152.0.7977.42_beta
Ebuild name:

www-plugins/chrome-binary-plugins-152.0.7977.42_beta

Description

Binary plugins from Google Chrome for use in C

Added to portage

2026-08-18

chrome-binary-plugins - 153.0.8003.0_alpha
Ebuild name:

www-plugins/chrome-binary-plugins-153.0.8003.0_alpha

Description

Binary plugins from Google Chrome for use in C

Added to portage

2026-08-18

chromedriver-bin - 151.0.7922.137
Ebuild name:

www-apps/chromedriver-bin-151.0.7922.137

Description

WebDriver for Chrome

Added to portage

2026-08-18

chromium - 151.0.7922.137
Ebuild name:

www-client/chromium-151.0.7922.137

Description

Open-source version of Google Chrome web browser

Added to portage

2026-08-18

devedeng - 4.22.0
Ebuild name:

media-video/devedeng-4.22.0

Description

DevedeNG is a program to create video DVDs and CDs (VCD, sVCD or CVD)

Added to portage

2026-08-18

discord - 1.0.154
Ebuild name:

net-im/discord-1.0.154

Description

All-in-one voice and text chat for gamers

Added to portage

2026-08-18

dotnet-runtime-nugets - 10.0.11
Ebuild name:

dev-dotnet/dotnet-runtime-nugets-10.0.11

Description

.NET runtime nugets

Added to portage

2026-08-18

dotnet-runtime-nugets - 8.0.30
Ebuild name:

dev-dotnet/dotnet-runtime-nugets-8.0.30

Description

.NET runtime nugets

Added to portage

2026-08-18

dotnet-runtime-nugets - 9.0.19
Ebuild name:

dev-dotnet/dotnet-runtime-nugets-9.0.19

Description

.NET runtime nugets

Added to portage

2026-08-18

dotnet-sdk-bin - 10.0.111
Ebuild name:

dev-dotnet/dotnet-sdk-bin-10.0.111

Description

.NET is a free, cross-platform, open-source developer platform

Added to portage

2026-08-18

dotnet-sdk-bin - 10.0.400
Ebuild name:

dev-dotnet/dotnet-sdk-bin-10.0.400

Description

.NET is a free, cross-platform, open-source developer platform

Added to portage

2026-08-18

etcd - 3.7.1
Ebuild name:

dev-db/etcd-3.7.1

Description

Highly-available key value store for shared configuration and service discovery

Added to portage

2026-08-18

firefox - 153.1.0
Ebuild name:

www-client/firefox-153.1.0

Description

Firefox Web Browser

Added to portage

2026-08-18

firefox - 154.0
Ebuild name:

www-client/firefox-154.0

Description

Firefox Web Browser

Added to portage

2026-08-18

firefox-l10n - 153.1.0
Ebuild name:

www-client/firefox-l10n-153.1.0

Description

Firefox Web Browser's translation files

Added to portage

2026-08-18

firefox-l10n - 154.0
Ebuild name:

www-client/firefox-l10n-154.0

Description

Firefox Web Browser's translation files

Added to portage

2026-08-18

ggml - 0.20.1
Ebuild name:

sci-ml/ggml-0.20.1

Description

Tensor library for machine learning

Added to portage

2026-08-18

google-chrome - 151.0.7922.137
Ebuild name:

www-client/google-chrome-151.0.7922.137

Description

The web browser from Google

Added to portage

2026-08-18

google-chrome-beta - 152.0.7977.42
Ebuild name:

www-client/google-chrome-beta-152.0.7977.42

Description

The web browser from Google

Added to portage

2026-08-18

google-chrome-unstable - 153.0.8003.0
Ebuild name:

www-client/google-chrome-unstable-153.0.8003.0

Description

The web browser from Google

Added to portage

2026-08-18

libdivsufsort - 2.0.1-r3
Ebuild name:

dev-libs/libdivsufsort-2.0.1-r3

Description

Suffix-sorting library (for BWT)

Added to portage

2026-08-18

lndir - 1.0.6
Ebuild name:

x11-misc/lndir-1.0.6

Description

create a shadow directory of symbolic links to another directory tree

Added to portage

2026-08-18

makedepend - 1.0.10
Ebuild name:

x11-misc/makedepend-1.0.10

Description

create dependencies in makefiles

Added to portage

2026-08-18

mesa - 26.1.7
Ebuild name:

media-libs/mesa-26.1.7

Description

OpenGL-like graphic library for Linux

Added to portage

2026-08-18

mesa_clc - 26.1.7
Ebuild name:

dev-util/mesa_clc-26.1.7

Description

mesa_clc tool used for building OpenCL C to SPIR-V

Added to portage

2026-08-18

microsoft-edge - 151.0.4129.93
Ebuild name:

www-client/microsoft-edge-151.0.4129.93

Description

The web browser from Microsoft

Added to portage

2026-08-18

microsoft-edge-beta - 152.0.4191.19
Ebuild name:

www-client/microsoft-edge-beta-152.0.4191.19

Description

The web browser from Microsoft

Added to portage

2026-08-18

microsoft-edge-dev - 153.0.4210.0
Ebuild name:

www-client/microsoft-edge-dev-153.0.4210.0

Description

The web browser from Microsoft

Added to portage

2026-08-18

nextcloud - 32.0.14
Ebuild name:

www-apps/nextcloud-32.0.14

Description

Personal cloud that runs on your own server

Added to portage

2026-08-18

nextcloud - 33.0.8
Ebuild name:

www-apps/nextcloud-33.0.8

Description

Personal cloud that runs on your own server

Added to portage

2026-08-18

nextcloud - 34.0.3
Ebuild name:

www-apps/nextcloud-34.0.3

Description

Personal cloud that runs on your own server

Added to portage

2026-08-18

oct2py - 6.0.4
Ebuild name:

dev-python/oct2py-6.0.4

Description

Python to GNU Octave bridge

Added to portage

2026-08-18

openldap - 2.6.14
Ebuild name:

net-nds/openldap-2.6.14

Description

LDAP suite of application and development tools

Added to portage

2026-08-18

openrgb - 1.0_rc3-r1
Ebuild name:

app-misc/openrgb-1.0_rc3-r1

Description

Open source RGB lighting control

Added to portage

2026-08-18

opera - 134.0.5954.56
Ebuild name:

www-client/opera-134.0.5954.56

Description

A fast and secure web browser

Added to portage

2026-08-18

opera-developer - 136.0.5988.0
Ebuild name:

www-client/opera-developer-136.0.5988.0

Description

A fast and secure web browser

Added to portage

2026-08-18

pikepdf - 10.12.0
Ebuild name:

dev-python/pikepdf-10.12.0

Description

Python library to work with pdf files based on qpdf

Added to portage

2026-08-18

pkgcore - 0.12.40
Ebuild name:

sys-apps/pkgcore-0.12.40

Description

a framework for package management

Added to portage

2026-08-18

postfix - 3.12_pre20260817
Ebuild name:

mail-mta/postfix-3.12_pre20260817

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2026-08-18

pycuda - 2025.1.3-r1
Ebuild name:

dev-python/pycuda-2025.1.3-r1

Description

Python wrapper for NVIDIA CUDA

Added to portage

2026-08-18

pyopencl - 2026.1.2
Ebuild name:

dev-python/pyopencl-2026.1.2

Description

Python wrapper for OpenCL

Added to portage

2026-08-18

pythran - 0.19.0
Ebuild name:

dev-python/pythran-0.19.0

Description

Ahead of Time compiler for numeric kernels

Added to portage

2026-08-18

qt-docs - 6.11.2_p202608131018
Ebuild name:

dev-qt/qt-docs-6.11.2_p202608131018

Description

Qt6 documentation and examples for Qt Creator and other tools

Added to portage

2026-08-18

qt3d - 6.11.2
Ebuild name:

dev-qt/qt3d-6.11.2

Description

3D rendering module for the Qt6 framework

Added to portage

2026-08-18

qt5compat - 6.11.2
Ebuild name:

dev-qt/qt5compat-6.11.2

Description

Qt module containing the unsupported Qt 5 APIs

Added to portage

2026-08-18

qtbase - 6.11.2
Ebuild name:

dev-qt/qtbase-6.11.2

Description

Cross-platform application development framework

Added to portage

2026-08-18

qtcharts - 6.11.2
Ebuild name:

dev-qt/qtcharts-6.11.2

Description

Chart component library for the Qt6 framework

Added to portage

2026-08-18

qtconnectivity - 6.11.2
Ebuild name:

dev-qt/qtconnectivity-6.11.2

Description

Bluetooth and NFC support library for the Qt6 framework

Added to portage

2026-08-18

qtdeclarative - 6.11.2
Ebuild name:

dev-qt/qtdeclarative-6.11.2

Description

Qt Declarative (Quick 2)

Added to portage

2026-08-18

qtgraphs - 6.11.2
Ebuild name:

dev-qt/qtgraphs-6.11.2

Description

Graphs component library for the Qt6 framework

Added to portage

2026-08-18

qthttpserver - 6.11.2
Ebuild name:

dev-qt/qthttpserver-6.11.2

Description

HTTP server functionality for the Qt6 framework

Added to portage

2026-08-18

qtimageformats - 6.11.2
Ebuild name:

dev-qt/qtimageformats-6.11.2

Description

Additional format plugins for the Qt image I/O system

Added to portage

2026-08-18

qtlanguageserver - 6.11.2
Ebuild name:

dev-qt/qtlanguageserver-6.11.2

Description

Implementation of the Language Server Protocol for Qt

Added to portage

2026-08-18

qtlocation - 6.11.2
Ebuild name:

dev-qt/qtlocation-6.11.2

Description

Location (places, maps, navigation) library for the Qt6 framework

Added to portage

2026-08-18

qtmultimedia - 6.11.2
Ebuild name:

dev-qt/qtmultimedia-6.11.2

Description

Multimedia (audio, video, radio, camera) library for the Qt6 framework

Added to portage

2026-08-18

qtnetworkauth - 6.11.2
Ebuild name:

dev-qt/qtnetworkauth-6.11.2

Description

Network authorization library for the Qt6 framework

Added to portage

2026-08-18

qtpositioning - 6.11.2
Ebuild name:

dev-qt/qtpositioning-6.11.2

Description

Physical position determination library for the Qt6 framework

Added to portage

2026-08-18

qtquick3d - 6.11.2
Ebuild name:

dev-qt/qtquick3d-6.11.2

Description

Qt module and API for defining 3D content in Qt QuickTools

Added to portage

2026-08-18

qtquicktimeline - 6.11.2
Ebuild name:

dev-qt/qtquicktimeline-6.11.2

Description

Qt module for keyframe-based timeline construction

Added to portage

2026-08-18

qtremoteobjects - 6.11.2
Ebuild name:

dev-qt/qtremoteobjects-6.11.2

Description

Inter-Process Communication (IPC) library for the Qt6 framework

Added to portage

2026-08-18

qtscxml - 6.11.2
Ebuild name:

dev-qt/qtscxml-6.11.2

Description

State Chart XML (SCXML) support library for the Qt6 framework

Added to portage

2026-08-18

qtsensors - 6.11.2
Ebuild name:

dev-qt/qtsensors-6.11.2

Description

Hardware sensor access library for the Qt6 framework

Added to portage

2026-08-18

qtserialbus - 6.11.2
Ebuild name:

dev-qt/qtserialbus-6.11.2

Description

Qt module to access CAN, ModBus, and other industrial serial buses and pr

Added to portage

2026-08-18

qtserialport - 6.11.2
Ebuild name:

dev-qt/qtserialport-6.11.2

Description

Serial port abstraction library for the Qt6 framework

Added to portage

2026-08-18

qtshadertools - 6.11.2
Ebuild name:

dev-qt/qtshadertools-6.11.2

Description

Qt APIs and Tools for Graphics Pipelines

Added to portage

2026-08-18

qtspeech - 6.11.2
Ebuild name:

dev-qt/qtspeech-6.11.2

Description

Text-to-speech library for the Qt6 framework

Added to portage

2026-08-18

qtsvg - 6.11.2
Ebuild name:

dev-qt/qtsvg-6.11.2

Description

SVG rendering library for the Qt6 framework

Added to portage

2026-08-18

qttasktree - 6.11.2
Ebuild name:

dev-qt/qttasktree-6.11.2

Description

Module to compose and execute asynchronous task workflows for the Qt6 fram

Added to portage

2026-08-18

qttools - 6.11.2
Ebuild name:

dev-qt/qttools-6.11.2

Description

Qt Tools Collection

Added to portage

2026-08-18

qttranslations - 6.11.2
Ebuild name:

dev-qt/qttranslations-6.11.2

Description

Translation files for the Qt6 framework

Added to portage

2026-08-18

qtvirtualkeyboard - 6.11.2
Ebuild name:

dev-qt/qtvirtualkeyboard-6.11.2

Description

Customizable input framework and virtual keyboard for Qt

Added to portage

2026-08-18

qtwayland - 6.11.2
Ebuild name:

dev-qt/qtwayland-6.11.2

Description

Toolbox for making Qt based Wayland compositors

Added to portage

2026-08-18

qtwebchannel - 6.11.2
Ebuild name:

dev-qt/qtwebchannel-6.11.2

Description

Qt WebChannel

Added to portage

2026-08-18

qtwebengine - 6.11.2
Ebuild name:

dev-qt/qtwebengine-6.11.2

Description

Library for rendering dynamic web content in Qt6 C++ and QML applications

Added to portage

2026-08-18

qtwebsockets - 6.11.2
Ebuild name:

dev-qt/qtwebsockets-6.11.2

Description

Implementation of the WebSocket protocol for the Qt6 framework

Added to portage

2026-08-18

qtwebview - 6.11.2
Ebuild name:

dev-qt/qtwebview-6.11.2

Description

Module for displaying web content in a QML application using the Qt6 framew

Added to portage

2026-08-18

rocksdb - 11.8.1
Ebuild name:

dev-libs/rocksdb-11.8.1

Description

Embeddable, persistent key-value store for fast storage

Added to portage

2026-08-18

splix - 2.0.2
Ebuild name:

net-print/splix-2.0.2

Description

A set of CUPS printer drivers for SPL (Samsung Printer Language) printers

Added to portage

2026-08-18

vivaldi - 8.1.4087.64
Ebuild name:

www-client/vivaldi-8.1.4087.64

Description

A browser for our friends

Added to portage

2026-08-18

vivaldi - 8.1.4087.66
Ebuild name:

www-client/vivaldi-8.1.4087.66

Description

A browser for our friends

Added to portage

2026-08-18

vivaldi-snapshot - 8.2.4129.3
Ebuild name:

www-client/vivaldi-snapshot-8.2.4129.3

Description

A browser for our friends

Added to portage

2026-08-18

vivaldi-snapshot - 8.2.4133.3
Ebuild name:

www-client/vivaldi-snapshot-8.2.4133.3

Description

A browser for our friends

Added to portage

2026-08-18

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