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:

82056

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-11-13
huggingface_hub - 0.36.0
Ebuild name:

sci-ml/huggingface_hub-0.36.0

Description

a client library to interact with the Hugging Face Hub

Added to portage

2025-11-13

libxkbcommon - 1.13.0
Ebuild name:

x11-libs/libxkbcommon-1.13.0

Description

Keymap handling library for toolkits and window systems

Added to portage

2025-11-13

mesa - 25.2.7
Ebuild name:

media-libs/mesa-25.2.7

Description

OpenGL-like graphic library for Linux

Added to portage

2025-11-13

mesa_clc - 25.2.7
Ebuild name:

dev-util/mesa_clc-25.2.7

Description

mesa_clc tool used for building OpenCL C to SPIR-V

Added to portage

2025-11-13

nodejs - 24.11.1
Ebuild name:

net-libs/nodejs-24.11.1

Description

A JavaScript runtime built on Chrome's V8 JavaScript engine

Added to portage

2025-11-13

popup - 0.5.9
Ebuild name:

app-emacs/popup-0.5.9

Description

Visual popup interface library for Emacs

Added to portage

2025-11-13

2025-11-12
ansible-lint - 25.11.0
Ebuild name:

app-admin/ansible-lint-25.11.0

Description

Checks ansible playbooks for practices and behaviour that can be imp

Added to portage

2025-11-12

ansible-molecule - 25.11.0
Ebuild name:

app-admin/ansible-molecule-25.11.0

Description

A toolkit designed to aid in the development and testing of Ansi

Added to portage

2025-11-12

atop - 2.12.1
Ebuild name:

sys-process/atop-2.12.1

Description

Resource-specific view of processes

Added to portage

2025-11-12

awscli - 1.42.71
Ebuild name:

app-admin/awscli-1.42.71

Description

Universal Command Line Environment for AWS

Added to portage

2025-11-12

batmon - 0.9
Ebuild name:

gnustep-apps/batmon-0.9

Description

displays the status of your laptop battery

Added to portage

2025-11-12

binutils - 2.45.1
Ebuild name:

sys-devel/binutils-2.45.1

Description

Tools necessary to build programs

Added to portage

2025-11-12

binutils-hppa64 - 2.45.1
Ebuild name:

sys-devel/binutils-hppa64-2.45.1

Description

Tools necessary to build programs

Added to portage

2025-11-12

binutils-libs - 2.45.1
Ebuild name:

sys-libs/binutils-libs-2.45.1

Description

Core binutils libraries (libbfd, libopcodes, libiberty) for external

Added to portage

2025-11-12

boto3 - 1.40.71
Ebuild name:

dev-python/boto3-1.40.71

Description

The AWS SDK for Python

Added to portage

2025-11-12

botocore - 1.40.71
Ebuild name:

dev-python/botocore-1.40.71

Description

Low-level, data-driven core of boto 3

Added to portage

2025-11-12

bpf-toolchain - 15.2.0_p2
Ebuild name:

sys-devel/bpf-toolchain-15.2.0_p2

Description

All-in-one bpf toolchain for building DTrace and systemd without

Added to portage

2025-11-12

cadvisor - 0.53.0
Ebuild name:

app-containers/cadvisor-0.53.0

Description

Analyzes resource usage and performance characteristics of running c

Added to portage

2025-11-12

caffe2 - 2.9.0-r2
Ebuild name:

sci-ml/caffe2-2.9.0-r2

Description

A deep learning framework

Added to portage

2025-11-12

cargo-nextest - 0.9.111
Ebuild name:

dev-util/cargo-nextest-0.9.111

Description

Next-generation test runner for Rust

Added to portage

2025-11-12

cutter - 2.4.1-r1
Ebuild name:

dev-util/cutter-2.4.1-r1

Description

A Qt and C++ GUI for rizin reverse engineering framework

Added to portage

2025-11-12

dbeaver-bin - 25.2.4
Ebuild name:

dev-db/dbeaver-bin-25.2.4

Description

Free universal database tool (community edition)

Added to portage

2025-11-12

dkimpy-milter - 0
Ebuild name:

acct-group/dkimpy-milter-0

Description

Added to portage

2025-11-12

dkimpy-milter - 0
Ebuild name:

acct-user/dkimpy-milter-0

Description

user for dkimpy-milter

Added to portage

2025-11-12

dkimpy-milter - 1.2.3
Ebuild name:

dev-python/dkimpy-milter-1.2.3

Description

Domain Keys Identified Mail (DKIM) signing/verifying milter for Post

Added to portage

2025-11-12

dns-lexicon - 3.23.0
Ebuild name:

dev-python/dns-lexicon-3.23.0

Description

Manipulate DNS records on various DNS providers in a standardized/agn

Added to portage

2025-11-12

duplicity - 3.0.6-r1
Ebuild name:

app-backup/duplicity-3.0.6-r1

Description

Secure backup system using gnupg to encrypt data

Added to portage

2025-11-12

eisl - 5.57
Ebuild name:

dev-lang/eisl-5.57

Description

Interpreter and compiler compatible with the ISLisp standard

Added to portage

2025-11-12

eselect-vdr - 0.0.4-r1
Ebuild name:

app-eselect/eselect-vdr-0.0.4-r1

Description

Manages the VDR plugins

Added to portage

2025-11-12

faker - 38.0.0
Ebuild name:

dev-python/faker-38.0.0

Description

A Python package that generates fake data for you

Added to portage

2025-11-12

firefox - 140.5.0
Ebuild name:

www-client/firefox-140.5.0

Description

Firefox Web Browser

Added to portage

2025-11-12

firefox - 145.0
Ebuild name:

www-client/firefox-145.0

Description

Firefox Web Browser

Added to portage

2025-11-12

firefox-bin - 140.5.0
Ebuild name:

www-client/firefox-bin-140.5.0

Description

Firefox Web Browser

Added to portage

2025-11-12

fish - 4.2.0
Ebuild name:

app-shells/fish-4.2.0

Description

Friendly Interactive SHell

Added to portage

2025-11-12

fx - 39.2.0
Ebuild name:

app-misc/fx-39.2.0

Description

Terminal JSON viewer & processor

Added to portage

2025-11-12

gcc - 15.2.1_p20251108-r1
Ebuild name:

sys-devel/gcc-15.2.1_p20251108-r1

Description

The GNU Compiler Collection

Added to portage

2025-11-12

gcc - 16.0.0_p20251109-r1
Ebuild name:

sys-devel/gcc-16.0.0_p20251109-r1

Description

The GNU Compiler Collection

Added to portage

2025-11-12

glycin-loaders - 2.0.7
Ebuild name:

media-libs/glycin-loaders-2.0.7

Description

Loaders for glycin clients (glycin crate or libglycin)

Added to portage

2025-11-12

gnustep-make - 2.9.3-r2
Ebuild name:

gnustep-base/gnustep-make-2.9.3-r2

Description

GNUstep Makefile Package

Added to portage

2025-11-12

go-ethereum - 1.16.7
Ebuild name:

net-p2p/go-ethereum-1.16.7

Description

Official golang implementation of the Ethereum protocol

Added to portage

2025-11-12

grafana-bin - 12.2.1
Ebuild name:

www-apps/grafana-bin-12.2.1

Description

Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & Open

Added to portage

2025-11-12

harfbuzz - 12.2.0
Ebuild name:

media-libs/harfbuzz-12.2.0

Description

An OpenType text shaping engine

Added to portage

2025-11-12

huggingface_hub - 0.34.6
Ebuild name:

sci-ml/huggingface_hub-0.34.6

Description

a client library to interact with the Hugging Face Hub

Added to portage

2025-11-12

huggingface_hub - 0.35.3
Ebuild name:

sci-ml/huggingface_hub-0.35.3

Description

a client library to interact with the Hugging Face Hub

Added to portage

2025-11-12

i2pd - 2.58.0
Ebuild name:

net-vpn/i2pd-2.58.0

Description

A C++ daemon for accessing the I2P anonymous network

Added to portage

2025-11-12

intel-microcode - 20251111_p20251112
Ebuild name:

sys-firmware/intel-microcode-20251111_p20251112

Description

Intel IA32/IA64 microcode update data

Added to portage

2025-11-12

libfilezilla - 0.52.0
Ebuild name:

dev-libs/libfilezilla-0.52.0

Description

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

Added to portage

2025-11-12

libtirpc - 1.3.7-r2
Ebuild name:

net-libs/libtirpc-1.3.7-r2

Description

Transport Independent RPC library (SunRPC replacement)

Added to portage

2025-11-12

limine - 10.3.0
Ebuild name:

sys-boot/limine-10.3.0

Description

Limine is a modern, advanced, and portable BIOS/UEFI multiprotocol bootloade

Added to portage

2025-11-12

liquidctl - 1.15.0
Ebuild name:

app-misc/liquidctl-1.15.0

Description

Cross-platform tool and drivers for liquid coolers and other devices

Added to portage

2025-11-12

live - 2025.11.06
Ebuild name:

media-plugins/live-2025.11.06

Description

Libraries for standards-based RTP/RTCP/RTSP multimedia streaming

Added to portage

2025-11-12

manifold - 3.2.1
Ebuild name:

sci-mathematics/manifold-3.2.1

Description

Geometry library for topological robustness

