Strumenti Utente

Strumenti Sito


openvpn_debian

Differenze

Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.

Link a questa pagina di confronto

Entrambe le parti precedenti la revisioneRevisione precedente
Prossima revisione
Revisione precedente
openvpn_debian [2014/06/28 10:21] silenxopenvpn_debian [Data sconosciuta] (versione attuale) – eliminata - modifica esterna (Data sconosciuta) 127.0.0.1
Linea 1: Linea 1:
-Installate Debian 7.5, con solo il server SSH.\\ 
-Configurate un IP statico come segue\\ 
-<WRAP round box 60%> 
-da root: 
-nano /etc/network/interfaces \\ 
-# The primary network interface\\ 
-allow-hotplug eth0\\ 
-iface eth0 inet static\\ 
-address 192.168.1.13\\ 
-netmask 255.255.255.128\\ 
-gateway 192.168.1.1\\ 
-dns-nameservers 192.168.1.7 192.168.1.1\\ 
-</WRAP> 
-Aggiornate il vostro sistema\\ 
-<WRAP round box 60%> 
-apt-get update\\ 
-apt-get upgrade\\ 
-apt-get dist-upgrade\\ 
-</WRAP> 
-Verificate il supporto all'interfaccia TUN\\ 
-<WRAP round box> 
-test ! -c /dev/net/tun && echo openvpn requires tun support || echo tun is available\\ 
-</WRAP> 
-Installate OpenVPN\\ 
-<WRAP round box> 
-apt-get install openvpn\\ 
-</WRAP> 
-Impostare Easy RSA\\ 
-<WRAP round box> 
-cp -prv /usr/share/doc/openvpn/examples/easy-rsa/2.0 /root/easy-rsa\\ 
-cd /root/easy-rsa\\ 
-cp vars{,.orig}\\ 
-</WRAP> 
-Impostate i valori di default di Easy-RSA\\ 
-<WRAP round box 60%> 
-nano ./vars\\ 
-KEY_SIZE=2048\\ 
-KEY_COUNTRY="IT"\\ 
-KEY_PROVINCE="ER"\\ 
-KEY_CITY="Citta"\\ 
-KEY_ORG="la via"\\ 
-KEY_EMAIL="email@dominio.tld"\\ 
-</WRAP> 
-Esportate i valori\\ 
-<WRAP round box 60%> 
-source ./vars\\ 
-</WRAP> 
-Eliminate tutti i certificati precedentemente creati ( non dovrebbe essere il nostro caso )\\ 
-<WRAP round box 60%> 
-./clean-all\\ 
-</WRAP> 
-Generare il certificato CA\\ 
-<WRAP round box 60%> 
-./build-ca\\ 
-</WRAP> 
-Generare il certificato del server\\ 
-<WRAP round box 60%> 
-./build-key-server nomedelserver\\ 
-Sign the certificate? [y/n]:y\\ 
-1 out of 1 certificate requests certified, commit? [y/n]y\\ 
-</WRAP> 
-Generare il certificato PEM Diffie-Hellman 
-<WRAP round box 60%> 
-./build-dh\\ 
-</WRAP> 
-Generare il certificato per il client\\ 
-<WRAP round box 60%> 
-./build-key tuodevicename \\ 
-Sign the certificate? [y/n]:y\\ 
-1 out of 1 certificate requests certified, commit? [y/n]y\\ 
-</WRAP> 
-Generare l'HMAC ( Hash-based Message Authentication Code ) \\ 
-<WRAP round box 60%> 
-openvpn --genkey --secret /root/easy-rsa/keys/ta.key 
-</WRAP> 
-Distribuire i certificati\\ 
-\\ 
-Note sui certificati:\\ 
-Il certificato pubblico __**ca.crt**__ è necessario sia sui server che sui client\\ 
-La chiave segreta __**ca.key**__ key è necessaria solo sulla macchina che ha generato la chiave\\ 
-Il server necessita di: __**server.crt**__, __**dh2048.pem**__ (publicca), __**server.key**__ and __**ta.key**__ (privata)\\ 
-Il client necessita di: __**client.crt**__ (public), __**client.key**__ and __**ta.key**__ (privata)\\ 
  
- 
-Spostare i certificati\\ 
-<code> 
-mkdir -p /etc/openvpn/certs 
-cp -pv /root/easy-rsa/keys/{ca.{crt,key},neutron.{crt,key},ta.key,dh2048.pem} /etc/openvpn/certs/ 
-</code> 
-=== Configurazione Server OpenVPN: === 
-Configurare il file : /etc/openvpn/server.conf\\ 
-<code> 
-port 1194                                                                                                                                                                                                                                                          
-proto udp                                                                                                                                                                                                                                                          
-dev tun                                                                                                                                                                                                                                                            
-ca /etc/openvpn/certs/ca.crt                                                                                                                                                                                                                                       
-cert /etc/openvpn/certs/openvpn.crt                                                                                                                                                                                                                                
-key /etc/openvpn/certs/openvpn.key                                                                                                                                                                                                                                 
-dh /etc/openvpn/certs/dh2048.pem 
-tls-auth /etc/openvpn/certs/ta.key 0 
-server 172.16.0.0 255.255.255.0 
-ifconfig-pool-persist ipp.txt 
-push "route 192.168.1.0 255.255.255.128" 
-push "dhcp-option DNS 192.168.1.7" 
-push "dhcp-option DNS 192.168.1.1" 
-push "dhcp-option WINS 192.168.1.7" 
- 
-topology subnet 
- 
-client-to-client 
-keepalive 10 60 
-cipher DES-EDE3-CBC 
-comp-lzo 
-max-clients 5 
-user nobody 
-group nogroup 
-persist-key 
-persist-tun 
- 
-mssfix 1300 
-#log openvpn.log 
-status openvpn-status.log 
-verb 5 
-mute 20 
-</code> 
-=== Inizializzare il Servizio === 
-<code> 
-service openvpn restart 
-update-rc.d -f openvpn defaults 
-</code> 
-=== Abilitare il forwarding e impostare iptables === 
-<code> 
-impostare la seguente direttiva nel file /etc/sysctl.conf 
-net.ipv4.ip_forward = 1 
-( solitamente la direttiva è commentata o a 0 ) 
-eseguire: sysctl -p 
-</code> 
-== Iptables == 
-<code> 
-iptables -A INPUT -p udp -m state --state NEW -m udp --dport 1194 -j ACCEPT 
-iptables -A FORWARD -s 172.16.0.0/24 -j ACCEPT 
-iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT 
-iptables -t nat -A POSTROUTING -s 172.16.0.0/24 -o eth0 -j MASQUERADE 
- 
- 
-iptables-save > /etc/iptables.rules 
-</code> 
-Impostare il caricamento delle regole in avvio:\\ 
-<code> 
-Inserire in /etc/rc.local : 
-## Load Iptables Rules for OpenVpn 
-test -e /etc/iptables.rules && iptables-restore -c /etc/iptables.rules 
-</code> 
-=== Configurazione Client === 
openvpn_debian.1403943690.txt.gz · Ultima modifica: (modifica esterna)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki