Community discussions

MikroTik App
 
xfasoulis
just joined
Topic Author
Posts: 2
Joined: Fri Feb 10, 2023 10:06 pm

AutoConfigScriptStopWorking on Hap ac 2-rbd52g

Mon Apr 10, 2023 11:59 am

Hi! I had made a script to do automatic configuration to any mikrotik with deafault configuration be on the network with ip 192.168.88.1 , the script was made for mikrotik hap lite ac ,
now im trying to do it with mikrotik rbd52g hap ac 2 but is not working, Is doing the first step (reset) but is not going to the second step config.rsc.

The script is working like this:
We have a main mikrotik in the same network that we put an ip 192.168.88.2/24

we make a netwatch script :
/tool netwatch
add host=192.168.88.1 interval=10s up-script="/tool fetch mode=ftp address=192.168.88.1 user=\"admin\" password=\"\" upload=yes src-path=config.rsc dst-path=config.rsc\r\
\n/tool fetch mode=ftp address=192.168.88.1 user=\"admin\" password=\"\" upload=yes src-path=reset.auto.rsc dst-path=reset.auto.rsc\r\
\n"

then we make a file reset.auto.rsc :
/system reset-configuration skip-backup=yes no-defaults=yes run-after-reset=config.rsc

and then a file config.rsc :
:delay 15s

/tool romon
set enabled=yes
# create temporary eoip to grab mac addresses
/interface eoip add name=random tunnel-id=1 remote-address=1.1.1.1 local-address=2.2.2.2
:global randommac [ /interface eoip get random mac-address ]
:put [ /interface eoip get random mac-address ]
#remove eoip
/interface eoip remove 0

/interface bridge
add admin-mac=$randommac auto-mac=no comment=defconf name=bridgeLocal

/interface bridge port
add bridge=bridgeLocal comment=defconf interface=ether1
add bridge=bridgeLocal comment=defconf interface=ether2
add bridge=bridgeLocal comment=defconf interface=ether3
add bridge=bridgeLocal comment=defconf interface=ether4
add bridge=bridgeLocal comment=defconf interface=ether5
/interface wireless cap
set bridge=bridgeLocal discovery-interfaces=bridgeLocal enabled=yes interfaces=wlan1

/ip dhcp-client
add comment=defconf disabled=no interface=bridgeLocal

/system clock
set time-zone-name=Europe/Athens

/snmp set enabled=yes
/snmp community set 0 name=fielsnmp addresses=0.0.0.0/0
/system identity set name=MikrotikOK
/file remove numbers=0,1
/user set 0 password="12345678"

On mikrotik hap lite is working but on mikrotik hap ac 2 is not working
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 2876
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: AutoConfigScriptStopWorking on Hap ac 2-rbd52g

Mon Apr 10, 2023 1:31 pm

Try to copy&paste this script to terminal on the new device and watch where it stops with error
 
xfasoulis
just joined
Topic Author
Posts: 2
Joined: Fri Feb 10, 2023 10:06 pm

Re: AutoConfigScriptStopWorking on Hap ac 2-rbd52g

Mon Apr 10, 2023 1:39 pm

I do it allready .... It's not stop....

Who is online

Users browsing this forum: No registered users and 15 guests