Manage Cisco Switch / Router from Linux

April 14, 2013 in Services, Web Server

Installing TFTP server

This step is not mandatory and since most of you are now excited from accessing your Cisco device probably you don’t even read these lines ;). But believe me in some point you will come back to read the rest because with a TFTP Server you will be able to copy files from Cisco Switch / Router to your computer. So lets setup the TFTP Server:

sudo apt-get install tftpd-hpa

Configure TFTPD

edit the configuratoin file with your favorite editor:

sudo nano /etc/default/tftpd-hpa

and make it look like the following:

TFTP_USERNAME=”tftp”
TFTP_DIRECTORY=”/tftp”
TFTP_ADDRESS=”0.0.0.0:69″
TFTP_OPTIONS= “–secure –create -v –ipv4”

Note!! The last line of this file contains “double dash” before secure, create, ipv4.

You can download the file from here:

Lets create the Directory for our TFTPand give the appropriate permissions :

sudo mkdir /tftp

sudo chown -R nobody:nogroup /tftp

sudo chmod 777 /tftp

now lets restart the tft Server:

/etc/init.d/tftpd-hpa restart

And Check your current ip by typing:

ifconfig

This is also the IP of your TFTP server

Copy Configuration files from Cisco to TFTP

Now Go back to your minicom session and type the following:

to enter the enable mode:

enable

type the enable password if need it and then check the flash contents by typing :

dir flash:/

Now lets copy the config.text to TFTP but before that lets check that your switch can communicate with your computer. In order to do that you must have a network cable connected from your computer to your Cisco Switch /Router. and also the port that is connecting your computer to the switch must belong to a vlan that has an ip address in the range of your computer’s ip. so lets ping your computer from the Cisco:

In my case my Computer has the IP 192.168.0.202 so the command will be:

ping 192.168.0.202

the output should look like the following:

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.202, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/10 ms

Now you are ready to copy files from Cisco To TFTP

copy flash:/config.text tftp:/
Address or name of remote host []? 192.168.0.202
Destination filename [config.text]?
!!
1773 bytes copied in 0.076 secs (23329 bytes/sec)

Now the config.text should be in your local folder /tftp

Have Fun.

A video Tutorial is coming soon





If you like what we do, you can press the button above and
contribute in the expenses of this effort that’s called AllAboutLinux.eu! Thank you.

Pages: 1 2 3