05-08-2008 06:50 AM - edited 03-05-2019 10:50 PM
I created a text file that allows me to cut and paste the config and run no shut on certain interfaces. How can I get past the beginning where the IOS ask you to press "Enter" to continue before getting the router> prompt?
05-08-2008 07:29 AM
maybe toss in a couple "!". The terminal window will have to carriage return to get to the next line. Might work, not sure, never tried.
!
config t
...
05-21-2024 05:49 AM
Hi what is the latest on this? the exclamations do not work.
05-21-2024 06:16 AM
You can do this with Netmiko, you can use the send feature (https://pyneng.readthedocs.io/en/latest/book/18_ssh_telnet/netmiko.html) to send an empty command to the router, which will have the same effect as pressing "Enter". Here's an example, update this for your use case.
from netmiko import ConnectHandler
router = ConnectHandler(device_type='cisco_ios', ip='router_ip', username='username', password='password')
# Send an empty command to get past the "Press Enter to continue" prompt
router.send('\n')
# Wait for the router prompt
output = router.read_until('router>')
# Send your configuration commands
router.send_config_from_file('config_file.txt')
# Close the connection
router.disconnect()
Hope this helps.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide