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:

59143

userrating:

average rating: 1.5 (4 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
2021-11-28
aiofiles - 0.8.0
Ebuild name:

dev-python/aiofiles-0.8.0

Description

File support for asyncio

Added to portage

2021-11-28

batctl - 2021.4
Ebuild name:

net-misc/batctl-2021.4

Description

BATMAN advanced control and management tool

Added to portage

2021-11-28

bc-gh - 5.2.1
Ebuild name:

sci-calculators/bc-gh-5.2.1

Description

Implementation of POSIX bc with GNU extensions

Added to portage

2021-11-28

confuse - 1.7.0
Ebuild name:

dev-python/confuse-1.7.0

Description

Confuse is a configuration library for Python that uses YAML

Added to portage

2021-11-28

gallery-dl - 1.19.3
Ebuild name:

net-misc/gallery-dl-1.19.3

Description

Download image galleries and collections from several image hosting site

Added to portage

2021-11-28

gretl - 2021d
Ebuild name:

sci-mathematics/gretl-2021d

Description

Regression, econometrics and time-series library

Added to portage

2021-11-28

gtk-engines-murrine - 0.98.2-r3
Ebuild name:

x11-themes/gtk-engines-murrine-0.98.2-r3

Description

Murrine GTK+2 Cairo Engine

Added to portage

2021-11-28

icedtea-bin - 3.16.0-r1
Ebuild name:

dev-java/icedtea-bin-3.16.0-r1

Description

A Gentoo-made binary build of the IcedTea JDK

Added to portage

2021-11-28

idris2 - 0.5.1_p20211112
Ebuild name:

dev-lang/idris2-0.5.1_p20211112

Description

Purely functional programming language with first class types

Added to portage

2021-11-28

libtpms - 0.9.1
Ebuild name:

dev-libs/libtpms-0.9.1

Description

Library providing software emultion of a TPM

Added to portage

2021-11-28

mediafile - 0.9.0
Ebuild name:

dev-python/mediafile-0.9.0

Description

Read and write audio files' tags in Python

Added to portage

2021-11-28

murrine-themes - 0.98.11
Ebuild name:

x11-themes/murrine-themes-0.98.11

Description

Themes for the Murrine GTK+2 Cairo Engine

Added to portage

2021-11-28

netpbm - 10.86.26
Ebuild name:

media-libs/netpbm-10.86.26

Description

A set of utilities for converting to/from the netpbm (and related) forma

Added to portage

2021-11-28

opencpn-plugin-findit - 1.1007
Ebuild name:

sci-geosciences/opencpn-plugin-findit-1.1007

Description

FindIt Plugin for OpenCPN

Added to portage

2021-11-28

opencpn-plugin-iacfleet - 0.21.1
Ebuild name:

sci-geosciences/opencpn-plugin-iacfleet-0.21.1

Description

IAC Fleetcode Plugin for OpenCPN

Added to portage

2021-11-28

opencpn-plugin-launcher - 1.3
Ebuild name:

sci-geosciences/opencpn-plugin-launcher-1.3

Description

Launcher Plugin for OpenCPN

Added to portage

2021-11-28

opendnssec - 2.1.10
Ebuild name:

net-dns/opendnssec-2.1.10

Description

An open-source turn-key solution for DNSSEC

Added to portage

2021-11-28

openjdk-bin - 11.0.13_p8-r1
Ebuild name:

dev-java/openjdk-bin-11.0.13_p8-r1

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2021-11-28

openjdk-bin - 17.0.1_p12-r1
Ebuild name:

dev-java/openjdk-bin-17.0.1_p12-r1

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2021-11-28

openjdk-bin - 8.312_p07-r1
Ebuild name:

dev-java/openjdk-bin-8.312_p07-r1

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2021-11-28

openjdk-jre-bin - 11.0.13_p8-r1
Ebuild name:

dev-java/openjdk-jre-bin-11.0.13_p8-r1

Description

Prebuilt Java JRE binaries provided by AdoptOpenJDK

Added to portage

2021-11-28

openjdk-jre-bin - 8.312_p07-r1
Ebuild name:

dev-java/openjdk-jre-bin-8.312_p07-r1

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2021-11-28

phonenumbers - 8.12.38
Ebuild name:

dev-python/phonenumbers-8.12.38

Description

Python port of Google's libphonenumber

Added to portage

2021-11-28

rxvt-unicode - 9.30
Ebuild name:

x11-terms/rxvt-unicode-9.30

Description

rxvt clone with xft and unicode support

Added to portage

2021-11-28

shotcut - 21.10.31
Ebuild name:

media-video/shotcut-21.10.31

Description

A free, open source, cross-platform video editor

Added to portage

2021-11-28

solaar - 1.0.7
Ebuild name:

app-misc/solaar-1.0.7

Description

Linux Device Manager for Logitech Unifying Receivers and Paired Devices

Added to portage

2021-11-28

sphinx - 4.3.1
Ebuild name:

dev-python/sphinx-4.3.1

Description

Python documentation generator

Added to portage

2021-11-28

spin - 6.5.2
Ebuild name:

sci-mathematics/spin-6.5.2

Description

An efficient logic-model checker for the verification of multi-threaded

Added to portage

2021-11-28

stone-soup - 0.28.0_pre20211128
Ebuild name:

games-roguelike/stone-soup-0.28.0_pre20211128

Description

Role-playing roguelike game of exploration and treasu

Added to portage

2021-11-28

tuxedo-control-center-bin - 1.1.0-r2
Ebuild name:

app-laptop/tuxedo-control-center-bin-1.1.0-r2

Description

Tool to control performance, energy, fan and comfort

Added to portage

2021-11-28

2021-11-27
PPIx-QuoteLike - 0.19.0
Ebuild name:

dev-perl/PPIx-QuoteLike-0.19.0

Description

Parse Perl string literals and string-literal-like things

Added to portage

2021-11-27

PPIx-Regexp - 0.81.0
Ebuild name:

dev-perl/PPIx-Regexp-0.81.0

Description

Represent a regular expression of some sort

Added to portage

2021-11-27

Proc-Background - 1.300.0
Ebuild name:

dev-perl/Proc-Background-1.300.0

Description

Generic interface to background process management

Added to portage

2021-11-27

Quota - 1.8.2
Ebuild name:

dev-perl/Quota-1.8.2

Description

Perl interface to file system quotas

Added to portage

2021-11-27

aesara - 2.3.1
Ebuild name:

dev-python/aesara-2.3.1

Description

Library for operating on mathematical expressions with multi-dimensional ar

Added to portage

2021-11-27

atmel-firmware - 1.3-r2
Ebuild name:

sys-firmware/atmel-firmware-1.3-r2

Description

Firmware and config for atmel and atmel_cs wlan drivers included

Added to portage

2021-11-27

awscli - 1.22.14
Ebuild name:

app-admin/awscli-1.22.14

Description

Universal Command Line Environment for AWS

Added to portage

2021-11-27

bluez-firmware - 1.2-r1
Ebuild name:

sys-firmware/bluez-firmware-1.2-r1

Description

Firmware for Broadcom BCM203x and STLC2300 Bluetooth chips

Added to portage

2021-11-27

boto3 - 1.20.14
Ebuild name:

dev-python/boto3-1.20.14

Description

The AWS SDK for Python

Added to portage

2021-11-27

botocore - 1.23.14
Ebuild name:

dev-python/botocore-1.23.14

Description

Low-level, data-driven core of boto 3

Added to portage

2021-11-27

bundler-audit - 0.9.0.1
Ebuild name:

dev-ruby/bundler-audit-0.9.0.1

Description

Provides patch-level verification for Bundled apps

Added to portage

2021-11-27

catch - 2.13.7
Ebuild name:

dev-cpp/catch-2.13.7

Description

Modern C++ header-only framework for unit-tests

Added to portage

2021-11-27

ceph - 15.2.15-r2
Ebuild name:

sys-cluster/ceph-15.2.15-r2

Description

Ceph distributed filesystem

Added to portage

2021-11-27

ceph - 16.2.6-r4
Ebuild name:

sys-cluster/ceph-16.2.6-r4

Description

Ceph distributed filesystem

Added to portage

2021-11-27

coinor-csdp - 6.2.0
Ebuild name:

sci-libs/coinor-csdp-6.2.0

Description

COIN-OR C Library for Semi-Definite Programming

Added to portage

2021-11-27

combustion - 1.3.5
Ebuild name:

dev-ruby/combustion-1.3.5

Description

Elegant Rails Engine Testing

Added to portage

2021-11-27

coverage - 6.2
Ebuild name:

dev-python/coverage-6.2

Description

Code coverage measurement for Python

Added to portage

2021-11-27

cygwin-crypt - 1.4-r1
Ebuild name:

sys-libs/cygwin-crypt-1.4-r1

Description

Cygwin Encryption/Decryption utility and library

Added to portage

2021-11-27

dbutils - 2.0.3
Ebuild name:

dev-python/dbutils-2.0.3

Description

Database connections for multi-threaded environments

Added to portage

2021-11-27

dbutils - 3.0.0
Ebuild name:

dev-python/dbutils-3.0.0

Description

Database connections for multi-threaded environments

Added to portage

2021-11-27

fcgiwrap - 1.1.0-r2
Ebuild name:

www-misc/fcgiwrap-1.1.0-r2

Description

Simple FastCGI wrapper for CGI scripts (CGI support for nginx)

Added to portage

2021-11-27

freecell-solver - 6.6.0
Ebuild name:

dev-games/freecell-solver-6.6.0

Description

C library for automatically solving Freecell and some other solitai

Added to portage

2021-11-27

fs-uae - 3.1.62
Ebuild name:

app-emulation/fs-uae-3.1.62

Description

Integrates the most accurate Amiga emulation code available from WinUAE

Added to portage

2021-11-27

fs-uae-launcher - 3.1.63
Ebuild name:

app-emulation/fs-uae-launcher-3.1.63

Description

PyQt5-based launcher for FS-UAE

Added to portage

2021-11-27

fsspec - 2021.11.1
Ebuild name:

dev-python/fsspec-2021.11.1

Description

A specification that python filesystems should adhere to

Added to portage

2021-11-27

harfbuzz - 3.1.2
Ebuild name:

media-libs/harfbuzz-3.1.2

Description

An OpenType text shaping engine

Added to portage

2021-11-27

hplip-plugin - 3.21.10
Ebuild name:

net-print/hplip-plugin-3.21.10

Description

Proprietary plugins and firmware for HPLIP

Added to portage

2021-11-27

hypothesis - 6.27.2
Ebuild name:

dev-python/hypothesis-6.27.2

Description

A library for property based testing

Added to portage

2021-11-27

intel-compute-runtime - 21.47.21710
Ebuild name:

dev-libs/intel-compute-runtime-21.47.21710

Description

Intel Graphics Compute Runtime for oneAPI Level Zero and

Added to portage

2021-11-27

intel-graphics-compiler - 1.0.9389
Ebuild name:

dev-util/intel-graphics-compiler-1.0.9389

Description

LLVM-based OpenCL compiler for OpenCL targetting Intel Ge

Added to portage

2021-11-27

ipw2100-firmware - 1.3-r1
Ebuild name:

sys-firmware/ipw2100-firmware-1.3-r1

Description

Firmware for the Intel PRO/Wireless 2100 3B miniPCI adapter

Added to portage

2021-11-27

ipw2200-firmware - 3.1-r1
Ebuild name:

sys-firmware/ipw2200-firmware-3.1-r1

Description

Firmware for the Intel PRO/Wireless 2200BG/2915ABG miniPCI and

Added to portage

2021-11-27

ipython - 7.30.0
Ebuild name:

dev-python/ipython-7.30.0

Description

Advanced interactive shell for Python

Added to portage

2021-11-27

ivtv-firmware - 20080701-r2
Ebuild name:

sys-firmware/ivtv-firmware-20080701-r2

Description

firmware for Hauppauge PVR-x50 and Conexant 2341x based card

Added to portage

2021-11-27

jupyter_server - 1.12.1
Ebuild name:

dev-python/jupyter_server-1.12.1

Description

Core services, APIs, and REST endpoints to Jupyter web application

Added to portage

2021-11-27

kdeclarative - 5.88.0-r1
Ebuild name:

kde-frameworks/kdeclarative-5.88.0-r1

Description

Framework providing integration of QML and KDE work spaces

Added to portage

2021-11-27

ktexteditor - 5.88.0-r1
Ebuild name:

kde-frameworks/ktexteditor-5.88.0-r1

Description

Framework providing a full text editor component

Added to portage

2021-11-27

libcbor - 0.9.0
Ebuild name:

dev-libs/libcbor-0.9.0

Description

CBOR protocol implementation for C and others

Added to portage

2021-11-27

libunwind - 1.6.0
Ebuild name:

sys-libs/libunwind-1.6.0

Description

Portable and efficient API to determine the call-chain of a program

Added to portage

2021-11-27

lldpd - 1.0.13
Ebuild name:

net-misc/lldpd-1.0.13

Description

Implementation of IEEE 802.1ab (LLDP)

Added to portage

2021-11-27

magic - 8.3.232
Ebuild name:

sci-electronics/magic-8.3.232

Description

The VLSI design CAD tool

Added to portage

2021-11-27

mod_auth_kerb - 5.4-r3
Ebuild name:

www-apache/mod_auth_kerb-5.4-r3

Description

An Apache authentication module using Kerberos

Added to portage

2021-11-27

mod_auth_radius - 1.6.0
Ebuild name:

www-apache/mod_auth_radius-1.6.0

Description

Radius authentication for Apache

Added to portage

2021-11-27

mod_auth_tkt - 2.1.0-r2
Ebuild name:

www-apache/mod_auth_tkt-2.1.0-r2

Description

Apache module for cookie based authentication

Added to portage

2021-11-27

mod_backtrace - 2.01-r2
Ebuild name:

www-apache/mod_backtrace-2.01-r2

Description

Debug segmentation faults in Apache threads

Added to portage

2021-11-27

mod_bw - 0.9.2-r2
Ebuild name:

www-apache/mod_bw-0.9.2-r2

Description

Bandwidth Management Module for Apache2

Added to portage

2021-11-27

mod_dnssd - 0.6-r2
Ebuild name:

www-apache/mod_dnssd-0.6-r2

Description

mod_dnssd is an Apache module which adds Zeroconf support via DNS-SD us

Added to portage

2021-11-27

mod_fcgid - 2.3.9-r2
Ebuild name:

www-apache/mod_fcgid-2.3.9-r2

Description

Binary-compatible alternative to mod_fastcgi with better process mana

Added to portage

2021-11-27

mod_limitipconn - 0.24-r4
Ebuild name:

www-apache/mod_limitipconn-0.24-r4

Description

Limit the number of simultaneous apache connections

Added to portage

2021-11-27

mod_log_rotate - 1.02
Ebuild name:

www-apache/mod_log_rotate-1.02

Description

Log rotation support for mod_log_config based on strftime(3)

Added to portage

2021-11-27

mod_rpaf - 0.8.4
Ebuild name:

www-apache/mod_rpaf-0.8.4

Description

Reverse proxy add forward module

Added to portage

2021-11-27

mod_whatkilledus - 2.01-r1
Ebuild name:

www-apache/mod_whatkilledus-2.01-r1

Description

Debug segmentation faults in Apache threads

Added to portage

2021-11-27

nvidia-cuda-toolkit - 11.5.1
Ebuild name:

dev-util/nvidia-cuda-toolkit-11.5.1

Description

NVIDIA CUDA Toolkit (compiler and friends)

Added to portage

2021-11-27

pip - 21.3.1-r1
Ebuild name:

dev-python/pip-21.3.1-r1

Description

Installs python packages -- replacement for easy_install

Added to portage

2021-11-27

ploop - 1.14.1-r1
Ebuild name:

sys-cluster/ploop-1.14.1-r1

Description

openvz tool and a library to control ploop block devices

Added to portage

2021-11-27

prompt_toolkit - 3.0.23
Ebuild name:

dev-python/prompt_toolkit-3.0.23

Description

Building powerful interactive command lines in Python

Added to portage

2021-11-27

pylama - 8.0.6
Ebuild name:

dev-python/pylama-8.0.6

Description

Code audit tool for python

Added to portage

2021-11-27

python-ldap - 3.4.0
Ebuild name:

dev-python/python-ldap-3.4.0

Description

Various LDAP-related Python modules

Added to portage

2021-11-27

rinutils - 0.10.0
Ebuild name:

dev-libs/rinutils-0.10.0

Description

Set of C headers containing macros and static functions

Added to portage

2021-11-27

rofi - 1.7.1
Ebuild name:

x11-misc/rofi-1.7.1

Description

A window switcher, run dialog and dmenu replacement

Added to portage

2021-11-27

setuptools - 59.3.0
Ebuild name:

dev-python/setuptools-59.3.0

Description

Collection of extensions to Distutils

Added to portage

2021-11-27

stklos - 1.10-r2
Ebuild name:

dev-scheme/stklos-1.10-r2

Description

fast and light Scheme implementation

Added to portage

2021-11-27

stklos - 1.70
Ebuild name:

dev-scheme/stklos-1.70

Description

fast and light Scheme implementation

Added to portage

2021-11-27

unifi - 6.5.53
Ebuild name:

net-wireless/unifi-6.5.53

Description

A Management Controller for Ubiquiti Networks UniFi APs

Added to portage

2021-11-27

urxvt-tabbedex - 21.47
Ebuild name:

x11-misc/urxvt-tabbedex-21.47

Description

An extended version of rxvt-unicode's tabbed perl extension

Added to portage

2021-11-27

xmrig - 6.16.0
Ebuild name:

net-misc/xmrig-6.16.0

Description

RandomX, CryptoNight, KawPow, AstroBWT, and Argon2 CPU/GPU miner

Added to portage

2021-11-27

yatex - 1.80
Ebuild name:

app-emacs/yatex-1.80

Description

Yet Another TeX mode for Emacs

Added to portage

2021-11-27

zd1201-firmware - 0.14-r1
Ebuild name:

sys-firmware/zd1201-firmware-0.14-r1

Description

Firmware for ZyDAS 1201 based USB 802.11b Network WiFi devices

Added to portage

2021-11-27

zd1211-firmware - 1.5-r1
Ebuild name:

sys-firmware/zd1211-firmware-1.5-r1

Description

Firmware for ZyDAS ZD1211 USB-WLAN devices supported by the zd1

Added to portage

2021-11-27

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