Created
September 30, 2014 02:48
-
-
Save fredhsu/2430dcfbd9ba0d7c60c3 to your computer and use it in GitHub Desktop.
Simple eAPI script to try out different ip addresses on an interface. Starting a 3 and going until 254
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jsonrpclib | |
import time | |
name = "demo1" | |
switchReq = jsonrpclib.Server("http://admin:admin@" + name + | |
"/command-api") | |
for i in range(3,2545: | |
ipaddr = "ip address 2.2.2.{}/24".format(i) | |
response = switchReq.runCmds(1, ["enable", "configure", "interface ethernet 52", ipaddr]) | |
print "trying " + ipaddr | |
time.sleep(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment