Feature #2661

Dnsmasq: add TFTP support

Added by Giacomo Sanchietti over 7 years ago. Updated about 7 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-tftp
Target version:v6.5
Resolution: NEEDINFO:No

Description

Add TFTP support to Dnsmasq.

Features:
  • TFTP should be disabled by default
  • Send TFTP server address to DHCP clients

Associated revisions

Revision 07779448
Added by Giacomo Sanchietti over 7 years ago

First import. Refs #2661

History

#1 Updated by Giacomo Sanchietti over 7 years ago

  • Status changed from NEW to TRIAGED
  • % Done changed from 0 to 20

#2 Updated by Giacomo Sanchietti over 7 years ago

  • Status changed from TRIAGED to ON_DEV
  • % Done changed from 20 to 30

First stub implementation is in nethserver-tftp repository.

What is missing:
  • Wiki documentation
  • Add package to Ohloh

#3 Updated by Giacomo Sanchietti about 7 years ago

  • Description updated (diff)

#4 Updated by Giacomo Sanchietti about 7 years ago

  • Status changed from ON_DEV to MODIFIED
  • Target version changed from ~FUTURE to v6.5
  • % Done changed from 30 to 60

#5 Updated by Giacomo Sanchietti about 7 years ago

  • Assignee set to Stefano Fancello

#6 Updated by Giacomo Sanchietti about 7 years ago

  • Status changed from MODIFIED to ON_DEV
  • % Done changed from 60 to 30

#7 Updated by Stefano Fancello about 7 years ago

  • Status changed from ON_DEV to MODIFIED
  • % Done changed from 30 to 60
  • changed tftp root to /var/lib/tftpboot
  • added the dhcp-boot variable:
    # Set the boot filename and tftpd server name and address
    # for BOOTP. You will only need this is you want to
    # boot machines over the network.
    

nethserver-tftp 2ee7ec8f4bb869e06c92af34f964bdb4c48d5bc1

#8 Updated by Stefano Fancello about 7 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

nethserver-tftp-0.0.3-1 published in testing repo

Test case:
1. Install package

2. Enable tftp server

 # config setprop tftp status enabled
 # signal-event nethserver-tftp-save

3. create a test file in /var/lib/tftpboot/ owned by nobody:nobody

 # echo "test"  > /var/lib/tftpboot/ foobar
 # chown nobody:nobody /var/lib/tftpboot/foobar

4. from another machine, install tftp and get file
Install tftp (on fedora)

 # yum install tftp

allow incoming udp connection from our tftp server, load tftp conntrack module should be sufficient
 # modprobe nf_conntrack_tftp

get file
 # tftp TFTP_SERVER_HOST
 tftp> get foobar

#9 Updated by Giacomo Sanchietti about 7 years ago

  • Assignee deleted (Stefano Fancello)

#10 Updated by Giacomo Sanchietti about 7 years ago

  • Assignee set to Giacomo Sanchietti

#11 Updated by Giacomo Sanchietti about 7 years ago

  • Status changed from ON_QA to TRIAGED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 20

Test case 1 is VERIFIED.

But following are missing:
  • default value for dhcp-boot property
  • test case for dhcp-boot
  • wiki page documentation

#12 Updated by Stefano Fancello about 7 years ago

  • Status changed from TRIAGED to MODIFIED
  • Assignee set to Stefano Fancello
  • % Done changed from 20 to 60

added dhcp-boot option, that can be setted using db prop
commit 2ee7ec8f4bb869e06c92af34f964bdb4c48d5bc1

#13 Updated by Stefano Fancello about 7 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee deleted (Stefano Fancello)
  • % Done changed from 60 to 70

nethserver-tftp-0.0.4-1 nethserver-tftp-0.0.4-1.0git26c7f35d published in testing repo

Test case:
1. Install package

2. Enable tftp server

 # config setprop tftp status enabled

3. set a value for dhcp-boot

 # config setprop tftp dhcp-boot pxelinux.0

4. Apply changes

 # signal-event nethserver-tftp-save

5. check that dhcp-boot varable is added to /etc/dnsmasq.conf

#14 Updated by Giacomo Sanchietti about 7 years ago

  • Assignee set to Giacomo Sanchietti

#15 Updated by Giacomo Sanchietti about 7 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 90

Db defaults are ok.

Write mode is not implemented (see man dnsmasq).
Read mode works: all files inside the tftp directory must be owned by nobody user.

Also successfully tested pxe boot, follow below instructions to reproduce.

Before release, please add:
  • developer manual page
  • administrator manual page (also add instructions about pxe boot)

PXE boot server

The following instructions will create a PXE server to boot a CentOS.

yum install syslinux
cp /usr/share/syslinux/{pxelinux.0,menu.c32,memdisk,mboot.c32,chain.c32} /var/lib/tftpboot/
config setprop tftp dhcp-boot pxelinux.0
signal-event nethserver-tftp-save
mkdir /var/lib/tftpboot/pxelinux.cfg

Create the file /var/lib/tftpboot/pxelinux.cfg/default with the following content:

default menu.c32
prompt 0
timeout 300

MENU TITLE PXE Menu

LABEL CentOS
  kernel CentOS/vmlinuz
  append initrd=CentOS/initrd.img

Create a CentOS directory:

mkdir -p /var/lib/tftpboot/CentOS

Copy inside the directory vmlinuz and initrd.img files.
These files can be found inside the ISO or browsing the yum os mirror.

#16 Updated by Giacomo Sanchietti about 7 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Released in nethserver-updates:
  • nethserver-tftp-0.0.5-1.ns6.noarch.rpm

Also available in: Atom PDF