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:

67239

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-04-26
Faker - 24.14.0
Ebuild name:

dev-python/Faker-24.14.0

Description

A Python package that generates fake data for you

Added to portage

2024-04-26

beagle - 3.0.3-r2
Ebuild name:

sci-libs/beagle-3.0.3-r2

Description

Open BEAGLE, a versatile EC/GA/GP framework

Added to portage

2024-04-26

connman-ui - 0_p20150622-r1
Ebuild name:

net-misc/connman-ui-0_p20150622-r1

Description

A full-featured GTK based trayicon UI for ConnMan

Added to portage

2024-04-26

earthly - 0.8.9
Ebuild name:

app-containers/earthly-0.8.9

Description

Build automation tool that executes in containers

Added to portage

2024-04-26

flask-compress - 1.15
Ebuild name:

dev-python/flask-compress-1.15

Description

Compress responses in your Flask app with gzip

Added to portage

2024-04-26

gcc - 11.4.1_p20240425
Ebuild name:

sys-devel/gcc-11.4.1_p20240425

Description

The GNU Compiler Collection

Added to portage

2024-04-26

gentoolkit - 0.6.6
Ebuild name:

app-portage/gentoolkit-0.6.6

Description

Collection of administration scripts for Gentoo

Added to portage

2024-04-26

gtk - 4.12.5-r1
Ebuild name:

gui-libs/gtk-4.12.5-r1

Description

GTK is a multi-platform toolkit for creating graphical user interfaces

Added to portage

2024-04-26

idnkit - 2.3-r1
Ebuild name:

net-dns/idnkit-2.3-r1

Description

Toolkit for Internationalized Domain Names (IDN)

Added to portage

2024-04-26

kdenetwork-meta - 23.08.5-r1
Ebuild name:

kde-apps/kdenetwork-meta-23.08.5-r1

Description

kdenetwork - merge this to pull in all kdenetwork-derived packa

Added to portage

2024-04-26

kdenetwork-meta - 24.02.2-r1
Ebuild name:

kde-apps/kdenetwork-meta-24.02.2-r1

Description

kdenetwork - merge this to pull in all kdenetwork-derived packa

Added to portage

2024-04-26

libgpg-error - 1.49
Ebuild name:

dev-libs/libgpg-error-1.49

Description

Contains error handling functions used by GnuPG software

Added to portage

2024-04-26

libtifiles2 - 1.1.7-r1
Ebuild name:

sci-libs/libtifiles2-1.1.7-r1

Description

Library for TI calculator files

Added to portage

2024-04-26

libucl - 0.9.2
Ebuild name:

dev-libs/libucl-0.9.2

Description

Universal configuration library parser

Added to portage

2024-04-26

midentd - 2.3.1-r3
Ebuild name:

net-misc/midentd-2.3.1-r3

Description

ident daemon with masquerading and fake replies support

Added to portage

2024-04-26

mkdocs-material - 9.5.19
Ebuild name:

dev-python/mkdocs-material-9.5.19

Description

A Material Design theme for MkDocs

Added to portage

2024-04-26

netevent - 2.2.2
Ebuild name:

net-misc/netevent-2.2.2

Description

Tool to share Linux event devices with other machines

Added to portage

2024-04-26

phonon - 4.12.0-r2
Ebuild name:

media-libs/phonon-4.12.0-r2

Description

KDE multimedia abstraction library

Added to portage

2024-04-26

plette - 2.0.2
Ebuild name:

dev-python/plette-2.0.2

Description

Structured Pipfile and Pipfile.lock models

Added to portage

2024-04-26

ripgrep-all - 0.10.6
Ebuild name:

sys-apps/ripgrep-all-0.10.6

Description

Like ripgrep, but also search in PDFs, E-Books, Office documents, archi

Added to portage

2024-04-26

roman - 4.2
Ebuild name:

dev-python/roman-4.2

Description

An Integer to Roman numerals converter

Added to portage

2024-04-26

ruff - 0.4.2
Ebuild name:

dev-util/ruff-0.4.2

Description

An extremely fast Python linter, written in Rust

Added to portage

2024-04-26

signon-kwallet-extension - 24.02.2-r1
Ebuild name:

kde-apps/signon-kwallet-extension-24.02.2-r1

Description

KWallet extension for signond

Added to portage

2024-04-26

spirv-llvm-translator - 18.1.0
Ebuild name:

dev-util/spirv-llvm-translator-18.1.0

Description

Bi-directional translator between SPIR-V and LLVM IR

Added to portage

2024-04-26

systemd - 254.11
Ebuild name:

sys-apps/systemd-254.11

Description

System and service manager for Linux

Added to portage

2024-04-26

systemd-utils - 254.11
Ebuild name:

sys-apps/systemd-utils-254.11

Description

Utilities split out from systemd for OpenRC users

Added to portage

2024-04-26

ugit - 0.4.4
Ebuild name:

app-shells/ugit-0.4.4

Description

PowerShell wrapper for git, automate repos and output git as objects

Added to portage

2024-04-26

vertico - 1.8
Ebuild name:

app-emacs/vertico-1.8

Description

Vertical interactive completion

Added to portage

2024-04-26

vivaldi-snapshot - 6.7.3329.16
Ebuild name:

www-client/vivaldi-snapshot-6.7.3329.16

Description

A browser for our friends

Added to portage

2024-04-26

weston - 13.0.0-r2
Ebuild name:

dev-libs/weston-13.0.0-r2

Description

Wayland reference compositor

Added to portage

2024-04-26

wpebackend-fdo - 1.14.2-r1
Ebuild name:

gui-libs/wpebackend-fdo-1.14.2-r1

Description

WPE backend designed for Linux desktop systems

Added to portage

2024-04-26

yubihsm-connector - 3.0.4
Ebuild name:

app-crypt/yubihsm-connector-3.0.4

Description

Server to expose YubiHSM 2 to network

Added to portage

2024-04-26

2024-04-25
PyQt-builder - 1.16.2
Ebuild name:

dev-python/PyQt-builder-1.16.2

Description

The PEP 517 compliant PyQt build system

Added to portage

2024-04-25

android-sdk-update-manager - 24.4.1-r2
Ebuild name:

dev-util/android-sdk-update-manager-24.4.1-r2

Description

Open Handset Alliance's Android SDK

Added to portage

2024-04-25

armadillo - 12.8.2
Ebuild name:

sci-libs/armadillo-12.8.2

Description

Streamlined C++ linear algebra library

Added to portage

2024-04-25

awscli - 1.32.91
Ebuild name:

app-admin/awscli-1.32.91

Description

Universal Command Line Environment for AWS

Added to portage

2024-04-25

bedtools - 2.31.1
Ebuild name:

sci-biology/bedtools-2.31.1

Description

Tools for manipulation and analysis of BED, GFF/GTF, VCF, SAM/BAM file

Added to portage

2024-04-25

bitstring - 4.2.1
Ebuild name:

dev-python/bitstring-4.2.1

Description

A pure Python module for creation and analysis of binary data

Added to portage

2024-04-25

black - 24.4.1
Ebuild name:

dev-python/black-24.4.1

Description

The uncompromising Python code formatter

Added to portage

2024-04-25

boto3 - 1.34.91
Ebuild name:

dev-python/boto3-1.34.91

Description

The AWS SDK for Python

Added to portage

2024-04-25

botocore - 1.34.91
Ebuild name:

dev-python/botocore-1.34.91

Description

Low-level, data-driven core of boto 3

Added to portage

2024-04-25

chrome-binary-plugins - 124.0.6367.78
Ebuild name:

www-plugins/chrome-binary-plugins-124.0.6367.78

Description

Binary plugins from Google Chrome for use in Chromi

Added to portage

2024-04-25

chrome-binary-plugins - 125.0.6422.14_beta
Ebuild name:

www-plugins/chrome-binary-plugins-125.0.6422.14_beta

Description

Binary plugins from Google Chrome for use in C

Added to portage

2024-04-25

chrome-binary-plugins - 126.0.6423.2_alpha
Ebuild name:

www-plugins/chrome-binary-plugins-126.0.6423.2_alpha

Description

Binary plugins from Google Chrome for use in C

Added to portage

2024-04-25

chromedriver-bin - 124.0.6367.78
Ebuild name:

www-apps/chromedriver-bin-124.0.6367.78

Description

WebDriver for Chrome

Added to portage

2024-04-25

chromium - 124.0.6367.78
Ebuild name:

www-client/chromium-124.0.6367.78

Description

Open-source version of Google Chrome web browser

Added to portage

2024-04-25

chromium - 125.0.6422.14
Ebuild name:

www-client/chromium-125.0.6422.14

Description

Open-source version of Google Chrome web browser

Added to portage

2024-04-25

commons-vfs - 2.0-r4
Ebuild name:

dev-java/commons-vfs-2.0-r4

Description

A single API for accessing various different file systems

Added to portage

2024-04-25

cproc - 0_pre20240413
Ebuild name:

sys-devel/cproc-0_pre20240413

Description

C11 compiler using QBE as backend

Added to portage

2024-04-25

dropbear - 2024.85
Ebuild name:

net-misc/dropbear-2024.85

Description

Small SSH 2 client/server designed for small memory environments

Added to portage

2024-04-25

email-validator - 1.1.0
Ebuild name:

net-misc/email-validator-1.1.0

Description

Basic syntax and deliverability checks on email addresses

Added to portage

2024-04-25

fcitx - 5.1.9
Ebuild name:

app-i18n/fcitx-5.1.9

Description

Fcitx 5 is a generic input method framework

Added to portage

2024-04-25

fcitx-chinese-addons - 5.1.5
Ebuild name:

app-i18n/fcitx-chinese-addons-5.1.5

Description

Addons related to Chinese, including IME previous bundled insid

Added to portage

2024-04-25

fcitx-configtool - 5.1.5
Ebuild name:

app-i18n/fcitx-configtool-5.1.5

Description

Configuration module for Fcitx

Added to portage

2024-04-25

fcitx-gtk - 5.1.3
Ebuild name:

app-i18n/fcitx-gtk-5.1.3

Description

Gtk im module for fcitx5 and glib based dbus client library

Added to portage

2024-04-25

fcitx-lua - 5.0.13
Ebuild name:

app-i18n/fcitx-lua-5.0.13

Description

Lua support for fcitx

Added to portage

2024-04-25

fcitx-table-extra - 5.1.5
Ebuild name:

app-i18n/fcitx-table-extra-5.1.5

Description

Provides extra table for Fcitx, including Boshiamy, Zhengma, Cangj

Added to portage

2024-04-25

fcitx-table-other - 5.1.2
Ebuild name:

app-i18n/fcitx-table-other-5.1.2

Description

Provides some other tables for Fcitx, fork from ibus-table-others,

Added to portage

2024-04-25

feathernotes - 1.2.0
Ebuild name:

app-text/feathernotes-1.2.0

Description

Lightweight Qt Notes-Manager for Linux

Added to portage

2024-04-25

feathernotes - 9999
Ebuild name:

app-text/feathernotes-9999

Description

Lightweight Qt Notes-Manager for Linux

Added to portage

2024-04-25

fwts - 24.03.00
Ebuild name:

sys-apps/fwts-24.03.00

Description

Firmware Test Suite

Added to portage

2024-04-25

geckodriver - 0.34.0
Ebuild name:

net-misc/geckodriver-0.34.0

Description

Proxy for using WebDriver clients to interact with Gecko-based browsers

Added to portage

2024-04-25

git - 2.45.0_rc1
Ebuild name:

