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:

67319

userrating:

average rating: 1.2 (8 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: 2.4 (16 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
2024-05-08
astroid - 3.2.0
Ebuild name:

dev-python/astroid-3.2.0

Description

Abstract Syntax Tree for logilab packages

Added to portage

2024-05-08

awscli - 1.32.100
Ebuild name:

app-admin/awscli-1.32.100

Description

Universal Command Line Environment for AWS

Added to portage

2024-05-08

bigdecimal - 3.1.8
Ebuild name:

dev-ruby/bigdecimal-3.1.8

Description

Arbitrary-precision decimal floating-point number library for Ruby

Added to portage

2024-05-08

bitstring - 4.2.1-r1
Ebuild name:

dev-python/bitstring-4.2.1-r1

Description

A pure Python module for creation and analysis of binary data

Added to portage

2024-05-08

blobwars - 2.00-r2
Ebuild name:

games-arcade/blobwars-2.00-r2

Description

Platform game about a blob and his quest to rescue MIAs from an alien

Added to portage

2024-05-08

boto3 - 1.34.100
Ebuild name:

dev-python/boto3-1.34.100

Description

The AWS SDK for Python

Added to portage

2024-05-08

botocore - 1.34.100
Ebuild name:

dev-python/botocore-1.34.100

Description

Low-level, data-driven core of boto 3

Added to portage

2024-05-08

caffe2 - 2.3.0-r2
Ebuild name:

sci-libs/caffe2-2.3.0-r2

Description

A deep learning framework

Added to portage

2024-05-08

castxml - 0.6.6
Ebuild name:

dev-libs/castxml-0.6.6

Description

C-family abstract syntax tree XML output tool

Added to portage

2024-05-08

cgit - 9999
Ebuild name:

www-apps/cgit-9999

Description

a fast web-interface for git repositories

Added to portage

2024-05-08

cgit - 9999-r1
Ebuild name:

www-apps/cgit-9999-r1

Description

a fast web-interface for git repositories

Added to portage

2024-05-08

clog - 2023.11.04
Ebuild name:

dev-libs/clog-2023.11.04

Description

CPU INFOrmation library

Added to portage

2024-05-08

cmake - 3.28.5
Ebuild name:

dev-build/cmake-3.28.5

Description

Cross platform Make

Added to portage

2024-05-08

cmake - 3.29.3
Ebuild name:

dev-build/cmake-3.29.3

Description

Cross platform Make

Added to portage

2024-05-08

conway-polynomials - 0.10
Ebuild name:

dev-python/conway-polynomials-0.10

Description

Python interface to Frank Lübeck's Conway polynomial database

Added to portage

2024-05-08

crossdev - 20240507
Ebuild name:

sys-devel/crossdev-20240507

Description

Gentoo Cross-toolchain generator

Added to portage

2024-05-08

django - 4.2.13
Ebuild name:

dev-python/django-4.2.13

Description

High-level Python web framework

Added to portage

2024-05-08

django - 5.0.6
Ebuild name:

dev-python/django-5.0.6

Description

High-level Python web framework

Added to portage

2024-05-08

dropbox - 198.4.7615
Ebuild name:

net-misc/dropbox-198.4.7615

Description

Dropbox daemon (pretends to be GUI-less)

Added to portage

2024-05-08

eclean-kernel - 2.99.8
Ebuild name:

app-admin/eclean-kernel-2.99.8

Description

Remove outdated built kernels

Added to portage

2024-05-08

evdev - 1.7.1
Ebuild name:

dev-python/evdev-1.7.1

Description

Python library for evdev bindings

Added to portage

2024-05-08

fakeredis - 2.23.0
Ebuild name:

dev-python/fakeredis-2.23.0

Description

Fake implementation of redis API for testing purposes

Added to portage

2024-05-08

fotocx - 24.30
Ebuild name:

media-gfx/fotocx-24.30

Description

Program for improving image files made with a digital camera

Added to portage

2024-05-08

google-api-python-client - 2.128.0
Ebuild name:

dev-python/google-api-python-client-2.128.0

Description

Google API Client for Python

Added to portage

2024-05-08

incus - 6.1
Ebuild name:

app-containers/incus-6.1

Description

Modern, secure and powerful system container and virtual machine manager

Added to portage

2024-05-08

libreoffice - 24.2.3.2
Ebuild name:

app-office/libreoffice-24.2.3.2

Description

A full office productivity suite

Added to portage

2024-05-08

libreoffice - 7.6.7.2
Ebuild name:

app-office/libreoffice-7.6.7.2

Description

A full office productivity suite

Added to portage

2024-05-08

libreoffice-l10n - 24.2.3.2
Ebuild name:

app-office/libreoffice-l10n-24.2.3.2

Description

Translations for the Libreoffice suite

Added to portage

2024-05-08

lmdb - 0.9.32
Ebuild name:

dev-db/lmdb-0.9.32

Description

An ultra-fast, ultra-compact key-value embedded data store

Added to portage

2024-05-08

lxc - 6.0.0-r2
Ebuild name:

app-containers/lxc-6.0.0-r2

Description

A userspace interface for the Linux kernel containment features

Added to portage

2024-05-08

mgorny-dev-scripts - 51
Ebuild name:

app-portage/mgorny-dev-scripts-51

Description

Handy scripts for ebuild development and more

Added to portage

2024-05-08

mgorny-dev-scripts - 52
Ebuild name:

app-portage/mgorny-dev-scripts-52

Description

Handy scripts for ebuild development and more

Added to portage

2024-05-08

mime-types-data - 3.2024.0507
Ebuild name:

dev-ruby/mime-types-data-3.2024.0507

Description

Registry for information about MIME media type definitions

Added to portage

2024-05-08

multi_xml - 0.7.1
Ebuild name:

dev-ruby/multi_xml-0.7.1

Description

A generic swappable back-end for XML parsing

Added to portage

2024-05-08

multipart-post - 2.4.1
Ebuild name:

dev-ruby/multipart-post-2.4.1

Description

Adds a streamy multipart form post capability to Net

Added to portage

2024-05-08

nose2 - 0.14.2
Ebuild name:

dev-python/nose2-0.14.2

Description

Unittest with plugins

Added to portage

2024-05-08

powershell - 0.3_pre20220805
Ebuild name:

app-emacs/powershell-0.3_pre20220805

Description

GNU Emacs mode for editing and running PowerShell code

Added to portage

2024-05-08

projectile - 2.8.0-r1
Ebuild name:

app-emacs/projectile-2.8.0-r1

Description

A project interaction library for Emacs

Added to portage

2024-05-08

proofgeneral - 4.5
Ebuild name:

app-emacs/proofgeneral-4.5

Description

A generic interface for proof assistants

Added to portage

2024-05-08

protbuf - 1.7-r1
Ebuild name:

app-emacs/protbuf-1.7-r1

Description

Protect Emacs buffers from accidental killing

Added to portage

2024-05-08

pymongo - 4.7.2
Ebuild name:

dev-python/pymongo-4.7.2

Description

Python driver for MongoDB

Added to portage

2024-05-08

qbs - 2.3.1
Ebuild name:

dev-util/qbs-2.3.1

Description

Modern build tool for software projects

Added to portage

2024-05-08

rubber - 1.6.6
Ebuild name:

dev-tex/rubber-1.6.6

Description

A LaTeX wrapper for automatically building documents

Added to portage

2024-05-08

sqlglot - 23.14.0
Ebuild name:

dev-python/sqlglot-23.14.0

Description

An easily customizable SQL parser and transpiler

Added to portage

2024-05-08

tenacity - 8.3.0
Ebuild name:

dev-python/tenacity-8.3.0

Description

General-purpose retrying library

Added to portage

2024-05-08

thriftpy2 - 0.5.0
Ebuild name:

dev-python/thriftpy2-0.5.0

Description

Pure python approach of Apache Thrift

Added to portage

2024-05-08

tpm2-tss - 4.1.1
Ebuild name:

app-crypt/tpm2-tss-4.1.1

Description

TCG Trusted Platform Module 2.0 Software Stack

Added to portage

2024-05-08

uv - 0.1.41
Ebuild name:

dev-python/uv-0.1.41

Description

A Python package installer and resolver, written in Rust

Added to portage

2024-05-08

wesnoth - 1.18.0
Ebuild name:

games-strategy/wesnoth-1.18.0

Description

Battle for Wesnoth - A fantasy turn-based strategy game

Added to portage

2024-05-08

wpa_supplicant - 2.10-r5
Ebuild name:

net-wireless/wpa_supplicant-2.10-r5

Description

IEEE 802.1X/WPA supplicant for secure wireless transfers

Added to portage

2024-05-08

2024-05-07
aws-sam-translator - 1.88.0
Ebuild name:

dev-python/aws-sam-translator-1.88.0

Description

A library that transform SAM templates into AWS CloudFormation

Added to portage

2024-05-07

awscli - 1.32.99
Ebuild name:

app-admin/awscli-1.32.99

Description

Universal Command Line Environment for AWS

Added to portage

2024-05-07

biosdevname - 0.7.3-r1
Ebuild name:

sys-apps/biosdevname-0.7.3-r1

Description

Sets BIOS-given device names instead of kernel eth* names

Added to portage

2024-05-07

blinker - 1.8.2
Ebuild name:

dev-python/blinker-1.8.2

Description

Fast, simple object-to-object and broadcast signaling

Added to portage

2024-05-07

boto3 - 1.34.99
Ebuild name:

dev-python/boto3-1.34.99

Description

The AWS SDK for Python

Added to portage

2024-05-07

botocore - 1.34.99
Ebuild name:

dev-python/botocore-1.34.99

Description

Low-level, data-driven core of boto 3

Added to portage

2024-05-07

branca - 0.7.2
Ebuild name:

sci-libs/branca-0.7.2

Description

spinoff from folium, host the non-map-specific features

Added to portage

2024-05-07

btrfs - 14.1
Ebuild name:

dev-python/btrfs-14.1

Description

Python module to inspect btrfs filesystems

Added to portage

2024-05-07

cantata - 2.5.0-r2
Ebuild name:

media-sound/cantata-2.5.0-r2

Description

Featureful and configurable Qt client for the music player daemon (MPD

Added to portage

2024-05-07

cartridges - 2.8.4
Ebuild name:

games-util/cartridges-2.8.4

Description

Simple game launcher written in Python using GTK4 and Libadwaita

Added to portage

2024-05-07

clojure - 1.11.3
Ebuild name:

dev-lang/clojure-1.11.3

Description

General-purpose programming language with an emphasis on functional program

Added to portage

2024-05-07

collectd - 5.12.0-r10
Ebuild name:

app-metrics/collectd-5.12.0-r10

Description

Collects system statistics and provides mechanisms to store the val

Added to portage

2024-05-07

cryptography - 42.0.7
Ebuild name:

dev-python/cryptography-42.0.7

Description

Library providing cryptographic recipes and primitives

Added to portage

2024-05-07

discord - 0.0.53
Ebuild name:

net-im/discord-0.0.53

Description

All-in-one voice and text chat for gamers

Added to portage

2024-05-07

distrobox - 1.7.2.1
Ebuild name:

app-containers/distrobox-1.7.2.1

Description

Use any Linux distribution inside your terminal (powered by docker

Added to portage

2024-05-07

elfix - 0.9.5-r1
Ebuild name:

sys-apps/elfix-0.9.5-r1

Description

Suite of tools to work with ELF objects on Hardened Gentoo

Added to portage

2024-05-07

framework-laptop-kmod - 0_pre20240506
Ebuild name:

app-laptop/framework-laptop-kmod-0_pre20240506

Description

Kernel module to expose more Framework Laptop stuff

Added to portage

2024-05-07

furo - 2024.5.6
Ebuild name:

dev-python/furo-2024.5.6

Description

Clean customisable Sphinx documentation theme

Added to portage

2024-05-07

gcc - 14.1.0
Ebuild name:

sys-devel/gcc-14.1.0

Description

The GNU Compiler Collection

Added to portage

2024-05-07

gcc - 14.1.9999
Ebuild name:

sys-devel/gcc-14.1.9999

Description

The GNU Compiler Collection

Added to portage

2024-05-07

graphene - 1.10.8-r1
Ebuild name:

media-libs/graphene-1.10.8-r1

Description

A thin layer of types for graphic libraries

Added to portage

2024-05-07

hypothesis - 6.100.5
Ebuild name:

dev-python/hypothesis-6.100.5

Description

A library for property based testing

Added to portage

2024-05-07

i18n - 1.14.5
Ebuild name:

dev-ruby/i18n-1.14.5

Description

Add Internationalization support to your Ruby application

Added to portage

2024-05-07

installkernel - 38
Ebuild name:

sys-kernel/installkernel-38

Description

Gentoo fork of installkernel script from debianutils

Added to portage

2024-05-07

jupyterlab - 4.2.0
Ebuild name:

dev-python/jupyterlab-4.2.0

Description

JupyterLab computational environment

Added to portage

2024-05-07

keepassxc - 2.7.8
Ebuild name:

app-admin/keepassxc-2.7.8

Description

KeePassXC - KeePass Cross-platform Community Edition

Added to portage

2024-05-07

libmypaint - 1.6.1-r3
Ebuild name:

media-libs/libmypaint-1.6.1-r3

Description

Library for making brushstrokes

Added to portage

2024-05-07

linux-docs - 6.8.9
Ebuild name:

sys-kernel/linux-docs-6.8.9

Description

Developer documentation generated from the Linux kernel

Added to portage

2024-05-07

mingw64-runtime - 11.0.1
Ebuild name:

dev-util/mingw64-runtime-11.0.1

Description

Free Win64 runtime and import library definitions

Added to portage

2024-05-07

mingw64-toolchain - 11.0.1
Ebuild name:

dev-util/mingw64-toolchain-11.0.1

Description

All-in-one mingw64 toolchain intended for building Wine without c

Added to portage

2024-05-07

mod_perl - 2.0.13-r1
Ebuild name:

www-apache/mod_perl-2.0.13-r1

Description

An embedded Perl interpreter for Apache2

Added to portage

2024-05-07

nbsphinx - 0.9.4
Ebuild name:

dev-python/nbsphinx-0.9.4

Description

Jupyter Notebook Tools for Sphinx

Added to portage

2024-05-07

nvidia-vaapi-driver - 0.0.12
Ebuild name:

media-libs/nvidia-vaapi-driver-0.0.12

Description

A VA-API implemention using NVIDIA's NVDEC

Added to portage

2024-05-07

openpaperwork-core - 2.2.2
Ebuild name:

app-text/openpaperwork-core-2.2.2

Description

Core part of Paperwork (plugin management)

Added to portage

2024-05-07

openpaperwork-gtk - 2.2.2
Ebuild name:

app-text/openpaperwork-gtk-2.2.2

Description

Paperwork plugins

Added to portage

2024-05-07

paper-clip - 5.5
Ebuild name:

app-text/paper-clip-5.5

Description

Edit the title, author, keywords and more details of PDF documents

Added to portage

2024-05-07

paperwork - 2.2.2
Ebuild name:

app-text/paperwork-2.2.2

Description

a personal document manager for scanned documents (and PDFs)

Added to portage

2024-05-07

paperwork-backend - 2.2.2
Ebuild name:

app-text/paperwork-backend-2.2.2

Description

Backend part of Paperwork (Python API, no UI)

Added to portage

2024-05-07

partd - 1.4.2
Ebuild name:

dev-python/partd-1.4.2

Description

Appendable key-value storage

Added to portage

2024-05-07

perl - 5.38.2-r3
Ebuild name:

dev-lang/perl-5.38.2-r3

Description

Larry Wall's Practical Extraction and Report Language

Added to portage

2024-05-07

perl-threads - 2.360.0-r1
Ebuild name:

virtual/perl-threads-2.360.0-r1

Description

Virtual for

Added to portage

2024-05-07

pf-sources - 6.8_p8
Ebuild name:

sys-kernel/pf-sources-6.8_p8

Description

Added to portage

2024-05-07

psgml - 1.4.1
Ebuild name:

app-emacs/psgml-1.4.1

Description

A GNU Emacs Major Mode for editing SGML and XML coded documents

Added to portage

2024-05-07

puppet-mode - 0.4
Ebuild name:

app-emacs/puppet-mode-0.4

Description

Emacs major mode for editing Puppet manifests

Added to portage

2024-05-07

qdbm - 1.8.78-r5
Ebuild name:

dev-db/qdbm-1.8.78-r5

Description

Quick Database Manager

Added to portage

2024-05-07

qt-creator - 13.0.1
Ebuild name:

dev-qt/qt-creator-13.0.1

Description

Lightweight IDE for C++/QML development centering around Qt

Added to portage

2024-05-07

ruff - 0.4.3
Ebuild name:

dev-util/ruff-0.4.3

Description

An extremely fast Python linter, written in Rust

Added to portage

2024-05-07

setuptools-scm - 8.1.0
Ebuild name:

dev-python/setuptools-scm-8.1.0

Description

Manage versions by scm tags via setuptools

Added to portage

2024-05-07

snortalog - 2.4.3-r2
Ebuild name:

net-analyzer/snortalog-2.4.3-r2

Description

A powerful perl script that summarizes snort logs

Added to portage

2024-05-07

syd - 3.18.7
Ebuild name:

sys-apps/syd-3.18.7

Description

seccomp and landlock based application sandbox with support for namespaces

Added to portage

2024-05-07

truststore - 0.9.1
Ebuild name:

dev-python/truststore-0.9.1

Description

Verify certificates using native system trust stores

Added to portage

2024-05-07

weasyprint - 62.1
Ebuild name:

dev-python/weasyprint-62.1

Description

Visual rendering engine for HTML and CSS that can export to PDF

Added to portage

2024-05-07

xfsprogs - 6.7.0-r1
Ebuild name:

sys-fs/xfsprogs-6.7.0-r1

Description

XFS filesystem utilities

Added to portage

2024-05-07

xyzservices - 2024.4.0
Ebuild name:

sci-geosciences/xyzservices-2024.4.0

Description

Source of XYZ tiles providers

Added to portage

2024-05-07

yatex - 1.83
Ebuild name:

app-emacs/yatex-1.83

Description

Yet Another TeX mode for Emacs

Added to portage

2024-05-07

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: 74.3 ms