# TFTP Access to Cisco Routers [SOLVED]

## wah

Good afternoon,

I am a noob, but I have followed directions and scoured this forum and google for an answer to my problem to no avail...so I am throwing myself at your mercy.  Here is what I am trying to do, what I have attempted to configure, and where my level of frustrations is currently:

1.  What I am trying to do:  

I am a Cisco Technician for an IT Training company.  One of my primary jobs is to update config files and IOSs to stand alone routers/switches (ie, not connected to the net) for use in our classes.  We use TFTP on our Windows boxes to accomplish this, but since I recently changed over to Gentoo, I would like to have this capibility on my Gentoo laptop.  I have set up Minicom for console access to the cisco devices.  Keep in mind, this is not on a live network, so security is not an issue for me.

2.  What I have attempted:

EVERYTHING:) .  No really, I have been at this for most of the day and I keep turning up a big Zero.  I have emerged two different tftp packages, I have edited all the files referenced in this forum, and I still cannot connect to anything.  Now my biggest fear is that i have too many instances of tftp running on my laptop and they are cancelling each other out.  I can ping my router, but my tftp errors are either "Timed Out" or "File or Directory not found".

My current setup is:  Xinetd, Atftp (but I also have directory references to in.tftpd, tftpd).  Ethernet1 is 10.10.10.1, Ethernet on Router is 10.10.10.2.  I will happily CNP any files that you request.  I currently have xinetd shut down, and I am not able to shut down tftpd.

3.  My level of frustration is:  VERY HIGH

I would appreciate any help that anyone can offer, as this is a crucial  part of my job and personally, I don't want to go crawling back to Mr. Gates.  I think I may have made a large mess with this, so if anyone can help me sort it out, I would be eternally grateful.  Thanks in advance, and sorry for being such a noob.

Regards,

WahLast edited by wah on Mon Mar 07, 2005 7:50 pm; edited 1 time in total

----------

## kashani

Had to play with a bit as well. Here's what should work.

1. uninstall any existing tftpd servers and kill any conf files or init scripts 

emerge -C tftp-hpa

rm /etc/init.d/in.tftpd

rm /etc/conf.d/tftpd

rm /etc/conf.d/aftpd

or anything similar

2. Next install atftp, create a dir, and start it.

```

emerge atftp

mkdir /tftproot

chown nobody: /tftproot

/etc/init.d/atftp start

```

I think the OpenBSD tftp requires you to create the file names on the server before the client can write to them... in case I never got it to work right. atftp seems to pretty much work out of the box once you own /tftproot correctly.

kashani

----------

## wah

Kashani-

Thank you so very much for the quick and accurate response!  Removing all the scripts, etc...did the trick.  I knew it had to be something simple, but like I said, I think all I did was create a jumble of garbage that freaked out the tftp server.  

Oh, one other thing that confused me before - is the atftp service managed as a stand alone, managed by xinetd, or is it up to me?

Thanks again for your help and being patient with me - now I don't have to go crawling back to "you-know-who"!

Cheers,

Wah8)

----------

## kashani

atftp is standalone. You can run just about anything under xinetd, but to me it's always been another layer to deal with. Also default xinetd behavior in Gentoo is to only listen on localhost. While that's better for security it does often trip up the unwary. IIRC tftp daemons usually don't include IP controls so xinetd would be a good idea if you only want certain IP's to have access to your tftp server. 

You might like some of these links to hand out to more advanced students.

http://www.shrubbery.net/rancid/

http://www.shrubbery.net/tac_plus/

http://www.cymru.com/Documents/secure-ios-template.html

http://www.cisco.com/public/cons/isp/documents/IOSEssentialsPDF.zip

kashani

----------

## wah

Kashani,

I just wanted to thank you again for taking the time to help me!  I'm zipping along with the Gentoo TFTP and I haven't looked back!  Thanks for the docs also...they were very informative for me, and I passed them along to our course director...maybe he'll include them in the course package!

Cheers,

Wah  :Cool: 

----------

## kedadi

hi,

I'm trying to send the configuration form Cisco Router to the TFTP server (atftp) and this is the error:

 *Quote:*   

> 
> 
> router#copy running-config tftp:
> 
> Address or name of remote host []? 10.0.0.69
> ...

 

 *kashani wrote:*   

> 
> 
> 1. uninstall any existing tftpd servers and kill any conf files or init scripts 
> 
> emerge -C tftp-hpa 
> ...

 

kashani,

i made the steps that you wrote but i'm unable to write files to the TFTP server (only to get files from), is this a bugg of atftp or anything else?

----------

## bswenson

The directions provided by kashani worked for me perfectly. I also used the following command to merge:

```

USE="-tcpd" emerge -v aftpd

```

The command I used on my 6509 (should work on most new IOS versions though):

```

copy running-config tftp://<tftp-server-ip>/cisco6509a-20051109.config

```

I suppose I should just add "-tcpd" to make.conf...I don't use tcp wrappers. Of course my tftp server is on a private network, and I only start the server when I need to from a script. Otherwise some iptables would be in order.

Thanks kashani!

----------

## Martz

Great little tftp deamon for those of us who like to copy our Cisco config somewhere   :Very Happy: 

I type from a Cisco 877 router:

copy run tftp

It then prompts you for the IP address of the tftpd and a default file name, and et voila!

----------

