How to create python script to configure connectport WAN

Hello guys

i’m new [:))]

How I can create python script to configure connectportwan.

I need modify or down dhcp server and fill with another IP and netmask, also I need modify portforwarding settings.

Someone can tell me how begin this script?

I know python, but I don’ know how digi interpreters scripts from the page configuration.

Thanks in advance.


You’ll need the CLI commands for changing the IP address, DHCP, etc.:

After that, It’ll be something like this:

import digicli

status, output = digicli.digicli(‘show net’)

if status:
for line in output:
if line.find(‘MAC Address’) >= 0:
l = line.split(‘:’)
print “”.join(l[1:]).strip()

Your other option would be to send RCI commands directly to the device (check out the RCI Command Specification doc on our web site for all commands), or send the RCI command wrapped in an SCI command if sending from a PC to iDigi.