I am interested in a script that uses only a mac address in the format XX:XX:XX:XX:XX:XX OR XXXX.XXXX.XXXX to execute 5 static commands across multiple routers.
Essentially i want to be able to copy/paste a mac address for a program such as SecureCrt/Putty. After i paste the mac address i would like the following commands to execute on after the other
1. sh cab mod 'COPIED MAC ADDRESS'
2. sh cab mod 'COPIED MAC ADDRESS' conn
3. sh cab mod 'COPIED MAC ADDRESS' flap
4. sh cab mod 'COPIED MAC ADDRESS' cpe
5. sh ip arp
Is this possible. below is what is was able to come up with so far using script recorder in Secure Crt, upon that i don't know what else to do.
Problem 1
I would have to know what router the mac address is on to run the script. (i would like script to run all routers i have connected at one time) Note: if i have to do each router at a time that is ok if aforementioned is not possible and/or scripting to complex
Problem 2
Because mac address' are different and i have to manually input them i would mean that commands 2-5 would not execute if using script below.
I am sure that there is a way the edit script where after MAC ADDRESS is copied into command_1 , that same MAC ADDRESS will be place into subsequent commands 2-4. But i just don't know the programming language.
Can some please assist per below
#$language = "VBScript"#$interface = "1.0"
crt.Screen.Synchronous = True
' This automatically generated script may need to be
' edited in order to work correctly.
Sub Main
crt.Screen.Send "sh cab mod FF:FF:FF:FF:FF:FF" & chr(13)
crt.Screen.WaitForString "Switch>"
crt.Screen.Send "sh cab mod FF:FF:FF:FF:FF:FF conn" & chr(13)
crt.Screen.WaitForString "Switch>"
crt.Screen.Send "sh cab mod FF:FF:FF:FF:FF:FF flap" & chr(13)
crt.Screen.WaitForString "Switch>"
crt.Screen.Send "sh cab mod FF:FF:FF:FF:FF:FF cpe" & chr(13)
crt.Screen.WaitForString "Switch>"
crt.Screen.Send "sh ip arp " & chr(13)
End Sub