TFTP server on Debian for Cisco phones

Tech Notes
  1. Disable DHCP on your router.
  2. Replace whatever dhcpd server you have on your box with dhcp3-server (ISC DHCP server transitional package) $ sudo aptitude install dhcp3-server
  3. Edit the config file in

    /etc/dhcp/dhcpd.conf
    adding a block for your subnet subnet 10.0.0.0 netmask 255.255.255.0 { range 10.0.0.100 10.0.0.149; default-lease-time 86400; max-lease-time 86400; option routers 10.0.0.1; option broadcast-address 10.0.0.255; option subnet-mask 255.255.255.0; option domain-name-servers 10.0.0.1; option tftp-server-name "10.0.0.7"; }

  4. Restart dhcpd $ sudo /etc/init.d/isc-dhcp-server  restart
  5. Replace whatever is running your inetd daemon with openbsd $ sudo aptitude install openbsd-inetd
  6. Uncomment and fix the inetd.conf file as the tftpd config is wrong for Debian (via techexams.net) $ sudo vi /etc/inetd.conf tftp            dgram   udp4    wait    nobody /usr/sbin/tcpd /usr/sbin/in.tftpd
  7. Restart inetd $ sudo /etc/init.d/openbsd-inetd restart
  8. Move tftp root directory to somewhere easier to access - you can specify it as the final argument in the inetd.conf (after /usr/bin/in.tftpd). By default this on lives in /tftpboot so mkdir that and make it accessible $ sudo mkdir /tftpboot $ sudo chmod 777 /tfpboot
  9. Test that it works locally and remotely $ echo "Testing" > /tftpboot/test.txt $ tftp 127.0.0.1 tftp> get test.txt Received 11 bytes in 0.1 seconds -- $ tftp 10.0.0.7 tftp> get test.txt Received 11 bytes in 0.1 seconds