dev-vcs/git-2.45.0_rc1

Description

Stupid content tracker distributed VCS designed for speed and efficiency

Added to portage

2024-04-25

gn - 0.2165
Ebuild name:

dev-build/gn-0.2165

Description

GN is a meta-build system that generates build files for Ninja

Added to portage

2024-04-25

gnuprologjava - 0.2.6-r2
Ebuild name:

dev-lang/gnuprologjava-0.2.6-r2

Description

GNU Prolog for Java is an implementation of ISO Prolog as a Java li

Added to portage

2024-04-25

google-chrome - 124.0.6367.78
Ebuild name:

www-client/google-chrome-124.0.6367.78

Description

The web browser from Google

Added to portage

2024-04-25

google-chrome-beta - 125.0.6422.14
Ebuild name:

www-client/google-chrome-beta-125.0.6422.14

Description

The web browser from Google

Added to portage

2024-04-25

google-chrome-unstable - 126.0.6423.2
Ebuild name:

www-client/google-chrome-unstable-126.0.6423.2

Description

The web browser from Google

Added to portage

2024-04-25

hwloc - 2.9.3-r1
Ebuild name:

sys-apps/hwloc-2.9.3-r1

Description

Displays the hardware topology in convenient formats

Added to portage

2024-04-25

importlib-resources - 6.4.0
Ebuild name:

dev-python/importlib-resources-6.4.0

Description

Read resources from Python packages

Added to portage

2024-04-25

intel_clc - 24.0.6
Ebuild name:

dev-util/intel_clc-24.0.6

Description

intel_clc tool used for building OpenCL C to SPIR-V

Added to portage

2024-04-25

intel_clc - 24.1.0_rc1
Ebuild name:

dev-util/intel_clc-24.1.0_rc1

Description

intel_clc tool used for building OpenCL C to SPIR-V

Added to portage

2024-04-25

interprolog - 2.1.2-r2
Ebuild name:

dev-lang/interprolog-2.1.2-r2

Description

InterProlog is a Java front-end and enhancement for Prolog

Added to portage

2024-04-25

libime - 1.1.7
Ebuild name:

app-i18n/libime-1.1.7

Description

Fcitx5 Next generation of fcitx

Added to portage

2024-04-25

libreswan - 5.0
Ebuild name:

net-vpn/libreswan-5.0

Description

IPsec implementation for Linux, fork of Openswan

Added to portage

2024-04-25

mesa - 24.0.6
Ebuild name:

media-libs/mesa-24.0.6

Description

OpenGL-like graphic library for Linux

Added to portage

2024-04-25

mesa - 24.1.0_rc1
Ebuild name:

media-libs/mesa-24.1.0_rc1

Description

OpenGL-like graphic library for Linux

Added to portage

2024-04-25

microsoft-edge - 124.0.2478.51
Ebuild name:

www-client/microsoft-edge-124.0.2478.51

Description

The web browser from Microsoft

Added to portage

2024-04-25

microsoft-edge-beta - 124.0.2478.51
Ebuild name:

www-client/microsoft-edge-beta-124.0.2478.51

Description

The web browser from Microsoft

Added to portage

2024-04-25

minidb - 2.0.8
Ebuild name:

dev-python/minidb-2.0.8

Description

Simple SQLite-based object store

Added to portage

2024-04-25

myodbc - 8.0.32
Ebuild name:

dev-db/myodbc-8.0.32

Description

ODBC driver for MySQL

Added to portage

2024-04-25

mypy - 1.10.0
Ebuild name:

dev-python/mypy-1.10.0

Description

Optional static typing for Python

Added to portage

2024-04-25

mysql - 8.0.36
Ebuild name:

dev-db/mysql-8.0.36

Description

A fast, multi-threaded, multi-user SQL database server

Added to portage

2024-04-25

nvidia-drivers - 550.40.61
Ebuild name:

x11-drivers/nvidia-drivers-550.40.61

Description

