cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
487
Views
0
Helpful
3
Replies

How to build an application that sends a text file to a router?

bdooonName
Level 1
Level 1

Greetings..

I'm a student & am building a java application for a network course project. Now, I'm stuck on this point. I want to send a text file that contains configurations to a Cisco router or a switch. How to do so without the use of the HyperTerminal? Just from my application to the router.
Will it be possible if I make an TFTP server in my application?

Thanks in advance for your reply.

3 Replies 3

Jon Marshall
Hall of Fame
Hall of Fame

Okay, firstly i am not a Java Programmer so i'm not sure exactly what factilies Java supplies.

Having said that there are a number of ways to remotely configure a router/switch. It's important to note however that simply having tftp functionality within your app would not be enough because to use tftp you really need to be on the router/switch and then pull the config file rather than just push it from your Java app. So

1) telnet/ssh allows you to remotely connect to a router/switchand from there either

   i) enter commands

  ii) tell the router to remotely download a config from your tftp server

2) SNMP allows you to send instructions/commands to the router/switch - note that is SNMP write must be enabled not just SNMP read

Personally if Java supported it, it may well be easier to go the SNMP path as long as all you want to do is supported by SNMP and the device could be configured as Read/write.

If not then you will need to remotely connect to the device using telnet/ssh. Once this has been done you can then choose either i) or ii) from above. One thing worth mentioning is that the script languages Perl and TCL both have methods for connecting to a router/switch and then sending commands to it -

Perl uses the Net::Telnet::Cisco module or the Expect module

TCL uses Expect

Not sure if Python has one or not.

I only mention this because certainly there is an interface between Java and Python for example - JPython, so there may well be the same for Perl/TCL so it may be easier to use one of these rather then write the whole thing from scratch yourself.

Jon

Thank you very much for your informative reply. I really appreciate it.

Another question, won't the TFTP be enough if my PC is connected to the router? I mean I don't need to be remote, but I want to be able to upload the text file (or sent it) from my application, not from the HyperTerminal.

Thanks again.

bdooonName wrote:

Thank you very much for your informative reply. I really appreciate it.

Another question, won't the TFTP be enough if my PC is connected to the router? I mean I don't need to be remote, but I want to be able to upload the text file (or sent it) from my application, not from the HyperTerminal.

Thanks again.

If your PC is already connected to the router how is it connected ? via a console cable or via ethernet.

Either way you still need to be able to tell the router to download a config file and this comes back to what i was saying previously. You either need to be on the router so you may well end up writing your own hyperterm client or you could use SNMP if via ethernet.

It really boils down to the APIs that Cisco make available for you to hook into. I don't know what they are and whether they provide a Java interface which is why i only talked about the ways i can think of making it work.

Jon

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card