Community discussions

MikroTik App
 
User avatar
Smoerrebroed
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 75
Joined: Mon Feb 12, 2018 10:21 am

Config does not get imported after reset but seems valid when imported manually

Wed Jan 12, 2022 11:14 am

Hi All,

I've come across something that I cannot really comprehend: I have created a kind of basic config file (.rsc) for my APs so I can quickly deploy a default setup. This is the configuration:
# oct/28/2021 13:05:07 by RouterOS 6.49
# software id = 60JV-F595
#
# model = 962UiGS-5HacT2HnT
# serial number = abcdefg
/user
add name=xyz group=full password=xyz*
/interface ethernet
set [ find default-name=ether2 ] disabled=yes
set [ find default-name=ether3 ] disabled=yes
set [ find default-name=ether4 ] disabled=yes
set [ find default-name=ether5 ] disabled=yes
set [ find default-name=sfp1 ] disabled=yes
/interface bridge
add comment=defconf name=bridge
/interface list
add comment=defconf name=LAN
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=sfp1
add bridge=bridge comment=defconf interface=wlan1
add bridge=bridge comment=defconf interface=wlan2
add bridge=bridge interface=ether1
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
/interface wireless cap
set bridge=bridge certificate=request discovery-interfaces=bridge enabled=yes \
    interfaces=wlan1,wlan2 lock-to-caps-man=yes
/ip dhcp-client
add comment=defconf disabled=no interface=bridge
/system clock
set time-zone-autodetect=yes
/system identity
set name=MikroTik
/system leds
set 0 disabled=yes
set 1 disabled=yes
/system leds settings
set all-leds-off=immediate
/system ntp client
set enabled=yes
/system routerboard settings
set auto-upgrade=yes
/system routerboard mode-button
set enabled=yes on-event=dark-mode
/user
remove admin
As you can see, there's really nothing overly complex in there. However, when I try to reset the configuration and load this one initially, none of the settings will take effect. So I thought that maybe the script is faulty or has some syntax issues, but when importing exactly this script manually (after resetting the configuration), everything is applied as intended. Also, running this as a script poses no issues.

So my question is: Why does the configuration file not get applied automatically (after resetting the config) when importing it manually works like a charm. Any ideas where I might start looking? TIA!

Cheers,

Smoerrebroed
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2983
Joined: Mon Apr 08, 2019 1:16 am

Re: Config does not get imported after reset but seems valid when imported manually

Wed Jan 12, 2022 2:09 pm

"There are issues with it. After some version somewhere in the 6.35..6.39 timeframe it stopped working because the script was started "too soon" after the boot and the router was not ready to accept the config commands. So it silently failed. This has not been fixed even today, but it can be remedied by putting a /delay 30 at the top of the file. (download it, edit it, and re-upload)"
from : viewtopic.php?p=888155#p888155
 
User avatar
Smoerrebroed
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 75
Joined: Mon Feb 12, 2018 10:21 am

Re: Config does not get imported after reset but seems valid when imported manually

Wed Jan 12, 2022 7:10 pm

Alright! Somehow I didn't find this detail when searching the forum. Will give it a try and report back.

Perhaps this could be fixed now that we're on 7.1.x? ;-)
 
User avatar
Smoerrebroed
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 75
Joined: Mon Feb 12, 2018 10:21 am

Re: Config does not get imported after reset but seems valid when imported manually

Thu Jan 13, 2022 7:04 pm

So, just to complete this: /delay 30 did not help (not even /delay 60), so I daresay something is profoundly broken with the run-after-reset-scripts. Anyway, this just means that I need to manually import the config and be good, so it's not a big deal. At least now I know that it wasn't me doing anything wrong. ;) Thanks again!
 
noradtux
newbie
Posts: 39
Joined: Mon May 24, 2021 6:33 pm

Re: Config does not get imported after reset but seems valid when imported manually

Wed Jan 19, 2022 2:28 pm

So, just to complete this: /delay 30 did not help (not even /delay 60), so I daresay something is profoundly broken with the run-after-reset-scripts. Anyway, this just means that I need to manually import the config and be good, so it's not a big deal. At least now I know that it wasn't me doing anything wrong. ;) Thanks again!
Have you tried no-defaults=yes when doing the config reset?
 
User avatar
Smoerrebroed
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 75
Joined: Mon Feb 12, 2018 10:21 am

Re: Config does not get imported after reset but seems valid when imported manually

Mon Feb 14, 2022 2:02 pm

I have, and it didn't change a thing - but I wouldn't expect it to make a difference anyway. ;)

Who is online

Users browsing this forum: stefanau and 24 guests