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)
OpenVPN
Credits
About the Author
About the Reviewers
Preface
Index

Using OpenVPN at the Command Line


In the course of this book we have already invoked openvpn several times from a command line. As a first example, we built a tunnel with a pre-shared key and a rather simple configuration file. Even though there are some other parameters set in the standard configuration file we used, the easiest command to start a tunnel with a static key is:

debian01:/etc/openvpn# openvpn --remote <IP of System B> --dev tun1 --ifconfig 10.3.0.1 10
.3.0.2 --secret /etc/openvpn/key.txt 

You see, it's very easy to connect two systems with an openvpn tunnel, when we know their IPs. All we need is a pre-shared key, a tunnel IP, and a decision on which device type to use.

If the second tunnel endpoint is a Linux system already provided with the pre-shared key /etc/openvpn/key.txt, then all we need to do to start our tunnel is enter the aforementioned command on system A, and enter the following command on system B:

/etc/openvpn# openvpn --remote <IP of System A>...