tftp configuration

Discussion in 'Linux Networking' started by Hactar, Jun 23, 2014.

  1. Hactar

    Hactar Guest

    I'm trying to set up a TFTP server on my machine (Ubuntu 13.04 LTS I
    think, or maybe 12.04 LTS). It's hpa-tftp, run by xinetd. I need it to
    download the firmware loader into a router so I can put DD-WRT on it.
    How do I configure the server? Is there some file that maps a MAC
    address to a given file? Does the client identify itself somehow and
    the image needs to be named a certain thing or in a certain place to
    go to that client? Does the server log something on success? Do I have
    to do something to hosts_allow to enable it? Curious minds, etc.

    Oh, the xinetd control file I have is:

    {
    socket_type = dgram
    protocol = udp
    wait = yes
    user = root
    server = /usr/sbin/in.tftpd
    server_args = -s /var/lib/tftpboot
    }

    Does that look reasonable? Thanks
     
    Hactar, Jun 23, 2014
    #1
    1. Advertisements

  2. Hactar

    ein Guest

    It's hard to say. Show us - How recovery procedure looks like?
    Is device dead?

    The most common way is usually hard reset of the device or bricked
    device sends broadcast packets with DHCP discover with selected option 60.

    Then device starts bootstrap and tries to download a file from TFTP
    server. You will see that in logs, I mean who want to download what
    and if it succeed. It's very big shortcut. Go there to read more how
    PXE-DHCP Handshake looks like:
    http://blogs.technet.com/b/dominikheinz/archive/2011/03/18/dhcp-amp-pxe-basics.aspx

    DHCP server must be configured for this. My config looks like:

    # DHCP server network
    subnet 10.1.1.0
    # network mask
    netmask 255.255.255.224
    {
    authoritative;
    range 10.1.1.21 10.1.1.30;
    option broadcast-address 10.1.1.31;
    option routers 10.1.1.1;

    option netbios-name-servers 10.1.1.1;
    range dynamic-bootp 10.1.1.15 10.1.1.17;
    option domain-name-servers 10.1.1.1,62.179.1.62,62.179.1.63;
    use-host-decl-names on;

    ### Begin of PXE part ###
    if substring (option vendor-class-identifier, 0, 9) = "PXEClient"
    {
    filename "pxe/pxelinux.0";
    }
    ### End of PXE part ###
    }

    Yes, add "-vvv" to arguments to get more noise about tftpd actions.
     
    ein, Jun 24, 2014
    #2
    1. Advertisements

  3. Hactar

    Hactar Guest

    Dunno. How do I tell? When I power it up, the power light blinks for a
    while and eventually turns green. No other light turn on. If I then
    connect its WAN port to my other router, the "WAN Ethernet" light turns
    green and flickers every few seconds, and the "Internet" lights turns
    orange.
    I've given it a 30/30/30 reset. The DHCP server (the other router) lists
    several devices to which it has given addresses in the last few hours,
    but none are this router. I thought maybe it gave up on DHCP before the
    ethernet was connected so I power-cycled it with the ethernet hooked up;
    same story, no go.
    Thanks. It doesn't like this machine (or me in particular), as neither
    Firefox nor Chrome can log in. I'll have to try it elsewhere.
    I guess I need to implement that in the router's DHCP server. Where does
    one get pxelinux.0 and where does it go?
    Thanks.
     
    Hactar, Jun 24, 2014
    #3
  4. Hactar

    ein Guest

    Most of devices has recovery procedure(s). You should study your
    device's user manual. You didn't even write its name.
    If the device doesn't have recovery procedure then most likely there is
    also an option to connect service console port and upload firmware via
    so called zmodem protocol using that console serial connection.
    Please study documentation:
    http://www.syslinux.org/wiki/index.php/PXELINUX
    http://www.debian-administration.org/article/478/Setting_up_a_server_for_PXE_network_booting
     
    ein, Jun 24, 2014
    #4
  5. Hactar

    Hactar Guest

    I bought it used. Didn't get a manual. It may be online, but odds are
    it wouldn't say jack about how to configure a TFTP server.
    That's because my question was "how do you configure a TFTP server", not
    something about this router or DHCP. It's an Actiontec MI424-WR rev D,
    BTW. I mean, step 4 of the DD-WRT installation instructions at
    http://dd-wrt.com/wiki/index.php/MI424WR is "Prep a TFTP server or
    install one for use.". Installation and (re)starting one I got.
    The JTAG port was removed in rev D. If I brick it, looks like I'm hosed.
     
    Hactar, Jun 24, 2014
    #5
  6. Hactar

    ein Guest

    It looks that way... Use Wireshark and confirm that router does not
    sends nothing @ broadcast. If not and you're not able to find another
    way to connect to serial console then I don't see any other way.
     
    ein, Jun 25, 2014
    #6
  7. Hactar

    ein Guest

    Try to scan also "popular" IP ranges for ICMP echo replay:
    192.168.*/16
    172.16.*/12
    10.*/8
    169.254.*/16

    nmap -sP -n subnet1_address/mask subnet2_address/mask
     
    ein, Jun 25, 2014
    #7
  8. Hactar

    ein Guest

    Another idea, try to power it up with pressed reset button, release it
    after 30 sec. Watch at Wireshark output in meantime.
     
    ein, Jun 25, 2014
    #8
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.