Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering OpenVPN

You're reading from   Mastering OpenVPN Master building and integrating secure private networks using OpenVPN

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher Packt
ISBN-13 9781783553136
Length 364 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Authors (2):
Arrow left icon
Eric F Crist Eric F Crist
Author Profile Icon Eric F Crist
Eric F Crist
Jan Just Keijser Jan Just Keijser
Author Profile Icon Jan Just Keijser
Jan Just Keijser
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Introduction to OpenVPN FREE CHAPTER 2. Point-to-point Mode 3. PKIs and Certificates 4. Client/Server Mode with tun Devices 5. Advanced Deployment Scenarios in tun Mode 6. Client/Server Mode with tap Devices 7. Scripting and Plugins 8. Using OpenVPN on Mobile Devices and Home Routers 9. Troubleshooting and Tuning 10. Future Directions Index

Client-side routing


Sometimes, it is useful to allow the VPN server (or other VPN clients) to access resources connected to a particular client. This is known as client-side routing. Client-side routing in OpenVPN requires a CCD file for that client containing an iroute statement. It also requires a corresponding route statement in the OpenVPN server configuration file.

Consider the following network layout:

The subnet 192.168.4.0/24 needs to be accessible from the server-side LAN and the server-side subnet 192.168.122.0/24 needs to be accessible from the client-side LAN. This can be achieved as follows:

  1. Add two lines to the basic-udp-server.conf configuration file:

    client-config-dir /etc/openvpn/movpn/clients
    route 192.168.4.0 255.255.255.0 10.200.0.1

    Save it as movpn-04-05-server.conf.

  2. Create a CCD file client1 in the directory /etc/openvpn/movpn/clients with contents:

    ifconfig-push 10.200.0.99 255.255.255.0
    iroute 192.168.4.0 255.255.255.0
    push “route 192.168.122.0 255.255.255.0”
  3. Ensure that...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime