Book Image

OpenVPN: Building and Integrating Virtual Private Networks

Book Image

OpenVPN: Building and Integrating Virtual Private Networks

Overview of this book

OpenVPN is a powerful, open source SSL VPN application. It can secure site-to-site connections, WiFi and enterprise-scale remote connections. While being a full-featured VPN solution, OpenVPN is easy to use and does not suffer from the complexity that characterizes other IPSec VPN implementations. It uses the secure and stable TLS/SSL mechanisms for authentication and encryption. This book is an easy introduction to this popular VPN application. After introducing the basics of security and VPN, the book moves on to cover using OpenVPN, from installing it on various platforms, through configuring basic tunnels, to more advanced features, such as using the application with firewalls, routers, proxy servers, and OpenVPN scripting. While providing only necessary theoretical background, the book takes a practical approach, presenting plenty of examples.
Table of Contents (17 chapters)
About the Author
About the Reviewers

Scripting OpenVPN—An Overview

Another striking option of OpenVPN is its scripting capabilities. We can create our own scripts and have them called on changes of the connection state. This makes it easy to execute a special (e.g. Firewall) script any time a client connects or on similar occasions. There's almost no limit; I leave it up to you to imagine the possibilities.

The following table gives an overview over the possible interfaces where OpenVPN can be forced to execute arbitrary scripts:



--learn-address <cmd>

When the IP of a VPN partner changes

--ipchange <cmd>

When the IP of the server has changed

--client-connect <cmd>

When a client connects

--client-disconnect <cmd>

When a client disconnects

--up <cmd>, down <cmd>

After configuration (up = starting, down = stopping) of the TUN/TAP device


Before shutting down the TUN/TAP device


When tunnels are restarted, up/down scripts are also executed...