Added to portage

2025-11-12

mariadb - 11.8.3-r2
Ebuild name:

dev-db/mariadb-11.8.3-r2

Description

An enhanced, drop-in replacement for MySQL

Added to portage

2025-11-12

mariadb - 11.8.3-r3
Ebuild name:

dev-db/mariadb-11.8.3-r3

Description

An enhanced, drop-in replacement for MySQL

Added to portage

2025-11-12

mkvtoolnix - 96.0
Ebuild name:

media-video/mkvtoolnix-96.0

Description

Tools to create, alter, and inspect Matroska files

Added to portage

2025-11-12

mongodb-compass-bin - 1.48.1
Ebuild name:

dev-db/mongodb-compass-bin-1.48.1

Description

GUI for MongoDB

Added to portage

2025-11-12

moor - 2.8.2
Ebuild name:

sys-apps/moor-2.8.2

Description

Pager designed to do the right thing without any configuration

Added to portage

2025-11-12

musl - 1.2.5-r6
Ebuild name:

sys-libs/musl-1.2.5-r6

Description

Light, fast and, simple C library focused on standards-conformance and safet

Added to portage

2025-11-12

nspr - 4.38.2
Ebuild name:

dev-libs/nspr-4.38.2

Description

Netscape Portable Runtime

Added to portage

2025-11-12

openpgp-keys-gnustep - 20251025
Ebuild name:

sec-keys/openpgp-keys-gnustep-20251025

Description

OpenPGP keys used by the GNUstep project

Added to portage

2025-11-12

pax-utils - 1.3.9
Ebuild name:

app-misc/pax-utils-1.3.9

Description

ELF utils that can check files for security relevant properties

Added to portage

2025-11-12

pch-session - 47.1-r1
Ebuild name:

gnome-extra/pch-session-47.1-r1

Description

Unofficial gnome based session with different default settings and

Added to portage

2025-11-12

pch-session - 48.0-r1
Ebuild name:

gnome-extra/pch-session-48.0-r1

Description

Unofficial gnome based session with different default settings and

Added to portage

2025-11-12

powerdevil - 6.4.5-r1
Ebuild name:

kde-plasma/powerdevil-6.4.5-r1

Description

Power management for KDE Plasma Shell

Added to portage

2025-11-12

powerdevil - 6.5.2-r1
Ebuild name:

kde-plasma/powerdevil-6.5.2-r1

Description

Power management for KDE Plasma Shell

Added to portage

2025-11-12

pycairo - 1.29.0
Ebuild name:

dev-python/pycairo-1.29.0

Description

Python bindings for the cairo library

Added to portage

2025-11-12

pymdown-extensions - 10.17.1
Ebuild name:

dev-python/pymdown-extensions-10.17.1

Description

Extensions for Python Markdown

Added to portage

2025-11-12

pymilter - 1.0.7_pre20251111
Ebuild name:

dev-python/pymilter-1.0.7_pre20251111

Description

module to enable python scripts to attach to Sendmail's libmi

Added to portage

2025-11-12

pymilter - 9999
Ebuild name:

dev-python/pymilter-9999

Description

module to enable python scripts to attach to Sendmail's libmilter API

Added to portage

2025-11-12

pymongo - 4.15.4
Ebuild name:

dev-python/pymongo-4.15.4

Description

Python driver for MongoDB

Added to portage

2025-11-12

rsyslog - 8.2508.0-r1
Ebuild name:

app-admin/rsyslog-8.2508.0-r1

Description

An enhanced multi-threaded syslogd with database support and more

Added to portage

2025-11-12

rsyslog - 8.2510.0-r1
Ebuild name:

app-admin/rsyslog-8.2510.0-r1

Description

An enhanced multi-threaded syslogd with database support and more

Added to portage

2025-11-12

s3backer - 2.1.6
Ebuild name:

net-fs/s3backer-2.1.6

Description

A filesystem that contains a single file backed by Amazon S3

Added to portage

2025-11-12

sccache - 0.12.0
Ebuild name:

dev-util/sccache-0.12.0

Description

ccache/distcc like tool with support for rust and cloud storage

Added to portage

2025-11-12

scdoc - 1.11.4
Ebuild name:

app-text/scdoc-1.11.4

Description

Standalone tool for generating man pages with a simple syntax

Added to portage

2025-11-12

simdjson - 4.2.2
Ebuild name:

dev-libs/simdjson-4.2.2

Description

SIMD accelerated C++ JSON library

Added to portage

2025-11-12

sogo - 5.12.4
Ebuild name:

gnustep-apps/sogo-5.12.4

Description

Groupware server built around OpenGroupware.org and the SOPE application s

Added to portage

2025-11-12

