Community discussions

MikroTik App
just joined
Topic Author
Posts: 1
Joined: Wed Nov 06, 2013 7:00 pm

Default Configuration not running RB2011

Wed Nov 06, 2013 7:08 pm


I've got an RB2011 on RouterOS 6.5 that has an issue when trying to reset it to defaults. If you run "/system reset-configuration" it will become inaccessible afterwards. By connecting using the mac address and winbox I was able to confirm that the default configuration script is not running. When I check "/system default-configuration print" the script is present and unaltered, it just seems as if any time you attempt to run the reset-configuration its as if it has no-defaults set to yes.

I've been able to somewhat bypass this by just running the "Apply" portion of the script on its own after the reset, but this is not practical and I'd like to fix this before deploying it. Anyone run into this problem before? I believe my next step to try is re-install the RouterOS via netinstall with the default script pulled from a different RB2011.
just joined
Posts: 6
Joined: Mon Mar 24, 2014 9:35 am

Re: Default Configuration not running RB2011

Mon Mar 24, 2014 9:39 am

I encountered this issue on a RB951-2n, even when re-entering the original script as a default script.

Has anyone figured out what could be causing the default script not to run?
just joined
Posts: 6
Joined: Mon Mar 24, 2014 9:35 am

Re: Default Configuration not running RB2011

Tue Mar 25, 2014 11:22 am

I got past this error today.

The main thing I learned is that, yes, I actually do need to read the scripting manual first! Although copy/alter/upload seems like it should work, my experience was quite different.

The first ray of hope, when I realised I hadn't bricked the router, came when I realised that mac telnet still worked.

The next day I soldered on a tty-level serial console for easier access/control and peace of mind as to what was going on.

When I realised the script wasn't configuring the machine, I assumed it wasn't running and started to try and work out why. I was hampered by trying to do this without actually having learned Mikrotik scripting myself yet.

By sending a one-liner static address script (which worked) I realised I had to take a closer look at what I was feeding to the router.

One big problem turned out to be pasting back the factory script and expecting it to work.
In one forum post I read that only the initial mikrotik script gets put inside that wrapper which prints the #| comments out of the script then sets the global action variable, by prompting the user to accept/revert changes. I theorized that my script needed to work without depending on $action being set to 'apply', so I stripped out the entire 'remove' block, plus the condition brackets around the 'apply' block. Since getting the script working I didn't try re-adding apply/remove logic, but I guess it might not work.

After realising the script still wasn't taking effect, it was time (if not way sooner than then) to run the thing and figure out why.
Starting with (unwantedly) virgin config, I added an IP address, connected by ftp and uploaded the rsc file. running /import on the filename, I could see some issues. Besides the bits I already stripped, these had to go -

* the 'script: ' starting clause - it causes an error
* leading whitespace before '#' comments has to go
* local vars dhcpEnabled and wirelessEnabled were not recognized after declaration. giving the script an enclosing scope-block with { } fixed this

next attempt, the script imported fine, and my config was in the router. It was time to test netinstall again, and this time all went well

Who is online

Users browsing this forum: GoogleOther [Bot], mattx, stevemarple and 23 guests