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:

46445

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



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
2019-06-18
PyGithub - 1.43.7
Ebuild name:

dev-python/PyGithub-1.43.7

Description

Python library to access the Github API v3

Added to portage

2019-06-18

aunit - 2019
Ebuild name:

dev-ada/aunit-2019

Description

Ada unit testing framework

Added to portage

2019-06-18

bazel - 0.27.0
Ebuild name:

dev-util/bazel-0.27.0

Description

Fast and correct automated build system

Added to portage

2019-06-18

bees - 0.6.1
Ebuild name:

sys-fs/bees-0.6.1

Description

Best-Effort Extent-Same, a btrfs dedup agent

Added to portage

2019-06-18

bluedevil - 5.16.1
Ebuild name:

kde-plasma/bluedevil-5.16.1

Description

Bluetooth stack for KDE Plasma

Added to portage

2019-06-18

breeze - 5.16.1
Ebuild name:

kde-plasma/breeze-5.16.1

Description

Breeze visual style for the Plasma desktop

Added to portage

2019-06-18

breeze-grub - 5.16.1
Ebuild name:

kde-plasma/breeze-grub-5.16.1

Description

Breeze theme for GRUB

Added to portage

2019-06-18

breeze-gtk - 5.16.1
Ebuild name:

kde-plasma/breeze-gtk-5.16.1

Description

Official GTK+ port of Plasma's Breeze widget style

Added to portage

2019-06-18

byacc - 20190616
Ebuild name:

dev-util/byacc-20190616

Description

the best variant of the Yacc parser generator

Added to portage

2019-06-18

chrpath - 0.16
Ebuild name:

app-admin/chrpath-0.16

Description

Chrpath can modify the rpath and runpath of ELF executables

Added to portage

2019-06-18

deprecated - 1.2.5
Ebuild name:

dev-python/deprecated-1.2.5

Description

Python @deprecated decorator to deprecate old API

Added to portage

2019-06-18

encodings - 1.0.5
Ebuild name:

media-fonts/encodings-1.0.5

Description

X.Org font encodings

Added to portage

2019-06-18

genkernel-next - 70
Ebuild name:

sys-kernel/genkernel-next-70

Description

Gentoo automatic kernel building scripts, reloaded

Added to portage

2019-06-18

gentoo-sources - 4.14.127
Ebuild name:

sys-kernel/gentoo-sources-4.14.127

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2019-06-18

gentoo-sources - 4.19.52
Ebuild name:

sys-kernel/gentoo-sources-4.19.52

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2019-06-18

gentoo-sources - 4.4.182
Ebuild name:

sys-kernel/gentoo-sources-4.4.182

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2019-06-18

gentoo-sources - 4.9.182
Ebuild name:

sys-kernel/gentoo-sources-4.9.182

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2019-06-18

gentoo-sources - 5.1.11
Ebuild name:

sys-kernel/gentoo-sources-5.1.11

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2019-06-18

getopt - 1.1.6-r1
Ebuild name:

app-misc/getopt-1.1.6-r1

Description

getopt(1) replacement supporting GNU-style long options

Added to portage

2019-06-18

git-lfs - 2.7.2
Ebuild name:

dev-vcs/git-lfs-2.7.2

Description

command line extension and specification for managing large files with Git

Added to portage

2019-06-18

gnatmem - 2019
Ebuild name:

dev-ada/gnatmem-2019

Description

Monitors dynamic allocation and deallocation activity in a program

Added to portage

2019-06-18

gnatsymbolize - 2019
Ebuild name:

dev-ada/gnatsymbolize-2019

Description

Translates addresses into filename, line number, and function names

Added to portage

2019-06-18

haproxy - 2.0.0
Ebuild name:

net-proxy/haproxy-2.0.0

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2019-06-18

haproxy - 2.0.9999
Ebuild name:

net-proxy/haproxy-2.0.9999

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2019-06-18

hg-evolve - 9.0.0
Ebuild name:

dev-vcs/hg-evolve-9.0.0

Description

enables the changeset evolution feature of Mercurial

Added to portage

2019-06-18

httpretty - 0.9.6
Ebuild name:

dev-python/httpretty-0.9.6

Description

HTTP client mock for Python

Added to portage

2019-06-18

i2pd - 2.26.0
Ebuild name:

net-vpn/i2pd-2.26.0

Description

A C++ daemon for accessing the I2P anonymous network

Added to portage

2019-06-18

libdv - 1.0.0-r4
Ebuild name:

media-libs/libdv-1.0.0-r4

Description

Software codec for dv-format video (camcorders etc)

Added to portage

2019-06-18

lvm2 - 2.02.185
Ebuild name:

sys-fs/lvm2-2.02.185

Description

User-land utilities for LVM2 (device-mapper) software

Added to portage

2019-06-18

mocha - 1.9.0
Ebuild name:

dev-ruby/mocha-1.9.0

Description

Mocking and stubbing using a syntax like that of JMock and SchMock

Added to portage

2019-06-18

mutt - 1.12.1
Ebuild name:

mail-client/mutt-1.12.1

Description

A small but very powerful text-based mail client

Added to portage

2019-06-18

openssh - 8.0_p1-r2
Ebuild name:

net-misc/openssh-8.0_p1-r2

Description

Port of OpenBSD's free SSH release

Added to portage

2019-06-18

pdns - 4.1.9
Ebuild name:

net-dns/pdns-4.1.9

Description

The PowerDNS Daemon

Added to portage

2019-06-18

postforward - 1.1.1
Ebuild name:

mail-filter/postforward-1.1.1

Description

Postfix Sender Rewriting Scheme forwarding agent

Added to portage

2019-06-18

protobuf - 3.8.0
Ebuild name:

dev-libs/protobuf-3.8.0

Description

Google's Protocol Buffers - Extensible mechanism for serializing structured

Added to portage

2019-06-18

protobuf-java - 3.8.0
Ebuild name:

dev-java/protobuf-java-3.8.0

Description

Google's Protocol Buffers - Java bindings

Added to portage

2019-06-18

protobuf-python - 3.8.0
Ebuild name:

dev-python/protobuf-python-3.8.0

Description

Google's Protocol Buffers - Python bindings

Added to portage

2019-06-18

psqlodbc - 11.01.0000
Ebuild name:

dev-db/psqlodbc-11.01.0000

Description

Official ODBC driver for PostgreSQL

Added to portage

2019-06-18

restic - 0.9.5
Ebuild name:

app-backup/restic-0.9.5

Description

A backup program that is fast, efficient and secure

Added to portage

2019-06-18

spidermonkey - 1.8.5-r8
Ebuild name:

dev-lang/spidermonkey-1.8.5-r8

Description

Stand-alone JavaScript C library

Added to portage

2019-06-18

sure - 1.4.11
Ebuild name:

dev-python/sure-1.4.11

Description

idiomatic assertion toolkit with human-friendly failure messages

Added to portage

2019-06-18

telegram-desktop-bin - 1.7.7
Ebuild name:

net-im/telegram-desktop-bin-1.7.7

Description

Official desktop client for Telegram (binary package)

Added to portage

2019-06-18

unbound - 1.9.2
Ebuild name:

net-dns/unbound-1.9.2

Description

A validating, recursive and caching DNS resolver

Added to portage

2019-06-18

vanilla-sources - 4.14.127
Ebuild name:

sys-kernel/vanilla-sources-4.14.127

Description

Full sources for the Linux kernel

Added to portage

2019-06-18

vanilla-sources - 4.19.52
Ebuild name:

sys-kernel/vanilla-sources-4.19.52

Description

Full sources for the Linux kernel

Added to portage

2019-06-18

vanilla-sources - 4.4.182
Ebuild name:

sys-kernel/vanilla-sources-4.4.182

Description

Full sources for the Linux kernel

Added to portage

2019-06-18

vanilla-sources - 4.9.182
Ebuild name:

sys-kernel/vanilla-sources-4.9.182

Description

Full sources for the Linux kernel

Added to portage

2019-06-18

vanilla-sources - 5.1.11
Ebuild name:

sys-kernel/vanilla-sources-5.1.11

Description

Full sources for the Linux kernel

Added to portage

2019-06-18

vine - 1.3.0
Ebuild name:

dev-python/vine-1.3.0

Description

Python Promises

Added to portage

2019-06-18

vivaldi-snapshot - 2.6.1566.35_p1
Ebuild name:

www-client/vivaldi-snapshot-2.6.1566.35_p1

Description

A browser for our friends

Added to portage

2019-06-18

2019-06-17
adjtimex - 1.29-r2
Ebuild name:

net-misc/adjtimex-1.29-r2

Description

display or set the kernel time variables

Added to portage

2019-06-17

aiorpcX - 0.18.3
Ebuild name:

dev-python/aiorpcX-0.18.3

Description

Generic async RPC implementation, including JSON-RPC

Added to portage

2019-06-17

alacritty - 0.3.3
Ebuild name:

x11-terms/alacritty-0.3.3

Description

GPU-accelerated terminal emulator

Added to portage

2019-06-17

alembic - 1.7.11
Ebuild name:

media-gfx/alembic-1.7.11

Description

Open framework for storing and sharing scene data

Added to portage

2019-06-17

buildah - 1.8.4
Ebuild name:

app-emulation/buildah-1.8.4

Description

A tool that facilitates building OCI images

Added to portage

2019-06-17

buildah - 1.9.0
Ebuild name:

app-emulation/buildah-1.9.0

Description

A tool that facilitates building OCI images

Added to portage

2019-06-17

catalyst - 3.0.5
Ebuild name:

dev-util/catalyst-3.0.5

Description

Release metatool used for creating releases based on Gentoo Linux

Added to portage

2019-06-17

cbatticon - 1.6.9
Ebuild name:

x11-misc/cbatticon-1.6.9

Description

A lightweight and fast battery icon that sits in your system tray

Added to portage

2019-06-17

comparator - 2.12
Ebuild name:

dev-util/comparator-2.12

Description

ESR's utility for making fast comparisons among large source trees

Added to portage

2019-06-17

cryfs - 0.10.2
Ebuild name:

sys-fs/cryfs-0.10.2

Description

Encrypted FUSE filesystem that conceals metadata

Added to portage

2019-06-17

dnetc - 2.9112.521
Ebuild name:

app-misc/dnetc-2.9112.521

Description

distributed.net client

Added to portage

2019-06-17

equatable - 0.6.0
Ebuild name:

dev-ruby/equatable-0.6.0

Description

Allows ruby objects to implement equality comparison and inspection method

Added to portage

2019-06-17

fping - 4.2
Ebuild name:

net-analyzer/fping-4.2

Description

A utility to ping multiple hosts at once

Added to portage

2019-06-17

git-sources - 5.2_rc5
Ebuild name:

sys-kernel/git-sources-5.2_rc5

Description

The very latest -git version of the Linux kernel

Added to portage

2019-06-17

libX11 - 1.6.8
Ebuild name:

x11-libs/libX11-1.6.8

Description

X.Org X11 library

Added to portage

2019-06-17

mbr-gpt - 0.0.1-r1
Ebuild name:

sys-boot/mbr-gpt-0.0.1-r1

Description

An MBR that can handle BIOS-based boot on GPT

Added to portage

2019-06-17

mongo-tools - 3.6.13
Ebuild name:

app-admin/mongo-tools-3.6.13

Description

A high-performance, open source, schema-free document-oriented databas

Added to portage

2019-06-17

mongodb - 3.6.13
Ebuild name:

dev-db/mongodb-3.6.13

Description

A high-performance, open source, schema-free document-oriented database

Added to portage

2019-06-17

opera - 60.0.3255.170
Ebuild name:

www-client/opera-60.0.3255.170

Description

A fast and secure web browser

Added to portage

2019-06-17

