]> git.deb.at Git - debienna.git/blobdiff - OpenVPN/index.mdwn
stuff
[debienna.git] / OpenVPN / index.mdwn
index 9371d438c9295f57e5ef7ad6879dc3a7bf3f51b1..7d4d6e3cf79b0effa34b3ab739b8feba081db9ed 100644 (file)
@@ -1,11 +1,12 @@
+
 Sample Configs für OpenVPN mit NAT für inet (redirect-gateway) auf einem Internet Server (+ OpenVZ)
 
 OpenVPN Sampe Server Config:
-{{{
+[[!format txt """
 port 1194
 
-proto tcp 
-dev tun 
+proto tcp
+dev tun
 tls-server
 server 192.168.50.0 255.255.255.240 # NETZ ÄNDERN JE NACH BEDARF!
 
@@ -18,7 +19,7 @@ dh /etc/openvpn/certs/dh2048.pem
 #push "route 192.168.0.0 255.255.255.192"
 #push "dhcp-option DNS 192.168.50.3"
 
-#keepalive 10 120 
+#keepalive 10 120
 
 auth SHA1
 
@@ -28,17 +29,16 @@ group root
 persist-key
 persist-tun
 
-verb 3 
+verb 3
 comp-lzo
 client-to-client
 status /etc/openvpn/openvpn-status.log
 log-append /var/log/openvpn.log
-}}}
-
+"""]]
 Client Sample Config:
-{{{
+[[!format txt """
 client
-dev tup 
+dev tup
 proto tcp-client
 remote example.net
 resolv-retry infinite
@@ -51,14 +51,12 @@ cert certs/<USER>_cert_vpn.pem
 key certs/<USER>_key_vpn.pem
 comp-lzo
 verb 0
-port 143 
+port 143
 #tls-remote VPNServer
 persist-local-ip
-}}}
-
-
+"""]]
 Zertifikate bauen: (common name muss wie der Host heißen!)
-{{{
+[[!format txt """
 #!/bin/bash
 
 
@@ -89,10 +87,9 @@ echo ""
 
 echo "Client Certs mit folgendem Commando vorbereiten:"
 echo "./clientcerts "
-}}}
-
+"""]]
 Clientcerts
-{{{
+[[!format txt """
 #!/bin/bash
 
 
@@ -109,11 +106,9 @@ echo "CSR Cert loeschen..."
 rm $1_csr_vpn.pem
 echo "Clientcert $1_cert_vpn.pem und Clientkey $1_key_vpn.pem erstellt..."
 cd ..
-}}}
-
-
+"""]]
 iptables für routing:
-{{{
+[[!format txt """
 #!/bin/bash
 
 case $1 in
@@ -142,7 +137,7 @@ iptables -t nat -A POSTROUTING -o $VPNDEV -j MASQUERADE
 iptables -A INPUT -i $VPNDEV -s $VPNLAN -j ACCEPT
 iptables -A FORWARD -i $VPNDEV -o $EXTDEV -s $VPNLAN -j ACCEPT
 iptables -A FORWARD -i $EXTDEV -o $VPNDEV -d $VPNLAN -m state --state RELATED,ESTABLISHED -j ACCEPT
-iptables -t nat -A POSTROUTING -s $VPNLAN -o $EXTDEV -j SNAT --to-source <IP DES SERVERS> 
+iptables -t nat -A POSTROUTING -s $VPNLAN -o $EXTDEV -j SNAT --to-source <IP DES SERVERS>
 ;;
 
 restart)
@@ -150,4 +145,4 @@ $0 stop && $0 start
 ;;
 
 esac
-}}}
\ No newline at end of file
+"""]]
\ No newline at end of file