Finalement j’installe dnsmasq comme serveur DNS/DHCP/tftp sur mon NAS QNAP 101 (auparavant c’était sur mon routeur sous openwrt : Limace Kamikaze: d’une pierre deux coups avec dnsmasq).
Quelques trucs à conserver en mémoire :
Installer les packages nécessaires
- Installer ipkg si ce n’est pas fait : Mise en route QNAP TS-101
- Avec ipkg installer le package dnsmasq
[~] # /opt/bin/ipkg install dnsmasq Installing dnsmasq (2.52-1) to root... Downloading http://ipkg.nslu2-linux.org/feeds/optware/ts101/cross/unstable/dnsmasq_2.52-1_powerpc.ipk Configuring dnsmasq To complete the installation, you should check /opt/etc/dnsmasq.conf, and then run /opt/etc/init.d/S56dnsmasq to start dnsmasq. Successfully terminated.
- Installer le package adduser
# /opt/bin/ipkg install adduser
Configurer
- Si ce n’est pas fait, patcher le fichier /etc/inetd/Optware-ipkg.sh selon les instructions Running /opt/etc/init.d/* on startup du wiki QNAP (en changeant Optware.sh par Optware-ipkg.sh), de manière à ce qu’il soit lancé automatiquement au démarrage de la machine
- Créer un user nobody
# adduser -h /nonexistent -s /bin/sh -u 65534 -G guest -H nobody
- Créer et modifier un fichier /opt/etc/hosts (le fichier /etc/hosts est perdu à chaque boot) et faire référence à celui-çi plutôt qu’à /etc/hosts dans dnsmasq.conf
- Créer un répertoire /share/Public/tftpboot comme racine du serveur tftp
- Modifier /opt/etc/dnsmasq.conf
Les lignes importantes du mien :
domain-needed bogus-priv server=64.158.219.100 server=64.158.219.200 local=/lan/ addn-hosts=/opt/etc/hosts expand-hosts domain=lan dhcp-host=00:0d:fe:00:46:0d,net:mvpmc,assurancetourix,192.168.0.12 dhcp-boot=net:mvpmc,dongle.bin,arrierboutix,192.168.0.5 enable-tftp tftp-root=/share/Public/tftpboot dhcp-authoritative local-ttl=300