opera-beta - 62.0.3331.10
Ebuild name:

www-client/opera-beta-62.0.3331.10

Description

A fast and secure web browser

Added to portage

2019-06-17

opera-developer - 63.0.3349.0
Ebuild name:

www-client/opera-developer-63.0.3349.0

Description

A fast and secure web browser

Added to portage

2019-06-17

pastel - 0.7.3
Ebuild name:

dev-ruby/pastel-0.7.3

Description

Terminal strings styling with intuitive and clean API

Added to portage

2019-06-17

prefix-toolkit - 4
Ebuild name:

app-portage/prefix-toolkit-4

Description

Utilities for users of Gentoo Prefix

Added to portage

2019-06-17

pychess - 0.99.4-r1
Ebuild name:

games-board/pychess-0.99.4-r1

Description

A chess client for Gnome

Added to portage

2019-06-17

pygresql - 5.1
Ebuild name:

dev-python/pygresql-5.1

Description

A Python interface for the PostgreSQL database

Added to portage

2019-06-17

pyroute2 - 0.5.5-r1
Ebuild name:

dev-python/pyroute2-0.5.5-r1

Description

A pure Python netlink and Linux network configuration library.

Added to portage

2019-06-17

rmagick - 3.2.0
Ebuild name:

dev-ruby/rmagick-3.2.0

Description

An interface between Ruby and the ImageMagick(TM) image processing library

Added to portage

2019-06-17

shadow - 4.7
Ebuild name:

sys-apps/shadow-4.7

Description

Utilities to deal with user accounts

Added to portage

2019-06-17

stunnel - 5.55
Ebuild name:

net-misc/stunnel-5.55

Description

TLS/SSL - Port Wrapper

Added to portage

2019-06-17

swi-prolog - 8.1.8
Ebuild name:

dev-lang/swi-prolog-8.1.8

Description

versatile implementation of the Prolog programming language

Added to portage

2019-06-17

systemd - 241-r2
Ebuild name:

sys-apps/systemd-241-r2

Description

System and service manager for Linux

Added to portage

2019-06-17

systemd - 242-r3
Ebuild name:

sys-apps/systemd-242-r3

Description

System and service manager for Linux

Added to portage

2019-06-17

texlive-langczechslovak - 2019-r1
Ebuild name:

dev-texlive/texlive-langczechslovak-2019-r1

Description

TeXLive Czech/Slovak

Added to portage

2019-06-17

texworks - 0.6.3
Ebuild name:

app-editors/texworks-0.6.3

Description

A simple interface for working with TeX documents

Added to portage

2019-06-17

tty-platform - 0.2.1
Ebuild name:

dev-ruby/tty-platform-0.2.1

Description

Query methods for detecting different operating systems

Added to portage

2019-06-17

tty-reader - 0.6.0-r1
Ebuild name:

dev-ruby/tty-reader-0.6.0-r1

Description

Methods for processing keyboard input in character, line and multiline

Added to portage

2019-06-17

udisks - 2.8.3
Ebuild name:

sys-fs/udisks-2.8.3

Description

Daemon providing interfaces to work with storage devices

Added to portage

2019-06-17

unsymlink-lib - 16
Ebuild name:

app-portage/unsymlink-lib-16

Description

Convert your system to SYMLINK_LIB=no

Added to portage

2019-06-17

util-linux - 2.34
Ebuild name:

sys-apps/util-linux-2.34

Description

Various useful Linux utilities

Added to portage

2019-06-17

vivaldi-snapshot - 2.6.1566.31_p1
Ebuild name:

www-client/vivaldi-snapshot-2.6.1566.31_p1

Description

A browser for our friends

Added to portage

2019-06-17

xterm - 346
Ebuild name:

x11-terms/xterm-346

Description

Terminal Emulator for X Windows

Added to portage

2019-06-17

xwallpaper - 0.6.0
Ebuild name:

x11-misc/xwallpaper-0.6.0

Description

Wallpaper setting utility for X

Added to portage

2019-06-17

rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2018 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: 34.0 ms