| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,60 @@ |
| 0 |
+# rough history from wilk - need to cleanup |
|
| 1 |
+apt-get install -y openvpn bridge-utils |
|
| 2 |
+cp -R /usr/share/doc/openvpn/examples/easy-rsa/2.0/ /etc/openvpn/easy-rsa/ |
|
| 3 |
+cd /etc/openvpn/easy-rsa |
|
| 4 |
+source vars |
|
| 5 |
+./clean-all |
|
| 6 |
+./build-dh |
|
| 7 |
+./pkitool --initca |
|
| 8 |
+./pkitool --server server |
|
| 9 |
+./pkitool client1 |
|
| 10 |
+cd keys |
|
| 11 |
+openvpn --genkey --secret ta.key ## Build a TLS key |
|
| 12 |
+cp server.crt server.key ca.crt dh1024.pem ta.key ../../ |
|
| 13 |
+cd ../../ |
|
| 14 |
+ |
|
| 15 |
+cat >/etc/openvpn/server.conf <<EOF |
|
| 16 |
+duplicate-cn |
|
| 17 |
+port 6081 |
|
| 18 |
+proto tcp |
|
| 19 |
+dev tun |
|
| 20 |
+ca ca.crt |
|
| 21 |
+cert server.crt |
|
| 22 |
+key server.key # This file should be kept secret |
|
| 23 |
+dh dh1024.pem |
|
| 24 |
+server 172.16.28.0 255.255.255.0 |
|
| 25 |
+ifconfig-pool-persist ipp.txt |
|
| 26 |
+push "route 10.0.0.0 255.255.255.224" |
|
| 27 |
+comp-lzo |
|
| 28 |
+persist-key |
|
| 29 |
+persist-tun |
|
| 30 |
+status openvpn-status.log |
|
| 31 |
+EOF |
|
| 32 |
+/etc/init.d/openvpn restart |
|
| 33 |
+ |
|
| 34 |
+echo Use the following ca for your client: |
|
| 35 |
+cat /etc/openvpn/ca.crt |
|
| 36 |
+ |
|
| 37 |
+echo |
|
| 38 |
+echo Use the following cert for your client |
|
| 39 |
+cat /etc/openvpn/easy-rsa/keys/client1.crt |
|
| 40 |
+echo |
|
| 41 |
+echo Use the following key for your client |
|
| 42 |
+cat /etc/openvpn/easy-rsa/keys/client1.key |
|
| 43 |
+echo |
|
| 44 |
+echo Use the following client config: |
|
| 45 |
+cat <<EOF |
|
| 46 |
+ca ca.crt |
|
| 47 |
+cert client.crt |
|
| 48 |
+key client.key |
|
| 49 |
+client |
|
| 50 |
+dev tun |
|
| 51 |
+proto tcp |
|
| 52 |
+remote 50.56.12.212 6081 |
|
| 53 |
+resolv-retry infinite |
|
| 54 |
+nobind |
|
| 55 |
+persist-key |
|
| 56 |
+persist-tun |
|
| 57 |
+comp-lzo |
|
| 58 |
+verb 3 |
|
| 59 |
+EOF |