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:

38219

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
Please read "Why adblockers are bad".



other Ads
Trace My Cash
Wenn Sie sich schon immer mal gefragt haben, wo eigentlich Ihr geliebtes Bargeld geblieben ist, finden Sie hier vielleicht die Antwort.
www.tracemycash.com
Other free services
toURL.org
Shorten long
URLs to short
links like
http://tourl.org/2
tourl.org
.
Reverse DNS lookup
Find out which hostname(s)
resolve to a
given IP or other hostnames for the server
www.reversednslookup.org

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2017-06-27
calibre - 3.1.1-r2
Ebuild name:

app-text/calibre-3.1.1-r2

Description

Ebook management application

Added to portage

2017-06-27

dog - 1.7-r6
Ebuild name:

sys-apps/dog-1.7-r6

Description

Dog is better than cat

Added to portage

2017-06-27

drone - 0.7.3
Ebuild name:

dev-util/drone-0.7.3

Description

A Continuous Delivery platform built on Docker, written in Go

Added to portage

2017-06-27

eps - 1.7-r1
Ebuild name:

net-mail/eps-1.7-r1

Description

Inter7 Email Processing and mht System library

Added to portage

2017-06-27

intel-sa-00075-tools - 1.0
Ebuild name:

sys-apps/intel-sa-00075-tools-1.0

Description

Tools from Intel to detect and mitigate the AMT/MEI vulnerability

Added to portage

2017-06-27

less - 493
Ebuild name:

sys-apps/less-493

Description

Excellent text file viewer

Added to portage

2017-06-27

libgltf - 0.1.0
Ebuild name:

media-libs/libgltf-0.1.0

Description

C++ Library for rendering OpenGL models stored in glTF format

Added to portage

2017-06-27

libmwaw - 0.3.11-r1
Ebuild name:

app-text/libmwaw-0.3.11-r1

Description

Library parsing many pre-OSX MAC text formats

Added to portage

2017-06-27

libreoffice - 5.3.4.2
Ebuild name:

app-office/libreoffice-5.3.4.2

Description

A full office productivity suite

Added to portage

2017-06-27

libreoffice-l10n - 5.3.4.2
Ebuild name:

app-office/libreoffice-l10n-5.3.4.2

Description

Translations for the Libreoffice suite

Added to portage

2017-06-27

minikube - 0.20.0
Ebuild name:

sys-cluster/minikube-0.20.0

Description

Single Node Kubernetes Cluster

Added to portage

2017-06-27

opera-developer - 48.0.2636.0
Ebuild name:

www-client/opera-developer-48.0.2636.0

Description

A fast and secure web browser

Added to portage

2017-06-27

packagekit-base - 1.1.5-r2
Ebuild name:

app-admin/packagekit-base-1.1.5-r2

Description

Manage packages in a secure way using a cross-distro and cross-a

Added to portage

2017-06-27

reiserfsprogs - 3.6.26
Ebuild name:

sys-fs/reiserfsprogs-3.6.26

Description

Reiserfs Utilities

Added to portage

2017-06-27

sslscan - 1.11.10
Ebuild name:

net-analyzer/sslscan-1.11.10

Description

Fast SSL configuration scanner

Added to portage

2017-06-27

unicode-data - 10.0.0
Ebuild name:

app-i18n/unicode-data-10.0.0

Description

Unicode data from unicode.org

Added to portage

2017-06-27

2017-06-26
Babel - 2.4.0
Ebuild name:

dev-python/Babel-2.4.0

Description

Collection of tools for internationalizing Python applications

Added to portage

2017-06-26

abcm2ps - 8.13.11
Ebuild name:

media-sound/abcm2ps-8.13.11

Description

A program to convert abc files to Postscript files

Added to portage

2017-06-26

aiohttp - 2.2.0
Ebuild name:

dev-python/aiohttp-2.2.0

Description

http client/server for asyncio

Added to portage

2017-06-26

ampache - 3.8.3
Ebuild name:

www-apps/ampache-3.8.3

Description

PHP-based tool for managing,updating and playing audio files via a web inter

Added to portage

2017-06-26

astropy - 1.3.3
Ebuild name:

dev-python/astropy-1.3.3

Description

Core functionality for performing astrophysics with Python

Added to portage

2017-06-26

astropy-helpers - 1.3.1
Ebuild name:

dev-python/astropy-helpers-1.3.1

Description

Helpers for Astropy and Affiliated packages

Added to portage

2017-06-26

blueberry - 1.1.13
Ebuild name:

net-wireless/blueberry-1.1.13

Description

A Bluetooth configuration tool

Added to portage

2017-06-26

bluez-tools - 0_p20161212
Ebuild name:

net-wireless/bluez-tools-0_p20161212

Description

A set of tools to manage bluetooth devices for linux

Added to portage

2017-06-26

camlp5 - 7.00
Ebuild name:

dev-ml/camlp5-7.00

Description

A preprocessor-pretty-printer of ocaml

Added to portage

2017-06-26

cfitsio - 3.410
Ebuild name:

sci-libs/cfitsio-3.410

Description

C and Fortran library for manipulating FITS files

Added to portage

2017-06-26

chromium - 61.0.3135.4
Ebuild name:

www-client/chromium-61.0.3135.4

Description

Open-source version of Google Chrome web browser

Added to portage

2017-06-26

esptool - 2.0.1
Ebuild name:

dev-embedded/esptool-2.0.1

Description

Utility to communicate with the ROM bootloader in Espressif ESP8266 and

Added to portage

2017-06-26

gentoo-sources - 4.1.41
Ebuild name:

sys-kernel/gentoo-sources-4.1.41

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2017-06-26

gentoo-sources - 4.4.74
Ebuild name:

sys-kernel/gentoo-sources-4.4.74

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2017-06-26

git-sources - 4.12_rc7
Ebuild name:

sys-kernel/git-sources-4.12_rc7

Description

The very latest -git version of the Linux kernel

Added to portage

2017-06-26

ipv6calc - 1.0.0
Ebuild name:

net-misc/ipv6calc-1.0.0

Description

IPv6 address calculator

Added to portage

2017-06-26

jenkins-bin - 2.67
Ebuild name:

dev-util/jenkins-bin-2.67

Description

Extensible continuous integration server

Added to portage

2017-06-26

jsoncpp - 1.8.1
Ebuild name:

dev-libs/jsoncpp-1.8.1

Description

C++ JSON reader and writer

Added to portage

2017-06-26

keyring - 10.4.0
Ebuild name:

dev-python/keyring-10.4.0

Description

Provides access to the system keyring service

Added to portage

2017-06-26

knot - 2.4.5
Ebuild name:

net-dns/knot-2.4.5

Description

High-performance authoritative-only DNS server

Added to portage

2017-06-26

knot - 2.5.2
Ebuild name:

net-dns/knot-2.5.2

Description

High-performance authoritative-only DNS server

Added to portage

2017-06-26

libffado - 2.3.0
Ebuild name:

media-libs/libffado-2.3.0

Description

Driver for IEEE1394 (Firewire) audio interfaces

Added to portage

2017-06-26

libreoffice - 5.4.9999
Ebuild name:

app-office/libreoffice-5.4.9999

Description

A full office productivity suite

Added to portage

2017-06-26

libxfce4ui - 4.13.2
Ebuild name:

xfce-base/libxfce4ui-4.13.2

Description

Unified widget and session management libs for Xfce

Added to portage

2017-06-26

libxfce4util - 4.13.1
Ebuild name:

xfce-base/libxfce4util-4.13.1

Description

A basic utility library for the Xfce desktop environment

Added to portage

2017-06-26

libyami - 1.2.0
Ebuild name:

media-libs/libyami-1.2.0

Description

Yet Another Media Infrastructure Media codec with hardware acceleration

Added to portage

2017-06-26

lmdb - 0.92
Ebuild name:

dev-python/lmdb-0.92

Description

Python bindings for the Lightning Database

Added to portage

2017-06-26

memcached - 1.4.38
Ebuild name:

net-misc/memcached-1.4.38

Description

High-performance, distributed memory object caching system

Added to portage

2017-06-26

moarvm - 2017.06
Ebuild name:

dev-lang/moarvm-2017.06

Description

A 6model-based VM for NQP and Rakudo Perl 6

Added to portage

2017-06-26

movit - 1.5.1
Ebuild name:

media-video/movit-1.5.1

Description

Modern Video Toolkit

Added to portage

2017-06-26

nqp - 2017.06
Ebuild name:

dev-lang/nqp-2017.06

Description

Not Quite Perl, a Perl 6 bootstrapping compiler

Added to portage

2017-06-26

nss-pam-ldapd - 0.9.8
Ebuild name:

sys-auth/nss-pam-ldapd-0.9.8

Description

NSS module for name lookups using LDAP

Added to portage

2017-06-26

obnam - 1.22
Ebuild name:

app-backup/obnam-1.22

Description

A backup program that supports encryption and deduplication

Added to portage

2017-06-26

pytest-mpl - 0.7
Ebuild name:

dev-python/pytest-mpl-0.7

Description

pytest plugin to faciliate image comparison for matplotlib figures

Added to portage

2017-06-26

rakudo - 2017.06
Ebuild name:

dev-lang/rakudo-2017.06

Description

A compiler for the Perl 6 programming language

Added to portage

2017-06-26

retext - 7.0.1
Ebuild name:

app-editors/retext-7.0.1

Description

Simple editor for Markdown and reStructuredText

Added to portage

2017-06-26

roadie - 3.2.2
Ebuild name:

dev-ruby/roadie-3.2.2

Description

Making HTML emails comfortable for the Rails rockstars

Added to portage

2017-06-26

rouge - 2.1.1
Ebuild name:

dev-ruby/rouge-2.1.1

Description

Yet-another-markdown-parser using a strict syntax definition in pure Ruby

Added to portage

2017-06-26

shorewall - 5.1.4.4
Ebuild name:

net-firewall/shorewall-5.1.4.4

Description

Added to portage

2017-06-26

sks - 1.1.6-r1
Ebuild name:

net-misc/sks-1.1.6-r1

Description

An OpenPGP keyserver which is decentralized with highly reliable synchronizat

Added to portage

2017-06-26

toybox - 0.7.4
Ebuild name:

sys-apps/toybox-0.7.4

Description

Common linux commands in a multicall binary

Added to portage

2017-06-26

xfce4-screenshooter - 1.9.0
Ebuild name:

xfce-extra/xfce4-screenshooter-1.9.0

Description

Xfce4 screenshooter application and panel plugin

Added to portage

2017-06-26

xfdesktop - 4.12.4
Ebuild name:

xfce-base/xfdesktop-4.12.4

Description

Desktop manager for the Xfce desktop environment

Added to portage

2017-06-26

xmlsec - 1.2.24
Ebuild name:

dev-libs/xmlsec-1.2.24

Description

Command line tool for signing, verifying, encrypting and decrypting XML

Added to portage

2017-06-26

yarl - 0.10.3
Ebuild name:

dev-python/yarl-0.10.3

Description

Yet another URL library

Added to portage

2017-06-26

zict - 0.1.2
Ebuild name:

dev-python/zict-0.1.2

Description

Mutable mapping tools

Added to portage

2017-06-26

rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2017 Sascha Nitsch Unternehmensberatung UG(haftungsbeschänkt)
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: 6.3 ms
system status display