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:

8167

userrating:

no votes yet


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.0 (1 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
Stellenangebote
Stellenangebote
für Fach- und
Führungskräfte
www.nachoben.com
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
.
FeedCollector
Combine various newsfeeds to one customized webpage
www.feedcollector.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
2010-03-14
ExtUtils-ParseXS - 2.22.05
Ebuild name:

perl-core/ExtUtils-ParseXS-2.22.05

Description

Converts Perl XS code into C code

Added to portage

2010-03-14

Scalar-List-Utils - 1.23
Ebuild name:

perl-core/Scalar-List-Utils-1.23

Description

Scalar-List-Utils module for perl

Added to portage

2010-03-14

Test-Class - 0.34
Ebuild name:

dev-perl/Test-Class-0.34

Description

Easily create test classes in an xUnit style.

Added to portage

2010-03-14

capistrano - 2.5.17
Ebuild name:

dev-ruby/capistrano-2.5.17

Description

A distributed application deployment system

Added to portage

2010-03-14

darcs - 1.0.5
Ebuild name:

dev-vcs/darcs-1.0.5

Description

David's Advanced Revision Control System is yet another replacement for CVS

Added to portage

2010-03-14

darcs - 1.0.6
Ebuild name:

dev-vcs/darcs-1.0.6

Description

David's Advanced Revision Control System is yet another replacement for CVS

Added to portage

2010-03-14

darcs - 1.0.7
Ebuild name:

dev-vcs/darcs-1.0.7

Description

David's Advanced Revision Control System is yet another replacement for CVS

Added to portage

2010-03-14

darcs - 1.0.8-r2
Ebuild name:

dev-vcs/darcs-1.0.8-r2

Description

David's Advanced Revision Control System is yet another replacement for CVS

Added to portage

2010-03-14

darcs - 1.0.9
Ebuild name:

dev-vcs/darcs-1.0.9

Description

David's Advanced Revision Control System is yet another replacement for CVS

Added to portage

2010-03-14

darcs - 1.1.0_pre1
Ebuild name:

dev-vcs/darcs-1.1.0_pre1

Description

David's Advanced Revision Control System is yet another replacement for CV

Added to portage

2010-03-14

darcs - 2.0.2
Ebuild name:

dev-vcs/darcs-2.0.2

Description

David's Advanced Revision Control System is yet another replacement for CVS

Added to portage

2010-03-14

darcs - 2.1.0-r1
Ebuild name:

dev-vcs/darcs-2.1.0-r1

Description

David's Advanced Revision Control System is yet another replacement for CVS

Added to portage

2010-03-14

darcs - 2.2.1
Ebuild name:

dev-vcs/darcs-2.2.1

Description

David's Advanced Revision Control System is yet another replacement for CVS

Added to portage

2010-03-14

dbus-java - 2.7-r1
Ebuild name:

dev-java/dbus-java-2.7-r1

Description

Java bindings for the D-Bus messagebus.

Added to portage

2010-03-14

desktopcouch - 0.6.1
Ebuild name:

dev-db/desktopcouch-0.6.1

Description

Desktop-oriented interface to CouchDB

Added to portage

2010-03-14

dissy - 9
Ebuild name:

dev-util/dissy-9

Description

A graphical frontend to the objdump disassembler

Added to portage

2010-03-14

emul-linux-x86-gtklibs - 20100220-r1
Ebuild name:

app-emulation/emul-linux-x86-gtklibs-20100220-r1

Description

Added to portage

2010-03-14

emul-linux-x86-soundlibs - 20100220-r1
Ebuild name:

app-emulation/emul-linux-x86-soundlibs-20100220-r1

Description

Added to portage

2010-03-14

fms - 0.3.51
Ebuild name:

net-p2p/fms-0.3.51

Description

A spam-resistant message board application for Freenet

Added to portage

2010-03-14

freenet - 0.7.5_p1241
Ebuild name:

net-p2p/freenet-0.7.5_p1241

Description

An encrypted network without censorship

Added to portage

2010-03-14

git-sources - 2.6.34_rc1-r2
Ebuild name:

sys-kernel/git-sources-2.6.34_rc1-r2

Description

The very latest -git version of the Linux kernel

Added to portage

2010-03-14

git-sources - 2.6.34_rc1-r3
Ebuild name:

sys-kernel/git-sources-2.6.34_rc1-r3

Description

The very latest -git version of the Linux kernel

Added to portage

2010-03-14

git-sources - 2.6.34_rc1-r4
Ebuild name:

sys-kernel/git-sources-2.6.34_rc1-r4

Description

The very latest -git version of the Linux kernel

Added to portage

2010-03-14

html-xml-utils - 5.5
Ebuild name:

app-text/html-xml-utils-5.5

Description

A number of simple utilities for manipulating HTML and XML files.

Added to portage

2010-03-14

json-c - 0.9
Ebuild name:

dev-libs/json-c-0.9

Description

A JSON implementation in C

Added to portage

2010-03-14

kismet - 2010.01.1
Ebuild name:

net-wireless/kismet-2010.01.1

Description

IEEE 802.11 wireless LAN sniffer

Added to portage

2010-03-14

kmess - 2.0.3
Ebuild name:

net-im/kmess-2.0.3

Description

KMess is an alternative MSN Messenger chat client for Linux

Added to portage

2010-03-14

leo - 4.7.1
Ebuild name:

app-editors/leo-4.7.1

Description

Leo Literate Editor with Outlines

Added to portage

2010-03-14

libgphoto2 - 2.4.8-r1
Ebuild name:

media-libs/libgphoto2-2.4.8-r1

Description

Library that implements support for numerous digital cameras

Added to portage

2010-03-14

libmail - 0.3
Ebuild name:

dev-libs/libmail-0.3

Description

a mail handling library

Added to portage

2010-03-14

lucene - 2.9.1-r1
Ebuild name:

dev-java/lucene-2.9.1-r1

Description

High-performance, full-featured text search engine written entirely in Jav

Added to portage

2010-03-14

mutagen - 1.19
Ebuild name:

media-libs/mutagen-1.19

Description

Mutagen is an audio metadata tag reader and writer implemented in pure Pyth

Added to portage

2010-03-14

nilfs-utils - 2.0.17
Ebuild name:

sys-fs/nilfs-utils-2.0.17

Description

A New Implementation of a Log-structured File System for Linux

Added to portage

2010-03-14

pbzip2 - 1.1.0
Ebuild name:

app-arch/pbzip2-1.1.0

Description

parallel bzip2 (de)compressor using libbz2

Added to portage

2010-03-14

perl-ExtUtils-ParseXS - 2.22.05
Ebuild name:

virtual/perl-ExtUtils-ParseXS-2.22.05

Description

Converts Perl XS code into C code

Added to portage

2010-03-14

perl-Scalar-List-Utils - 1.23
Ebuild name:

virtual/perl-Scalar-List-Utils-1.23

Description

Virtual for Scalar-List-Utils

Added to portage

2010-03-14

perl-threads - 1.76
Ebuild name:

virtual/perl-threads-1.76

Description

Virtual for threads

Added to portage

2010-03-14

perl-threads-shared - 1.33
Ebuild name:

virtual/perl-threads-shared-1.33

Description

Virtual for threads-shared

Added to portage

2010-03-14

qelectrotech - 0.22
Ebuild name:

sci-electronics/qelectrotech-0.22

Description

Qt4 application to design electric diagrams

Added to portage

2010-03-14

snownews - 1.5.12-r1
Ebuild name:

net-news/snownews-1.5.12-r1

Description

Snownews, a text-mode RSS/RDF newsreader

Added to portage

2010-03-14

speech-tools - 1.2.96_beta-r1
Ebuild name:

app-accessibility/speech-tools-1.2.96_beta-r1

Description

Speech tools for Festival Text to Speech engine

Added to portage

2010-03-14

t-prot - 2.97.1
Ebuild name:

net-mail/t-prot-2.97.1

Description

TOFU protection - display filter for RFC822 messages

Added to portage

2010-03-14

threads - 1.76
Ebuild name:

perl-core/threads-1.76

Description

Perl interpreter-based threads

Added to portage

2010-03-14

threads-shared - 1.33
Ebuild name:

perl-core/threads-shared-1.33

Description

Extension for sharing data structures between threads

Added to portage

2010-03-14

vanilla-sources - 2.6.34_rc1
Ebuild name:

sys-kernel/vanilla-sources-2.6.34_rc1

Description

Full sources for the Linux kernel

Added to portage

2010-03-14

viewnior - 0.7
Ebuild name:

media-gfx/viewnior-0.7

Description

Fast and simple image viewer

Added to portage

2010-03-14

xf86-video-ati - 6.12.191
Ebuild name:

x11-drivers/xf86-video-ati-6.12.191

Description

ATI video driver

Added to portage

2010-03-14

2010-03-13
2mandvd - 1.2-r1
Ebuild name:

media-video/2mandvd-1.2-r1

Description

The successor of ManDVD

Added to portage

2010-03-13

2mandvd - 1.3.1-r1
Ebuild name:

media-video/2mandvd-1.3.1-r1

Description

The successor of ManDVD

Added to portage

2010-03-13

2mandvd - 1.3.2
Ebuild name:

media-video/2mandvd-1.3.2

Description

The successor of ManDVD

Added to portage

2010-03-13

arb - 5.1-r1
Ebuild name:

sci-biology/arb-5.1-r1

Description

Tools for DNA/RNA sequence database handling and data analysis, phylogenetic

Added to portage

2010-03-13

atop - 1.24
Ebuild name:

sys-process/atop-1.24

Description

Resource-specific view of processes

Added to portage

2010-03-13

ccpn - 2.1.3.1_p100313
Ebuild name:

sci-chemistry/ccpn-2.1.3.1_p100313

Description

The Collaborative Computing Project for NMR

Added to portage

2010-03-13

db - 4.8.26
Ebuild name:

sys-libs/db-4.8.26

Description

Oracle Berkeley DB

Added to portage

2010-03-13

dosfstools - 3.0.9
Ebuild name:

sys-fs/dosfstools-3.0.9

Description

DOS filesystem tools - provides mkdosfs, mkfs.msdos, mkfs.vfat

Added to portage

2010-03-13

epiphany-extensions - 2.28.1-r2
Ebuild name:

www-client/epiphany-extensions-2.28.1-r2

Description

Extensions for the Epiphany web browser

Added to portage

2010-03-13

fox - 1.6.37
Ebuild name:

x11-libs/fox-1.6.37

Description

C++ based Toolkit for developing Graphical User Interfaces easily and effective

Added to portage

2010-03-13

fxscintilla - 1.71-r2
Ebuild name:

x11-libs/fxscintilla-1.71-r2

Description

A free source code editing component for the FOX-Toolkit

Added to portage

2010-03-13

ganeti - 2.1.1
Ebuild name:

app-emulation/ganeti-2.1.1

Description

Ganeti is a virtual server management software tool

Added to portage

2010-03-13

ganeti-instance-debootstrap - 0.9
Ebuild name:

app-emulation/ganeti-instance-debootstrap-0.9

Description

Scripts to build Ganeti VMs with debootstrap

Added to portage

2010-03-13

gentoolkit-dev - 0.2.6.13-r1
Ebuild name:

app-portage/gentoolkit-dev-0.2.6.13-r1

Description

Collection of developer scripts for Gentoo

Added to portage

2010-03-13

ibus-anthy - 1.2.0.20100312.1
Ebuild name:

app-i18n/ibus-anthy-1.2.0.20100312.1

Description

Japanese input method Anthy IMEngine for IBus Framework

Added to portage

2010-03-13

ibus-anthy - 1.2.0.20100313
Ebuild name:

app-i18n/ibus-anthy-1.2.0.20100313

Description

Japanese input method Anthy IMEngine for IBus Framework

Added to portage

2010-03-13

ibus-pinyin - 1.2.99.20100308
Ebuild name:

app-i18n/ibus-pinyin-1.2.99.20100308

Description

Chinese PinYin IMEngine for IBus Framework

Added to portage

2010-03-13

ibus-table-cantonese - 1.2.0.20100305
Ebuild name:

app-i18n/ibus-table-cantonese-1.2.0.20100305

Description

The Cantonese and derived tables for IBus-Table

Added to portage

2010-03-13

ibus-table-code - 1.2.0.20100305
Ebuild name:

app-i18n/ibus-table-code-1.2.0.20100305

Description

The code tables for IBus-Table

Added to portage

2010-03-13

ibus-table-cyrillic - 1.2.0.20100305
Ebuild name:

app-i18n/ibus-table-cyrillic-1.2.0.20100305

Description

Translit, Russian Traditional, Yawerty tables for IBus-

Added to portage

2010-03-13

ibus-table-extraphrase - 1.2.0.20100305
Ebuild name:

app-i18n/ibus-table-extraphrase-1.2.0.20100305

Description

Chinese extra phrases for ibus-table based IME

Added to portage

2010-03-13

ibus-table-latin - 1.2.0.20100305
Ebuild name:

app-i18n/ibus-table-latin-1.2.0.20100305

Description

The Latin tables for IBus-Table

Added to portage

2010-03-13

ibus-table-tv - 1.2.0.20100305
Ebuild name:

app-i18n/ibus-table-tv-1.2.0.20100305

Description

The Thai and Viqr (Vietnamese) tables for IBus-Table

Added to portage

2010-03-13

ibus-table-yinma - 1.2.0.20100305
Ebuild name:

app-i18n/ibus-table-yinma-1.2.0.20100305

Description

The yinma tables for IBus-Table

Added to portage

2010-03-13

jffi - 1.0.0
Ebuild name:

dev-java/jffi-1.0.0

Description

An optimized Java interface to libffi

Added to portage

2010-03-13

libfm - 0.1.5
Ebuild name:

x11-libs/libfm-0.1.5

Description

Library for file management

Added to portage

2010-03-13

nilfs-utils - 2.0.16
Ebuild name:

sys-fs/nilfs-utils-2.0.16

Description

A New Implementation of a Log-structured File System for Linux

Added to portage

2010-03-13

pcmanfm - 0.9.2
Ebuild name:

x11-misc/pcmanfm-0.9.2

Description

Fast lightweight tabbed filemanager

Added to portage

2010-03-13

pngcrush - 1.7.10
Ebuild name:

media-gfx/pngcrush-1.7.10

Description

Portable Network Graphics (PNG) optimizing utility

Added to portage

2010-03-13

sqlite - 3.6.23
Ebuild name:

dev-db/sqlite-3.6.23

Description

A SQL Database Engine in a C Library

Added to portage

2010-03-13

sun-javamail - 1.4.3
Ebuild name:

dev-java/sun-javamail-1.4.3

Description

A Java-based framework to build multiplatform mail and messaging applic

Added to portage

2010-03-13

sylpheed - 3.0.0
Ebuild name:

mail-client/sylpheed-3.0.0

Description

A lightweight email client and newsreader

Added to portage

2010-03-13

tinker - 5.1.05
Ebuild name:

sci-chemistry/tinker-5.1.05

Description

Molecular modeling package that includes force fields, such as AMBER an

Added to portage

2010-03-13

wpa_supplicant - 0.6.10
Ebuild name:

net-wireless/wpa_supplicant-0.6.10

Description

IEEE 802.1X/WPA supplicant for secure wireless transfers

Added to portage

2010-03-13

zope-app-form - 4.0.2
Ebuild name:

net-zope/zope-app-form-4.0.2

Description

The Original Zope 3 Form Framework

Added to portage

2010-03-13

zope-component - 3.9.2
Ebuild name:

net-zope/zope-component-3.9.2

Description

Zope Component Architecture

Added to portage

2010-03-13

rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004 S&P Softwaredesign
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: 60.3 ms
system status display
Stellenangebote
Ärger mit Freenet.de