- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 06:18 AM
Hello ,
I have a cisco metro boucle: ME3800, cisco 3600, ASR903, ASR920....
so i want from expert cisco that help me :
i want to add a commands that broadcast a template to all router without typing this template conifg for each router
I wait a reply from expert Metro Cisco
Solved! Go to Solution.
- Labels:
-
Metro
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 06:26 AM - edited 06-22-2022 06:47 AM
want to add a commands that broadcast a template to all router
You mean config push to all the device, you need to bear in mind different devices has different config methods, some command may not work, but you can do basic config across all platforms.
i use Phython or any automation tool to do this task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 06:49 AM - edited 06-22-2022 06:50 AM
If you know the Python you can with netmiko as example :
https://pynet.twb-tech.com/blog/netmiko-python-library.html
you need some time to understand how that works and test few commands before you go mass level to deploy.
You need Linux or window running Python Library, Router or device do not hold any Python packages.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 07:10 AM
automation tool can you give me example !!
Automation the one you looking to do, tools can be used depends what works for end user, this can be python, ansible, powershell, bash script to make this to work automated the task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 07:22 AM - edited 06-22-2022 07:23 AM
here is script in python allows an example command (SNMP 3 script) broadcast to all routers once without writing the SNMPV3 script to 1000 cisco routers!!!
not sure if i understand correctly here, you looking to config SNMPv3 config all devices, yes that is possible.
If you doing mass 1000 of routers (if the router support netconf - i take the advantage of that)
This required some ground work to get all the device information, what you can do what you can not do, if they are new device running IOS XE you have different method to do.
if they are IOS, you need to do traditional SSH way.
I used Phyton most used case for my work to push the config to 500+ device it works as expected (with multi thread with Phython less than 10minutes).
i am explore now using netconf on IOS XE code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 07:55 AM
yes if the device suppport netconf
but easy is Python to push few command to many devices.
list all the device in file
list all the commands in file
run the script using that inputs. and verify.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 08:00 AM
try 1 or 2 device for testing, before you go mass level.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 06:26 AM - edited 06-22-2022 06:47 AM
want to add a commands that broadcast a template to all router
You mean config push to all the device, you need to bear in mind different devices has different config methods, some command may not work, but you can do basic config across all platforms.
i use Phython or any automation tool to do this task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 06:45 AM
Thanks to reply
but I want to know what 's automation tool can add commands to all router metro without typing each router ??
and also how i can use python for router Cisco !!!
thanks to reply me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 06:49 AM - edited 06-22-2022 06:50 AM
If you know the Python you can with netmiko as example :
https://pynet.twb-tech.com/blog/netmiko-python-library.html
you need some time to understand how that works and test few commands before you go mass level to deploy.
You need Linux or window running Python Library, Router or device do not hold any Python packages.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 07:07 AM
Ok thanks i will try to understand NETMIKO python how it work
also for automation tool can you give me example !!
thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 07:10 AM
automation tool can you give me example !!
Automation the one you looking to do, tools can be used depends what works for end user, this can be python, ansible, powershell, bash script to make this to work automated the task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 07:16 AM
there is script in python allows an example command (SNMP 3 script) broadcast to all routers once without writing the SNMPV3 script to 1000 cisco routers!!!
i wait your reply
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 07:22 AM - edited 06-22-2022 07:23 AM
here is script in python allows an example command (SNMP 3 script) broadcast to all routers once without writing the SNMPV3 script to 1000 cisco routers!!!
not sure if i understand correctly here, you looking to config SNMPv3 config all devices, yes that is possible.
If you doing mass 1000 of routers (if the router support netconf - i take the advantage of that)
This required some ground work to get all the device information, what you can do what you can not do, if they are new device running IOS XE you have different method to do.
if they are IOS, you need to do traditional SSH way.
I used Phyton most used case for my work to push the config to 500+ device it works as expected (with multi thread with Phython less than 10minutes).
i am explore now using netconf on IOS XE code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 07:33 AM
not sure if i understand correctly here, you looking to config SNMPv3 config all devices, yes that is possible.
Uyes that's i want to say ...without config each router with waste of time ... juste i want methode to allow this config quickly broadcast to all metro routers like ASR903, ME3800, ASR920...
so Bandi , i must use NETCONF in router cisco !! ??
thanks to reply me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 07:55 AM
yes if the device suppport netconf
but easy is Python to push few command to many devices.
list all the device in file
list all the commands in file
run the script using that inputs. and verify.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 07:58 AM
Ok i will try because it is the first time to use python
Thanks a lot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 08:00 AM
try 1 or 2 device for testing, before you go mass level.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 08:05 AM
Hello Bandi
i try to connecte switch layer 2 and this switch have a telnet and login : cisco and password cisco123
from netmiko import ConnectHandler
device = {
"device_type": "cisco_ios",
"host": '10.20.20.2',
"username": "cisco",
"password": "cisco123",
"port":23,# Log in password from getpass
}
connection = ConnectHandler(**device)
connection.enable()
config.send_config_from_fil('ospf.txt')
connection.disconnect()
Please i want your help :
+ choise of hard is correct or not !!! switch layer 2 ??
++ if scrpit work with telnet or ssh ??
++ "username": "cisco",
"password": "cisco123",
for equipment cisco or any login and password !!
I wait your reply for these questions!
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2022 09:43 AM - edited 06-23-2022 09:44 AM
If i understand the question - If there is no Manangement IP, then you will not be able to connect device.
If the Layer 2 device have management IP you can connect. (if the enable password there, you need to supply that too)
The script can work with telnet and SSH depends on requirement.
all examples already here : just edit the Python file as per the requirement and test it.
https://github.com/ktbyers/netmiko/tree/develop/examples
you can do for any equiment automation not limited to cisco :
https://github.com/ktbyers/netmiko/tree/develop/netmiko
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2022 12:04 AM
ommon causes of this problem are:
1. Invalid username and password
2. Incorrect SSH-key file
3. Connecting to the wrong device
Device settings: cisco_ios 10.20.20.2:22
error message show me !!
and the scrpit like that :
from netmiko import ConnectHandler
from getpass import getpass
cisco1 = {
"device_type": "cisco_ios",
"host": "10.20.20.2",
"username": "pyclass",
"password": getpass(),
}
# Show command that we execute
command = "show ip int brief"
with ConnectHandler(**cisco1) as net_connect:
output = net_connect.send_command(command)
# Automatically cleans-up the output so that only the show output is returned
print()
print(output)
print()
Please Balaji can you correct me !! this scrpit beacuse the first time i write pyhton !
Thnaks to reply me
