openvpn_debian
Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
| Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
| openvpn_debian [2014/06/28 10:23] – silenx | openvpn_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 / | ||
| - | # 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\\ | ||
| - | </ | ||
| - | Aggiornate il vostro sistema\\ | ||
| - | <WRAP round box 60%> | ||
| - | apt-get update\\ | ||
| - | apt-get upgrade\\ | ||
| - | apt-get dist-upgrade\\ | ||
| - | </ | ||
| - | Verificate il supporto all' | ||
| - | <WRAP round box> | ||
| - | test ! -c / | ||
| - | </ | ||
| - | Installate OpenVPN\\ | ||
| - | <WRAP round box> | ||
| - | apt-get install openvpn\\ | ||
| - | </ | ||
| - | Impostare Easy RSA\\ | ||
| - | <WRAP round box> | ||
| - | cp -prv / | ||
| - | cd / | ||
| - | cp vars{, | ||
| - | </ | ||
| - | Impostate i valori di default di Easy-RSA\\ | ||
| - | <WRAP round box 60%> | ||
| - | nano ./vars\\ | ||
| - | KEY_SIZE=2048\\ | ||
| - | KEY_COUNTRY=" | ||
| - | KEY_PROVINCE=" | ||
| - | KEY_CITY=" | ||
| - | KEY_ORG=" | ||
| - | KEY_EMAIL=" | ||
| - | </ | ||
| - | Esportate i valori\\ | ||
| - | <WRAP round box 60%> | ||
| - | source ./vars\\ | ||
| - | </ | ||
| - | Eliminate tutti i certificati precedentemente creati ( non dovrebbe essere il nostro caso )\\ | ||
| - | <WRAP round box 60%> | ||
| - | ./ | ||
| - | </ | ||
| - | Generare il certificato CA\\ | ||
| - | <WRAP round box 60%> | ||
| - | ./ | ||
| - | </ | ||
| - | Generare il certificato del server\\ | ||
| - | <WRAP round box 60%> | ||
| - | ./ | ||
| - | Sign the certificate? | ||
| - | 1 out of 1 certificate requests certified, commit? [y/n]y\\ | ||
| - | </ | ||
| - | Generare il certificato PEM Diffie-Hellman | ||
| - | <WRAP round box 60%> | ||
| - | ./ | ||
| - | </ | ||
| - | Generare il certificato per il client\\ | ||
| - | <WRAP round box 60%> | ||
| - | ./build-key tuodevicename \\ | ||
| - | Sign the certificate? | ||
| - | 1 out of 1 certificate requests certified, commit? [y/n]y\\ | ||
| - | </ | ||
| - | Generare l'HMAC ( Hash-based Message Authentication Code ) \\ | ||
| - | <WRAP round box 60%> | ||
| - | openvpn --genkey --secret / | ||
| - | </ | ||
| - | 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**__, | ||
| - | Il client necessita di: __**client.crt**__ (public), __**client.key**__ and __**ta.key**__ (privata)\\ | ||
| - | |||
| - | Spostare i certificati\\ | ||
| - | < | ||
| - | mkdir -p / | ||
| - | cp -pv / | ||
| - | </ | ||
| - | === Configurazione Server OpenVPN: === | ||
| - | Configurare il file : / | ||
| - | < | ||
| - | port 1194 | ||
| - | proto udp | ||
| - | dev tun | ||
| - | ca / | ||
| - | cert / | ||
| - | key / | ||
| - | dh / | ||
| - | tls-auth / | ||
| - | 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 " | ||
| - | push " | ||
| - | push " | ||
| - | |||
| - | 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 | ||
| - | </ | ||
| - | === Inizializzare il Servizio === | ||
| - | < | ||
| - | service openvpn restart | ||
| - | update-rc.d -f openvpn defaults | ||
| - | </ | ||
| - | === Abilitare il forwarding e impostare iptables === | ||
| - | < | ||
| - | impostare la seguente direttiva nel file / | ||
| - | net.ipv4.ip_forward = 1 | ||
| - | ( solitamente la direttiva è commentata o a 0 ) | ||
| - | eseguire: sysctl -p | ||
| - | </ | ||
| - | == Iptables == | ||
| - | < | ||
| - | iptables -A INPUT -p udp -m state --state NEW -m udp --dport 1194 -j ACCEPT | ||
| - | iptables -A FORWARD -s 172.16.0.0/ | ||
| - | iptables -A FORWARD -m state --state RELATED, | ||
| - | iptables -t nat -A POSTROUTING -s 172.16.0.0/ | ||
| - | |||
| - | |||
| - | iptables-save > / | ||
| - | </ | ||
| - | Impostare il caricamento delle regole in avvio:\\ | ||
| - | < | ||
| - | Inserire in / | ||
| - | ## Load Iptables Rules for OpenVpn | ||
| - | test -e / | ||
| - | </ | ||
| - | === Configurazione Client === | ||
| - | < | ||
| - | client | ||
| - | remote silenx.ns0.it | ||
| - | ca | ||
| - | cert hackintosh.crt | ||
| - | key hackintosh.key | ||
| - | cipher DES-EDE3-CBC | ||
| - | comp-lzo yes | ||
| - | dev tun | ||
| - | proto udp | ||
| - | tls-auth ta.key 1 | ||
| - | nobind | ||
| - | auth-nocache | ||
| - | script-security 2 | ||
| - | persist-key | ||
| - | persist-tun | ||
| - | user nobody | ||
| - | group nogroup | ||
| - | keepalive 10 60 | ||
| - | </ | ||
openvpn_debian.1403943808.txt.gz · Ultima modifica: (modifica esterna)
