3

I have a device(White rabbit switch), which during flashing downloads the firmware using tftp://0.0.0.0/firmware.tar. I set up a local network with this device and my laptop with TFTP server serving this file. While the file could be downloaded using the proper IP address assigned to my laptop by the router using another machine in the same LAN, the 0.0.0.0 address doesn't work.

The instruction for flashing mentions: The flashing procedure will use the server address reported by DHCP as IP address for the TFTP transfer.

and I can see that the switch is trying to download the firmware from 0.0.0.0. Any idea how to circumvent this? I can't change any parameters on the switch side.

5
  • Use the IP of your laptop instead of 0.0.0.0
    – CyberSimon
    Commented Nov 14 at 17:46
  • I can't, it automatically gets assigned during the flashing process. Commented Nov 14 at 17:53
  • 4
    Your DHCP server needs to provide the tftp server ip address. How this is accomplished varies greatly depending on your DHCP server. Many servers use the next-server parameter to publish the tftp server ip address.
    – CyberSimon
    Commented Nov 14 at 18:12
  • Thanks for the suggestion. I am using a cheap Dlink router as my DHCP server, and I can't see any options that would help me here. Will using my laptop as a DHCP server will work? Commented Nov 14 at 18:29
  • You can use your laptop as a DHCP server as long as you disable the DHCP server on the Dlink. You should be able to find instructions online for setting up a DHCP server and TFTP server all-in-one.
    – CyberSimon
    Commented Nov 14 at 18:33

1 Answer 1

4

Disconnect the device from your LAN and connect it directly to the computer via Ethernet. (Although if the LAN is already dedicated for this purpose, then you can continue using the router for Wi-Fi if needed – as long as you disable its DHCP.)

Then configure the computer's Ethernet interface with a static IP address, and set up a DHCP server on the computer to offer the correct DHCP or BOOTP lease.

If you're running Linux, then dnsmasq is a good choice for a small DHCP server (it can even serve both DHCP and TFTP from the same process). Other options are the classic ISC DHCP server (recently EOL, but it's still good as is) or ISC Kea (a bit too 'enterprise').

Note that unlike most other information provided via DHCP, the TFTP server address is not configured as a "DHCP option" but a separate, built-in parameter. In dnsmasq you would set it using the dhcp-boot= option.

sudo dnsmasq \
    --no-daemon \
    --conf-file=/dev/null \
    --interface=eth0 \
    --bind-dynamic \
    --dhcp-range="192.168.1.50,192.168.1.100,255.255.255.0,1h" \
    --dhcp-boot="some_filename,192.168.1.1" \
    ;
1
  • 2
    And in case of a Windows computer, tftpd64 pjo2.github.io/tftpd64 is an application that provides both dhcp server and tftp server functionality. (I remember using tftpd32 10+ years ago.) Commented Nov 15 at 6:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .