This document describes the process used to copy a configuration or text file to a router that does not have any file transfer access.
The best way to copy a configuration/license or any kind of text file to a router is to use file transfer protocols like FTP/TFTP/SCP/HTTP, however there are scenarios when usage of the protocols are not possible or prohibited.
Method 1: Using IOS.sh "terminal shell".
This method utilizes IOS.sh feature, that has been available in Cisco IOS/IOS-XE for quite long.
The overall idea is to create a shell function that would print the necessary data. Then we redirect the output to a file.
Below are two examples.
Example #1 - suitable for multi-line (short lines) content:
The major challenge with the method is to gain linux shell access since it is highly restricted (means it cannot be done without TAC assistance). Also one can accidentally jeopardize the functioning of the system, thus the method is not safe (and not recommended).