03-21-2020 02:38 AM
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.
03-21-2020 02:54 AM
03-21-2020 03:08 AM
03-21-2020 03:19 AM
03-21-2020 03:14 AM
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
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
03-21-2020 03:21 AM
03-21-2020 03:34 AM
03-21-2020 04:21 AM
03-21-2020 09:40 AM
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.
03-21-2020 10:01 AM
03-21-2020 10:49 AM
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.
03-21-2020 10:38 PM
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
03-22-2020 03:07 AM
@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.
03-22-2020 03:16 AM
03-22-2020 03:48 AM
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.
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: