Cisco: Error opening tftp://url (Undefined error)

Though I still know my way around, it’s been a while since I messed with a Cisco router to any great degree. But today at work I had to configure a Cisco 1750 to reply to one of our offices. I like backing up configs before I blow away a router, just so that I have a copy of what was on there. I knew that I could TFTP it to my PC, assuming I set up a TFTP server. So I went and installed Tftpd32 to my PC, set up a secondary IP on the Cisco router on my local network, and fired up the following command on the Cisco console:

  copy startup-config tftp://172.16.1.142/config.txt

I then saw on Tftpd32 that the router connected, and created the file "cisco.txt", however the transfer failed and the resulting file was 0 bytes. This is the error I got on the console:

  %Error opening tftp://172.16.1.142/config.txt (Undefined error)

Clearly, the Cisco was connecting, it just wasn’t sending the content of the file. After running a standard FTP test, I noticed that the Cisco showed up to the server as the PRIMARY interface IP, not the secondary one. Once I re-assigned the primary IP address to the local IP range, the transfer succeeded.

So, long story short: If you see this error, check that the primary IP on the interface facing your network is in the same subnet as you (or the next hop), otherwise the Cisco might show up as coming from an unreachable IP.