Book Image

OpenVPN 2 Cookbook

Book Image

OpenVPN 2 Cookbook

Overview of this book

Table of Contents (19 chapters)
OpenVPN 2 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Routing: subnets on both sides


This recipe will demonstrate how to set up server-side and client-side routing in client/server mode. With this setup, the OpenVPN client will be able to reach all machines behind the OpenVPN server and the server will be able to reach all machines behind the client.

Getting ready

We use the following network layout:

This recipe uses the PKI files created in the first recipe of this chapter. For this recipe, the server computer was running CentOS 5 Linux and OpenVPN 2.1.1 and the client was running Fedora 13 Linux and OpenVPN 2.1.1. Keep the server configuration file, basic-udp-server.conf, as well as the client configuration file, basic-udp-client.conf, from the recipe Server-side routing at hand.

How to do it...

  1. Modify the server configuration file, basic-udp-server.conf, by adding the lines:

        client-config-dir /etc/openvpn/cookbook/clients
        route 192.168.4.0 255.255.255.0 192.168.200.1
    

    Then save it as example2-5-server.conf.

  2. Next, create the directory for...