Hi -
I'm trying to write an API script (attached) that auto-configures my mAP 2n router (firmware v3.24, webfig 6.30.4), using the ETH2 interface. However, often, when I run the script (using the Python library) the router ends up in an inconsistent state where I can't even ping it from over ETH2 (from the machine with the MAC address B8:27:EB:68:20:AF). When I run dhclient it gets the correct IP address (192.168.103.254), but says "network unreachable" and has no route for eth0 in "route -n". Then when I manually give it an IP address in the old subnet by runing "ifconfig eth0 192.168.88.22" I get a route, but pinging the old IP address gives "destination host unreachable". Then when I connect via WiFi using my laptop on (the old SSID which still seems to be advertised, not the new one that should have replaced it in the script) it gives my laptop an IP address from the new DHCP pool (192.168.103.250) but when I run "arp -a" I get:
? (17.253.34.253) at (incomplete) on en0 ifscope [ethernet]
? (80.80.80.80) at (incomplete) on en0 ifscope [ethernet]
router (192.168.88.1) at e4:8d:8c:3c:f9:6a on en0 ifscope [ethernet]
? (192.168.103.1) at (incomplete) on en0 ifscope [ethernet]
? (192.168.103.255) at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]
? (224.0.0.1) at 1:0:5e:0:0:1 on en0 ifscope permanent [ethernet]
? (224.0.0.251) at 1:0:5e:0:0:fb on en0 ifscope permanent [ethernet]
which seems to indicate that the IP address of the router is 192.168.88.1, but the rest of the DHCP settings are now on the 192.168.103.0/24 subnet.
So all I can think of, is that it doesn't complete running the setup script (though it doesn't return any errors, just a single ret=2), perhaps because changing the DHCP settings causes the API's connection with the router to be lost. Is the likely? And if so, what can I do to prevent it?
Any help HUGELY appreciated!
Thanks!!!
API Script:
routeros-script1-anony.txt (788 Bytes)
Script output:
routeros-script1-out-anony.txt (1.13 KB)