Using a client-side up/down script
In this recipe, we will use very simple up
and down
scripts on the client side to show how OpenVPN calls these scripts. By logging messages to a file, as well as the environment variables, we can easily see which information OpenVPN provides to the up
and down
scripts.
Getting ready
Set up the client and server certificates using the Setting up the public and private keys recipe from Chapter 2, Client-server IP-only Networks. For this recipe, the server computer was running Fedora 22 Linux and OpenVPN 2.3.10. The client was running Windows 7 64 bit and OpenVPN 2.3.10. Keep the server configuration file, basic-udp-server.conf
, from the Server-side routing recipe, from Chapter 2, Client-server IP-only Networks.
How to do it...
Start the server:
[root@server]# openvpn --config basic-udp-server.conf
Create the client configuration file:
      client     proto udp     remote openvpnserver.example.com     port 1194     dev...