From 2969c701a05f2f2f6d6a2a0739fc2c19e4f60782 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sat, 24 Sep 2011 12:31:57 -0700 Subject: [PATCH 1/2] initial commit of wilks work --- tools/install_openvpn.sh | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 tools/install_openvpn.sh diff --git a/tools/install_openvpn.sh b/tools/install_openvpn.sh new file mode 100644 index 0000000..3b52cf1 --- /dev/null +++ b/tools/install_openvpn.sh @@ -0,0 +1,60 @@ +# rough history from wilk - need to cleanup +apt-get install -y openvpn bridge-utils +cp -R /usr/share/doc/openvpn/examples/easy-rsa/2.0/ /etc/openvpn/easy-rsa/ +cd /etc/openvpn/easy-rsa +source vars +./clean-all +./build-dh +./pkitool --initca +./pkitool --server server +./pkitool client1 +cd keys +openvpn --genkey --secret ta.key ## Build a TLS key +cp server.crt server.key ca.crt dh1024.pem ta.key ../../ +cd ../../ + +cat >/etc/openvpn/server.conf < Date: Tue, 27 Sep 2011 12:57:53 -0500 Subject: [PATCH 2/2] Major refactor of vpn install --- tools/install_openvpn.sh | 174 ++++++++++++++++++++++++++++++--------- 1 file changed, 134 insertions(+), 40 deletions(-) diff --git a/tools/install_openvpn.sh b/tools/install_openvpn.sh index 3b52cf1..a3a2346 100644 --- a/tools/install_openvpn.sh +++ b/tools/install_openvpn.sh @@ -1,60 +1,154 @@ -# rough history from wilk - need to cleanup -apt-get install -y openvpn bridge-utils -cp -R /usr/share/doc/openvpn/examples/easy-rsa/2.0/ /etc/openvpn/easy-rsa/ -cd /etc/openvpn/easy-rsa -source vars -./clean-all -./build-dh -./pkitool --initca -./pkitool --server server -./pkitool client1 -cd keys -openvpn --genkey --secret ta.key ## Build a TLS key -cp server.crt server.key ca.crt dh1024.pem ta.key ../../ -cd ../../ +#!/bin/bash +# install_openvpn.sh - Install OpenVPN and generate required certificates +# +# install_openvpn.sh --client name +# install_openvpn.sh --server [name] +# +# name is used on the CN of the generated cert, and the filename of +# the configuration, certificate and key files. +# +# --server mode configures the host with a running OpenVPN server instance +# --client mode creates a tarball of a client configuration for this server -cat >/etc/openvpn/server.conf <$VPN_DIR/$NAME.conf <$TMP_DIR/$HOST.conf <$VPN_DIR/hostname + fi + do_server $NAME + ;; + --clean) $CA_DIR/clean-all + ;; + *) usage +esac