Monday, 25 July 2011

Setup Debian netboot server on Synology

1. Install dnsmasq

Before installing dnsmasq, install optware if you haven’t done so (see [1]). Then install dnsmasq via ipkg:
ipkg install dnsmasq

2. Configuration

Edit dnsmasq.conf in /opt/etc, the following is sample config (or check the original example [2]):
# DHCP IP range and lease
dhcp-range=192.168.0.100,192.168.0.200,255.255.255.0,12h
dhcp-leasefile=/opt/var/lib/dnsmasq.leases
# DHCP Fixed IP settings
dhcp-host=XX:XX:XX:XX:XX:XX,192.168.0.101
# DHCP gateway option
dhcp-option=option:router,192.168.0.1
# DHCP dns option, if you don't want to use dnsmasq's DNS service
dhcp-option=option:dns-server,8.8.8.8,4.4.4.2
 
# PXE boot options
dhcp-boot=pxelinux.0
enable-tftp
tftp-root=/volume1/netboot

3. Prepare tftp root directory

The above configuration sets the root directory for tftp server to /volume1/netboot. If it is not there already, create it and put Debian netboot files ([3]) there.
mkdir /volume1/netboot
wget –O - http://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/netboot.tar.gz | tar xzf - 

4. Logging DNS queries

Log each DNS query as it passes through for debugging purposes.
# dnsmasq.
log-queries
log-facility=/var/log/dnsmasq.log

5. Start dnsmasq server

Start dnsmasq server will starts a DHCP server, please disable your router’s built-in DHCP server first.
/opt/etc/init.d/S56dnsmasq start
Now you can reboot your machine and try boot from network.
It’s all done. 

Links

[1] Install optware on Synology DistStation [link]
[2] Setup Debian netboot server on Synology DistStation [link]
[3] Configuration file for dnsmasq with comments [link]
[4] Debian netboot tarball [link]

No comments: