OpenVPN with Nabilo 06 version p2p (2 alone DreamBoxes)
English: (translation by Joy_Fun_Man)
Installation Openvpn on Nabilo 06:
This is needed only for Nabilosat DM7000 image because Openvpn is fully included in Nabilosat DM7020 nfi Image:
Unload and install, from the panel download addons, the plugin Nabilosat OpenVPN plugin 01 for Nabilosat v. 06 Plus.
After to have installed, open the door of the router 1194 udp and join it to the IP of the dream.
Then, between the plugins (yellow yellow) you will find your plugin for the OpenVPN.
The plugin of the nabilo with the order start, do the START of the VPN with the configuration that reads in the folder
/var/etc/openvpn/
N.B. to be able to work in this folder must be only one file with extension. conf
Configuration connection to 2 DreamBoxes p2p
The Dream that will do server, for example, must have only one file with extension conf, that will be called serverp2p.conf
While the Dream that will do client must have only one file with extension conf, that will be called client. conf
Generation of personal authentication key (in the folder you find yourselves already a file with authentication key that it is called test. key and is within the folder /var/etc/openvpn/key/)
To create an authentication key file from telnet, perform the order
/var/sbin/openvpn --genkey --secret /var/etc/openvpn/keys/xxxx.key
this command will create a new key called xxxx where xxxx will be the name that you want to give your key. The file xxx. key should be copied in secure manner also on the Dream client.
So a copy of the file generated (every time that I give the order, you will generate a new key from 1024 random) should reside in both the Dreams.
File config for serverp2p (serverp2p.conf)
Code:
# openvpn config per server p2p
# serverp2p.conf
#
# set the door of communication on the door 1194
port 1194
# assign to server the ip 10.8.0.1 and to client 10.8.0.2
ifconfig 10.8.0.1 10.8.0.2
# the type of detail of the log
verb 5
#assign tun like device for the vpn
dev tun0
# authentication file
secret /var/etc/openvpn/keys/prova.key
# creates a file of log
log-append /var/etc/openvpn/openvpn.log
prova.key should correspond to your file xxxx.key (as seen above).
If everything is set properly, we are able from remote control to give the order start choosing start from the combo and pressing the green key to perform the order.
in the Dream that it will do the client p2p, instead we should create a file of config type as this:
Configuration file clientp2p.conf
Code:
# openvpn config for client p2p
# clientp2p.conf
#
# address of the server
remote xxxx.no-ip.org
# set the door of communication on the door 1194
port 1194
# assign to client 10.8.0.2 and to server the ip 10.8.0.1
ifconfig 10.8.0.2 10.8.0.1
#assign the type of detail of the log
verb 5
# assign tun like device for the vpn
dev tun0
# authentication file
secret /var/etc/openvpn/keys/prova.key
# creates a file of log
log-append /var/etc/openvpn/openvpn.log
Now, we are able to start, from remote control, also our VPN in the Dream client.
If all it works the Dream server will see the Dream client with ip 10.8.0.2,while the client will see the server like 10.8.0.1 and the vpn will have added a route for channel the requests to the ip 10.8.0.2 towards the device tun, in fact giving route and ping we will get the following result
Code:
root@dreambox:/var/etc/openvpn> route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.8.0.2 * 255.255.255.255 UH 0 0 0 tun0
192.168.62.0 * 255.255.255.0 U 0 0 0 eth0
default DSL302.Netservi 0.0.0.0 UG 0 0 0 eth0
root@dreambox:/var/etc/openvpn> ping 10.8.0.2
PING 10.8.0.2 (10.8.0.2): 56 data bytes
64 bytes from 10.8.0.2: icmp_seq=0 ttl=64 time=95.8 ms
64 bytes from 10.8.0.2: icmp_seq=1 ttl=64 time=6.4 ms
--- 10.8.0.2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 6.4/51.1/95.8 ms
Notes well: If you test a machine inside or outside FASTWEB, the server machine must be outside the FASTWEB
To next tutorial with server for multi clients
Hello
PieFav
__________________
**************************************
French by Franjuve:
OpenVPN con Nabilo 06 versione p2p (2 macchine solo)
how to OpenVPN original in italian by PieFav
traduit en français par franzjuve Nabilosat-Team
OpenVPN avec Nabilo V0.6 p2p (2 machine seulement)
Installation OpenVPN sur Nabilo v0.6:
This is needed only for Nabilosat DM7000 image because Openvpn is fully included in Nabilosat DM7020 nfi Image:
Téléchargez et installez via le panel addons download , le Plugin Nabilosat OpenVPN 01 pour la Nabilosat v0.6.
aprés l'avoir installé , ouvrez la porte 1194 en UDP sur votre routeur et mettez-y l'IP de votre Dreambox.
a present , pressez 2x le bouton jaune pour voire apparaitre votre plugin OpenVPN parmis la liste des plugins.
pour demarrer le plugin Nabilo OpenVPN , pressez le bouton start , le VPN demarrera avec la configuration qui se trouve dans le repertoire
/var/etc/openvpn/
N.B. Pour que le Plugin puisse fonctionner en utilisant ce repertoire , il devra toujours y avoir qu'un seul fichier avec extension .conf
Configuration connexion avec 2 machines P2P
La machine qui sera serveur aura par exemple l'unique fichier avec extension conf qui s'appellera serverp2p.conf
La machine client aura un fichier unique avec extension conf qui s'appellera client.conf
Generer une clé d'authentification personnelle ( dans le repertoire /var/etc/openvpn/key/ , vous trouverez déja un fichier nomer prova.key avec une clé d'authentification )
Pour créer un fichier clé d'authentification via telnet , tappez la commande suivante
/var/sbin/openvpn --genkey --secret /var/etc/openvpn/keys/xxxx.key
Cette commande créera une nouvelle clé appellée xxxx d'ou xxxx sera le nom que vous voulez donner a votre clé.
le fichier xxx.key devra etre copier de maniere sure aussi sur la machine cliente.
donc une copie du fichier générer ( chaque fois que je tappe la commande , il me genere une clé de 1024 random ) elle devra residée sur chaque machines
Fichier config pour serverp2p (serverp2p.conf)
Code:
# openvpn config per server p2p
# serverp2p.conf
#
# imposta la porta di comunicazione sulla porta 1194
port 1194
# assegna al server l'ip 10.8.0.1 e al client 10.8.0.2
ifconfig 10.8.0.1 10.8.0.2
#assegnamo il tipo di dettaglio della log
verb 5
#assegnamo tun come device per la vpn
dev tun0
# file si autenticazione
secret /var/etc/openvpn/keys/prova.key
#crea un file di log
log-append /var/etc/openvpn/openvpn.log
prova.key devra correspondre a votre fichier xxxx.key (deja vu plus haut)
Quand tout est preparer , vous pouvez via la telecommande executer la commande start en selectionnant celle-ci et pressez le bouton vert pour demarrer la commande.
Sur la machine qui sera cliente p2p , vouz devrez crée un fichier config de ce type :
Fichier de configuration clientp2p.conf
Code:
# openvpn config per client p2p
# clientp2p.conf
#
# indirizzo del server da raggiungere
remote xxxx.no-ip.org
# imposta la porta di comunicazione sulla porta 1194
port 1194
# assegna al client 10.8.0.2 e al server l'ip 10.8.0.1
ifconfig 10.8.0.2 10.8.0.1
#assegnamo il tipo di dettaglio della log
verb 5
#assegnamo tun come device per la vpn
dev tun0
# file si autenticazione
secret /var/etc/openvpn/keys/prova.key
#crea un file di log
log-append /var/etc/openvpn/openvpn.log
prova.key devra correspondre a votre fichier xxxx.key (deja vu plus haut).
désormais vous pouvez aussi demarré via la telecommande votre machine VPN cliente.
Si tout fonctionne , la machine serveur vera la machine cliente avec l'IP 10.8.0.2 , et la cliente vera le serveur avec l'IP 10.8.0.1 et le VPN aura ajouté une route pour cannaliser les demandes de l'IP 10.8.0.2
vers les device tun, en effet en donnant route et ping nous obtiendrons le suivant résultat
Code:
root@dreambox:/var/etc/openvpn> route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.8.0.2 * 255.255.255.255 UH 0 0 0 tun0
192.168.62.0 * 255.255.255.0 U 0 0 0 eth0
default DSL302.Netservi 0.0.0.0 UG 0 0 0 eth0
root@dreambox:/var/etc/openvpn> ping 10.8.0.2
PING 10.8.0.2 (10.8.0.2): 56 data bytes
64 bytes from 10.8.0.2: icmp_seq=0 ttl=64 time=95.8 ms
64 bytes from 10.8.0.2: icmp_seq=1 ttl=64 time=6.4 ms
--- 10.8.0.2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 6.4/51.1/95.8 ms
__________________
**************************************
Italian Original by Piefav:
Configurazione connessione a 2 macchie p2p
La macchina che farà da server per esempio avrà l'unico file con estensione conf che si chiamerà serverp2p.conf
Mentre la macchina che farà da client avrà un unico file con estensione conf che si chiamerà client.conf
Generazione kiave di autenticazione personale ( nella cartella vi trovate già un file con chiave di autenticazione che si chiama prova.key ed è dentro la cartella /var/etc/openvpn/key/)
Per creare un file di autenticazione personale da telnet eseguite il comando
/var/sbin/openvpn --genkey --secret /var/etc/openvpn/keys/xxxx.key
questo comando creerà una chiave nuova chiata xxxx dove xxxx sarà il nome che volete dare alla vostra chiave.
Il file xxx.key dovrà essere copiato in maniera sicura anche sulla macchina client.
Perciò una copia del file generato (ogni volta che dò il comando mi viene generata una chiave da 1024 random) dovrà risiedere in entrambe le macchine.
File config per serverp2p (serverp2p.conf)
Code:
# openvpn config per server p2p
# serverp2p.conf
#
# imposta la porta di comunicazione sulla porta 1194
port 1194
# assegna al server l'ip 10.8.0.1 e al client 10.8.0.2
ifconfig 10.8.0.1 10.8.0.2
#assegnamo il tipo di dettaglio della log
verb 5
#assegnamo tun come device per la vpn
dev tun0
# file si autenticazione
secret /var/etc/openvpn/keys/prova.key
#crea un file di log
log-append /var/etc/openvpn/openvpn.log
prova.key dovrà corrispondere al vosto file xxxx.key visto sopra.
Preparato tutto possiamo da telecomado dare il comando start esezionando start dalla combo e premendo il tasto verde per eseguire il comando.
nella macchina che farà da client p2p dovremmo invece creare un file di config tipo questo
File di configurazione clientp2p.conf
Quote:
# openvpn config per client p2p
# clientp2p.conf
#
# indirizzo del server da raggiungere
remote xxxx.no-ip.org
# imposta la porta di comunicazione sulla porta 1194
port 1194
# assegna al client 10.8.0.2 e al server l'ip 10.8.0.1
ifconfig 10.8.0.2 10.8.0.1
#assegnamo il tipo di dettaglio della log
verb 5
#assegnamo tun come device per la vpn
dev tun0
# file si autenticazione
secret /var/etc/openvpn/keys/prova.key
#crea un file di log
log-append /var/etc/openvpn/openvpn.log
|
prova.key dovrà corrispondere al vosto file xxxx.key visto sopra.
A questo punto possiamo startare da telecomando anche la nosta VPN nella macchina client.
Se tutto funziona la macchina server vedrà la macchina client con ip 10.8.0.2,mentre il client vedrà il server come 10.8.0.1
e la vpn avrà aggiunto una route per incanalare le richieste all'ip 10.8.0.2
verso il device tun, infatti dando route e ping otterremo il seguente risultato
Code:
root@dreambox:/var/etc/openvpn> route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.8.0.2 * 255.255.255.255 UH 0 0 0 tun0
192.168.62.0 * 255.255.255.0 U 0 0 0 eth0
default DSL302.Netservi 0.0.0.0 UG 0 0 0 eth0
root@dreambox:/var/etc/openvpn> ping 10.8.0.2
PING 10.8.0.2 (10.8.0.2): 56 data bytes
64 bytes from 10.8.0.2: icmp_seq=0 ttl=64 time=95.8 ms
64 bytes from 10.8.0.2: icmp_seq=1 ttl=64 time=6.4 ms
--- 10.8.0.2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 6.4/51.1/95.8 ms
Nota bene: se lo testate con macchine dentro e fuori FastWeb la macchina server deve essere quella fuori dalla rete FW
Alla prossima con server per multi client
Ciao
PieFav