sope - 5.12.4
Ebuild name:

gnustep-libs/sope-5.12.4

Description

A set of frameworks forming a complete Web application server environment

Added to portage

2025-11-12

stgit - 2.5.5
Ebuild name:

dev-vcs/stgit-2.5.5

Description

Stack-based patch management for Git

Added to portage

2025-11-12

svxlink - 25.05.1_p20250929-r1
Ebuild name:

media-radio/svxlink-25.05.1_p20250929-r1

Description

Multi Purpose Voice Services System, including Qtel for Ec

Added to portage

2025-11-12

symengine - 0.14.1-r2
Ebuild name:

dev-python/symengine-0.14.1-r2

Description

Python wrappers to the symengine C++ library

Added to portage

2025-11-12

sympy - 1.14.0-r2
Ebuild name:

dev-python/sympy-1.14.0-r2

Description

Computer Algebra System in pure Python

Added to portage

2025-11-12

systempreferences - 1.2.1
Ebuild name:

gnustep-apps/systempreferences-1.2.1

Description

System Preferences is a clone of Apple OS X' System Preference

Added to portage

2025-11-12

textedit - 5.0
Ebuild name:

gnustep-apps/textedit-5.0

Description

A text editor with font, color, and style capabilities for GNUstep

Added to portage

2025-11-12

tor - 0.4.8.20
Ebuild name:

net-vpn/tor-0.4.8.20

Description

Anonymizing overlay network for TCP

Added to portage

2025-11-12

tpm2-pkcs11 - 1.9.1
Ebuild name:

app-crypt/tpm2-pkcs11-1.9.1

Description

A PKCS11 interface for TPM2 hardware

Added to portage

2025-11-12

tpm2-tools - 5.7
Ebuild name:

app-crypt/tpm2-tools-5.7

Description

Tools for the TPM 2.0 TSS

Added to portage

2025-11-12

tuned - 2.25.1-r1
Ebuild name:

sys-apps/tuned-2.25.1-r1

Description

Daemon for monitoring and adaptive tuning of system devices

Added to portage

2025-11-12

tuned - 2.26.0-r1
Ebuild name:

sys-apps/tuned-2.26.0-r1

Description

Daemon for monitoring and adaptive tuning of system devices

Added to portage

2025-11-12

vdr-dvdswitch - 0.2.4
Ebuild name:

media-plugins/vdr-dvdswitch-0.2.4

Description

VDR Plugin to play dvds and dvd file structures

Added to portage

2025-11-12

vdr-fritzbox - 1.5.6
Ebuild name:

media-plugins/vdr-fritzbox-1.5.6

Description

VDR Plugin Inform about incoming phone-calls and use the fritz pho

Added to portage

2025-11-12

vdr-graphlcd - 1.0.8
Ebuild name:

media-plugins/vdr-graphlcd-1.0.8

Description

VDR Plugin support output on Graphical LCD

Added to portage

2025-11-12

vdr-ttxtsubs - 0.3.0_p20160207
Ebuild name:

media-plugins/vdr-ttxtsubs-0.3.0_p20160207

Description

VDR Plugin displaying, recording and replaying teletext

Added to portage

2025-11-12

vdradmin-am - 3.6.14
Ebuild name:

www-misc/vdradmin-am-3.6.14

Description

WWW Admin for the Video Disk Recorder

Added to portage

2025-11-12

vdrsymbols-ttf - 20100612-r1
Ebuild name:

media-fonts/vdrsymbols-ttf-20100612-r1

Description

Font that contains symbols needed for VDR

Added to portage

2025-11-12

wdm - 1.28-r10
Ebuild name:

x11-misc/wdm-1.28-r10

Description

WINGs Display Manager

Added to portage

2025-11-12

windowmaker - 0.96.0-r1
Ebuild name:

x11-wm/windowmaker-0.96.0-r1

Description

The fast and light GNUstep window manager

Added to portage

2025-11-12

wmweather+ - 2.18-r2
Ebuild name:

x11-plugins/wmweather+-2.18-r2

Description

A dockapp for displaying data collected from METAR, AVN, ETA, and MR

Added to portage

2025-11-12

wsproto - 1.3.0
Ebuild name:

dev-python/wsproto-1.3.0

Description

WebSockets state-machine based protocol implementation

Added to portage

2025-11-12

xxd - 2025.08.24-r1
Ebuild name:

dev-util/xxd-2025.08.24-r1

Description

Standalone version of Vim's xxd

Added to portage

2025-11-12

yt-dlp - 2025.11.12
Ebuild name:

net-misc/yt-dlp-2025.11.12

Description

youtube-dl fork with additional features and fixes

Added to portage

2025-11-12

rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2020 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 44.2 ms