-
Notifications
You must be signed in to change notification settings - Fork 0
/
4-6.py
48 lines (35 loc) · 975 Bytes
/
4-6.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#! /usr/bin/env python
'''
Python for Network Engineers week 4 exercise 6:
Use Netmiko to execute 'show arp' on pynet-rtr1, pynet-rtr2, and juniper-srx.
Stacy Sherman 8/24/16
'''
from netmiko import ConnectHandler
pynet1 = {
'device_type': 'cisco_ios',
'ip': '184.105.247.70',
'username': 'pyclass',
'password': '88newclass',
}
pynet2 = {
'device_type': 'cisco_ios',
'ip': '184.105.247.71',
'username': 'pyclass',
'password': '88newclass',
}
pynet3 = {
'device_type': 'juniper',
'ip': '184.105.247.76',
'username': 'pyclass',
'password': '88newclass',
}
rtr_list = [pynet1, pynet2, pynet3]
def main():
for device in rtr_list:
rtr_conn = ConnectHandler(**device)
output = rtr_conn.send_command("show arp")
print device['ip'], " ARP Table:\n"
print "==========================================================="
print output, "\n"
if __name__ == '__main__':
main()