NVIDIA Accelerated Graphics Driver

Added to portage

2024-04-25

nvidia-drivers - 550.78
Ebuild name:

x11-drivers/nvidia-drivers-550.78

Description

NVIDIA Accelerated Graphics Driver

Added to portage

2024-04-25

opera - 109.0.5097.59
Ebuild name:

www-client/opera-109.0.5097.59

Description

A fast and secure web browser

Added to portage

2024-04-25

opera-developer - 111.0.5145.0
Ebuild name:

www-client/opera-developer-111.0.5145.0

Description

A fast and secure web browser

Added to portage

2024-04-25

passlib - 1.7.4-r3
Ebuild name:

dev-python/passlib-1.7.4-r3

Description

Password hashing framework supporting over 20 schemes

Added to portage

2024-04-25

pdm - 2.15.1
Ebuild name:

dev-python/pdm-2.15.1

Description

Python package and dependency manager supporting the latest PEP standards

Added to portage

2024-04-25

pdns-recursor - 5.0.4
Ebuild name:

net-dns/pdns-recursor-5.0.4

Description

The PowerDNS Recursor

Added to portage

2024-04-25

plantuml - 1.2024.4-r1
Ebuild name:

media-gfx/plantuml-1.2024.4-r1

Description

Draw UML diagrams using a simple and human readable text description

Added to portage

2024-04-25

pymongo - 4.7.0
Ebuild name:

dev-python/pymongo-4.7.0

Description

Python driver for MongoDB

Added to portage

2024-04-25

pypiserver - 2.1.1
Ebuild name:

dev-python/pypiserver-2.1.1

Description

Minimal PyPI server

Added to portage

2024-04-25

pytools - 2024.1.2
Ebuild name:

dev-python/pytools-2024.1.2

Description

Collection of tools missing from the Python standard library

Added to portage

2024-04-25

revive - 2.25
Ebuild name:

app-emacs/revive-2.25

Description

Resume Emacs

Added to portage

2024-04-25

selenium - 4.20.0
Ebuild name:

dev-python/selenium-4.20.0

Description

Python language binding for Selenium Remote Control

Added to portage

2024-04-25

stripe-mock - 0.185.0
Ebuild name:

dev-util/stripe-mock-0.185.0

Description

Mock HTTP server that responds like the real Stripe API

Added to portage

2024-04-25

sus - 0.25.0
Ebuild name:

dev-ruby/sus-0.25.0

Description

A fast and scalable test runner

Added to portage

2024-04-25

telegram-desktop-bin - 4.16.8
Ebuild name:

net-im/telegram-desktop-bin-4.16.8

Description

Official desktop client for Telegram (binary package)

Added to portage

2024-04-25

tifffile - 2024.4.24
Ebuild name:

dev-python/tifffile-2024.4.24

Description

Read and write TIFF files

Added to portage

2024-04-25

transformers - 4.36.2
Ebuild name:

sci-libs/transformers-4.36.2

Description

State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow

Added to portage

2024-04-25

uv - 0.1.38
Ebuild name:

dev-python/uv-0.1.38

Description

A Python package installer and resolver, written in Rust

Added to portage

2024-04-25

valgrind - 3.23.0_rc2
Ebuild name:

dev-debug/valgrind-3.23.0_rc2

Description

An open-source memory debugger for GNU/Linux

Added to portage

2024-04-25

xcb-imdkit - 1.0.8
Ebuild name:

x11-libs/xcb-imdkit-1.0.8

Description

Input method development support for xcb

Added to portage

2024-04-25

xor-analyze - 0.5-r1
Ebuild name:

app-crypt/xor-analyze-0.5-r1

Description

Program for cryptanalyzing xor 'encryption' with variable key length

Added to portage

2024-04-25

zoom - 6.0.2.4680
Ebuild name:

net-im/zoom-6.0.2.4680

Description

Video conferencing and web conferencing service

Added to portage

2024-04-25

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