1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

TFTPD running on tomato

Discussion in 'Tomato Firmware' started by ArmoredDragoon, Dec 15, 2012.

  1. ArmoredDragoon

    ArmoredDragoon Serious Server Member

    Are there any tftpd binaries out there that will run on tomato? I want to set up a PXE boot that runs entirely off of tomato. I already have a USB attached disk which hosts a bunch of files, so storage space isn't an issue.
     
  2. jerrm

    jerrm Network Guru Member

  3. koitsu

    koitsu Network Guru Member

    Entware offers this.

    Code:
    root@gw:/tmp/home/root# opkg list | grep tftp
    tftp-hpa - 0.48-3 - An enhanced version of the BSD TFTP client
    tftpd-hpa - 0.48-3 - An enhanced version of the BSD TFTP server
    
     
  4. ArmoredDragoon

    ArmoredDragoon Serious Server Member

  5. ArmoredDragoon

    ArmoredDragoon Serious Server Member

    Hmm...I can't seem to find any documentation for how to configure this particular build. Using the traditional -help -h parameters doesn't yield anything. I'm trying to set it to run at start, and I want it to point to /tmp/mnt/hdd/tftpboot for its root folder. There's some documentation elsewhere about creating an /etc/default/tftpd-hpa file, but that only seems to apply to ubuntu.

    Is there a good source for documentation on these entware packages in general? I'd also like to know how to configure this particular implementation of fwknopd.
     
  6. ArmoredDragoon

    ArmoredDragoon Serious Server Member

    Ok figured out what to do (there's like no documentation on this anywhere that even remotely applies to our setup, and the binary itself doesn't have any verbose documentation either). You need to install xinetd (e.g. opkg install xinetd) and then create a text file called /opt/etc/xinetd.d/tftp which contains the following:

    Code:
    service tftp
    {
    flags = REUSE
    socket_type = dgram
    protocol = udp
    instances = 30
    wait = yes
    user = root
    server = /opt/sbin/tftpd-hpa
    server_args = -s /path/to/your/tftp/root/dir
    cps = 100 2
    log_on_success = HOST PID
    log_on_failure = HOST
    disable = no
    }
    
    You can then start the xinetd service (e.g. /opt/etc/init.d/S10xinetd start) and your tftp server is ready to go. Don't know why, but it doesn't seem to want to do anything at all unless it runs from xinetd. I even tried to get it to run in daemon mode and it still doesn't work.
     
  7. ArmoredDragoon

    ArmoredDragoon Serious Server Member

    No kidding....dnsmasq on tomato already includes a tftp server. Just added this to my dnsmasq custom config:
    Code:
    enable-tftp
    tftp-root=/path/to/tftproot
    dhcp-boot=pxelinux.0
    And there it is, a functioning PXE server. No need for tftpd-hpa. Now if only I could figure out why ntdetect fails...
     
  8. ryzhov_al

    ryzhov_al Networkin' Nut Member

    Well, may be it's a Windows/Linux filename case misfits. Take a look at /opt/etc/tftpd/remap file from my russian post.
     
  9. ArmoredDragoon

    ArmoredDragoon Serious Server Member

    It was that along with oh so many other issues. I created a vfat disk image file on my usb drive to resolve the case sensitive problem, e.g.:

    Code:
    dd if=/dev/zero of=vfat.img bs=1 count=1 seek=50000M
    mkfs.vfat vfat.img
    modprobe loop
    mount vfat.img /mnt/tftpboot
    Ultimately the dnsmasq tftp server doesn't work because it can't create mappings, which windows tftp clients REQUIRE if the host is unix due to the directory separator (backslash for windows, frontslash for unix.) Namely you need this in your remap file with tftp-hpa:

    Code:
    rg \\ /
    That resolved most of it, but I ran into other issues like the installer not being able to find some files for god knows what reason. I had a python binl (RIS) server setup on the router too that worked great. I finally gave up and set up a pxe package on another server that works well.
     
  10. ryzhov_al

    ryzhov_al Networkin' Nut Member

    I think it's not a good idea. You don't need to you use web-server, PHP, Perl, Python, cabextract and binary patches to install Windows via PXE. It's a very old manual! Now we've got a Windows AIK tool, which allow to install any Windows version from WinXP to Win8. All you need is a tftp server and SAMBA share.
     

Share This Page