Installer openVPN sur un Synology DS409
Par Mattt, samedi 29 janvier 2011 à 22:49 :: NAS :: #1078 :: rss
Etant donné mon cahier des charges limité, je me suis tourné vers une solution VPN, qui permet d’accéder à toutes les ressources de son reseau local, parfait dans mon cas. Après quelques recherches, j'opte naturellement pour openVPN, mais rien de concret pour installer ça sur un Synology "récent". Je dis récent car la plupart des tutos que j'ai trouvé à droite à gauche, sont pour des syno de génération 7 (207, 407...) avec un vieux kernel et un vieux firmware.
J'ai tenté d'installer selon ces tutos (ils précisent bien que ça ne marche pas) et effectivement, ça ne marche pas sur un kernel 2.6.24, un FW 2.6 et une génération 9 (DS409)
Voici donc un mini tuto pour installer (et pas configurer, démerdez-vous après l'install ^_^) openVPN sur un Synology DS409

# démarrer une session telnet en root (oui c'est mal)
HomeN4S> ipkg install openvpn
Installing openvpn (2.1.4-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/openvpn_2.1.4-2_arm.ipk
openvpn: unsatisfied recommendation for kernel-module-tun
package openvpn suggests installing xinetd
Installing lzo (2.03-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/lzo_2.03-1_arm.ipk
Installing net-tools (1.60-6) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/net-tools_1.60-6_arm.ipk
Installing psmisc (22.13-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/psmisc_22.13-1_arm.ipk
Configuring lzo
Configuring net-tools
update-alternatives: Linking //opt/bin/hostname to /opt/bin/net-tools-hostname
update-alternatives: Linking //opt/bin/ifconfig to /opt/bin/net-tools-ifconfig
update-alternatives: Linking //opt/bin/netstat to /opt/bin/net-tools-netstat
update-alternatives: Linking //opt/sbin/arp to /opt/sbin/net-tools-arp
update-alternatives: Linking //opt/sbin/route to /opt/sbin/net-tools-route
Configuring openvpn
Configuring psmisc
update-alternatives: Linking //opt/bin/killall to /opt/bin/psmisc-killall
update-alternatives: Linking //opt/bin/pidof to /opt/bin/psmisc-killall
Successfully terminated.
# on cherche la version kernel, ici 2.6.24
HomeN4S> uname -a
Linux HomeN4S 2.6.24 #1157 Mon Apr 19 21:32:42 CST 2010 armv5tejl unknown
#on prépare les folders pour TUN
HomeN4S> mkdir /dev/net
HomeN4S> mknod /dev/net/tun c 10 200
#on installe les outils xinetd
HomeN4S> ipkg install xinetd
Installing xinetd (2.3.14-11) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/xinetd_2.3.14-11_arm.ipk
Configuring xinetd
Warning: the current only_from configuration in /opt/etc/xinetd.conf is
only_from = localhost 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
change to your subnet accordingly and tighten security!
Successfully terminated
# c'est ici que j'ai eu du mal à trouver ce satané paquet kernel-module-tun
# utilisez celui-ci pour un DS409, à base donc d'ARM et kernel 2.6.24 (vérifiez le votre avec la commande : cat /proc/cpuinfo )
HomeN4S> ipkg install http://ipkg.nslu2-linux.org/feeds/optware/syno0844mv6281/cross/unstable/kernel-module-tun_2.6.24-1_arm.ipk
Downloading http://ipkg.nslu2-linux.org/feeds/optware/syno0844mv6281/cross/unstable/kernel-module-tun_2.6.24-1_arm.ipk
Installing kernel-module-tun (2.6.24-1) to root...
Configuring kernel-module-tun
Successfully terminated.
# on configure TUN/TAP
HomeN4S> openvpn --mktun --dev tap0
Sat Jan 29 20:39:37 2011 TUN/TAP device tap0 opened
Sat Jan 29 20:39:37 2011 Persist state set to: ON
# on prépare les répertoires pour la suite
HomeN4S> mkdir -p /opt/etc/openvpn/jail/ccd
HomeN4S> mkdir -p /opt/etc/openvpn/jail/log
HomeN4S> mkdir -p /opt/etc/openvpn/private/keys
HomeN4S> mkdir -p /opt/etc/openvpn/easy-rsa
# on va récupérer les clefs de la dernière release d'openVPN
HomeN4S> mkdir /opt/etc/openvpn/easy-rsa/tmp
HomeN4S> cd /opt/etc/openvpn/easy-rsa/tmp
HomeN4S> wget http://swupdate.openvpn.net/community/releases/openvpn-2.1.4.tar.gz
[...]
# on décompresse et on place les fichiers dans /opt
HomeN4S> tar xvzf openvpn-2.1.4.tar.gz
[...]
HomeN4S> mv openvpn-2.1.4/easy-rsa/2.0/* ../
HomeN4S> cd /opt/etc/openvpn/easy-rsa
# on suppr les fichiers
HomeN4S> rm -r -f tmp
# on crée le fichier de config
HomeN4S> cd /opt/etc/openvpn
HomeN4S> openvpn --config openvpn.conf
#ne reste plus qu'Ã tester si ca marche maintenant qu'on a tout
HomeN4S> cd /opt/etc/init.d/
HomeN4S> ./S20openvpn start
HomeN4S> ./S20openvpn stop
HomeN4S> /opt/sbin/depmod -a; /opt/sbin/modprobe tun
Et voilà . openVPN est installé sur le Syno, maintenant à vous de configurer les clefs et tout le reste ^_^Sources :
- http://blog.deadcode.net/2009/05/19/synology-ds207-usage-series-7-setup-openvpn-server-routed-mode-on-ds207-windows-openvpn-client-and-ds101j-openvpn-client/
- http://forum.synology.com/enu/viewtopic.php?f=27&t=18643
- http://forum.synology.com/enu/viewtopic.php?f=27&t=18881&start=15
- http://openvpn.net/index.php/open-source/documentation/howto.html
- http://forum.hardware.fr/hfr/reseauxpersosoho/Tutoriels/windows-openvpn-tutoriels-sujet_2_1.htm
- http://www.nas-forum.com/forum/index.php?/topic/1886-installer-openvpn/

Tags
ds409, how to, ipkg, kernel-module-tun, NAS, openvpn, syno, synology, tun, tuto, tutorial, vpn