cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Join Customer Connection to register!
670
Views
5
Helpful
16
Replies
niramar
Beginner

Is there a way to transfer a config file from pc to a router without using Rj45 cable? (console,usb....)

Hi everyone,

I need to find a way to transfer a config file from my pc to a router but without using Rj45 cable, only console, usb or any other way if there is. And also run it afterwards.

Currently using ftp to do that.

16 REPLIES 16
Giuseppe Larosa
Hall of Fame Master

Hello @niramar ,

you can connect using a console cable to the router if the router is near to you you then open a serial connection to the router and you connect to the router

see

https://www.cisco.com/c/en/us/support/docs/dial-access/asynchronous-connections/9321-terminal-settings.html

 

once you are able to reach the privileged prompt Router# you can easily do the following:

conf t

and you paste the configuration file into the router

 

being a serial async line I would suggest you to copy paste few lines at a time.

 

in modern laptop you need an USB to RS232 converter and an RS232 9pin to RJ45 console cable (the light blu cable in Cisco case)

see

https://www.amazon.it/9-Pin-To-Usb-Serial-Adapter/s?k=9+Pin+To+Usb+Serial+Adapter

 

 

Hope to help

Giuseppe

 

Thank you for the reply!
Im looking for a way to transfer the file at one time and just run it instead of copying a few lines at a time.
If there isn't a way to do so directly, maybe there is a script that can be created and run it for the user.
Leo Laohoo
VIP Community Legend

Only console? Sure, xmodem.

Thank you for the reply.
Is there any good guide or a video that you can send me please?
Leo Laohoo
VIP Community Legend


@niramar wrote:
Is there any good guide or a video that you can send me please?

Sure.  Go HERE.

@mHadi
Beginner

if you have config file, only way is FTP or TFTP, better say this is Best-Way,
what is your problem exactly ?

Thank you for the reply.
Im currently using this method but unfortunately can't with some new hardware because of guidelines and instructions I got.
So i need to figure a way to transfer a config file to a router or a switch using serial port, usb, console or any other way.
I looked up for Xmodem guides but Iv'e noticed that it is an "old school" way to do so.

Ive been told to find a way to transfer and run a config file (txt or so) to a router or a switch using only serial ports, if there is a way to do so all at once. Or copy a line at a time and create a scrit that can do so if needed.

Also forgot to mention, the user is using a custom program that you insert some "values" and it creates a config file using those values, and then transfer it using tftp and run.

The issue about pasting the config over the console connection is that the rate at which data arrives at the console is faster than the switch can process it, and that causes over run and dropped text. I have some experience with this and if your terminal emulator will allow you to specify per character delay and/or line feed delay larger than the default you should be able to paste the entire config without needing to do just a few lines at a time.

HTH

Rick

Thank you for the reply!
Can you please explain to me how can i transfer the data? with which commands? xmodem or different way? so that i would be able to maybe write a script as you said, with the delay and everything.

We do not know what terminal emulator you are using and so can not tell you exactly how to set character delay or line feed delay. But once you are able to make those changes in the setup of your terminal emulator then here is what you would do:

- on the PC use some text edit program to open the config file

- select all of the text

- copy the selected text

- establish a terminal session from your PC to the switch console port

- login and go to enable mode

- use the command config t to initiate configuration mode

- paste the text that was copied into the console session

- when the text transfer is completed use quit or exit to end the configuration mode

- check the running config to verify that all text did transfer correctly

- use copy running-config startup-config to save the new config

 

After explaining this I read through the discussion again and believe that there may be a problem. The original poster has explained the current procedure this way "the user is using a custom program that you insert some "values" and it creates a config file using those values, and then transfer it using tftp and run". I was assuming that we would have a text file with the new config but if there is some custom program that uses input values to create the config and immediately attempt tftp then I am not sure that we would really have a text file. 

HTH

Rick

Hello Rick,

I thought the original poster was a student of a Cisco network academy looking fo the old way to use console.

 

Your note is really spot on:

>>

The original poster has explained the current procedure this way "the user is using a custom program that you insert some "values" and it creates a config file using those values, and then transfer it using tftp and run". I was assuming that we would have a text file with the new config but if there is some custom program that uses input values to create the config and immediately attempt tftp then I am not sure that we would really have a text file.

 

Even if the configuration is produced using a script where the original poster introduces few parameters like hostname, management IP address, domain name, SNMP read community just to make an example this custom program has to prepare the actual text file to be sent via FTP or TFTP.

 

Discovering the directory or data path where the config text file is saved may be easy or difficult depending on the knowledge of the OP.

If they are concerned about security likely he will not be allowed to post the configuration maker program script also.

I think the current scenario is : the new device is powered on and connected with a LAN cable to a switch and receives an IP address via DHCP in a staging lab.

The OP runs the config maker script then connect via console to the new device and use FTP to download the target configuration on the device.

 

Hope to help

Giuseppe

 

@Giuseppe Larosa Thank you for your comments. I agree that we do not know about the environment of the original poster and exactly what they need. And we could certainly make better suggestions if we knew more about what the requirements really are and about how the software works that produces the config file. I am basing my suggestions on these statements from the original poster:

- "Im currently using this method but unfortunately can't with some new hardware because of guidelines and instructions I got."

- "So i need to figure a way to transfer a config file to a router or a switch using serial port, usb, console or any other way."  

I do not know why it is that way, but in that context I believe that my suggestions do present a workable solution. 

HTH

Rick

Thank you both for the reply!
The program im using is creating a config file based on those values I choose and changes the adresses, hostname and so on.... Afterwards it is using the serial port, and then transfering the file ove tftp and running it.
The problem is that with some new hardware i can't do that, so i need to figure a way to transfer the file over console or a usb port only.
Don't worry about the program at all. I described the situation to you guys just so you could understand it better and maybe help.

Thank you for the additional explanation. If we do not consider the program and only consider how to transfer the file using the console port then I believe that my suggestions should help you achieve your requirements. 

 

I would just point out 2 assumptions that are involved here:

- we are assuming that you have the config changes in a text file that is accessible on your PC.

- if the program used tftp to transfer the config then your PC did not need to have physical access to the device being configured. But with console access your PC must have access to the physical console port.

HTH

Rick