Revert RB751G to default config after custom netinstall

How to revert RouterBOARD 751G-2HnD to state where default factory settings are applied once reset button is used?
I had used Netinstall with custom settings script, so now reset button reverts to settings applied by that script.
Do I need to use Netinstall with special factory settings script? If yes, can anyone provide script used on RB751G?
Or can I revert to factory configuration using Netinstall without any special scripts?

System reset will always revert to the last configuration applied by Netinstall. If you no longer want your custom config to be the reset state, NetInstall again with either a new custom config, or none if you want a blank slate.

/system default-configuration print

will show factory default configuration even if it is override by different NetInstall script.

The factory configuration of various models can be seen here:
http://wiki.mikrotik.com/wiki/Manual:Default_Configurations

Thank you, jgellis!
But this doesn’t help me much as script shown by

/system default-configuration print

isn’t pure configuration commands (accepted by Netinstall), but a script. The biggest problem for me is to display dialog that offers to remove config on first login.
I wonder whether this can be enable by Netinstall? Or ideally whether Netinstall can return my routerboard to the factory state?

@Davis
Attached you can find default script for 751U, but AFAIK for 751G is the same.
RB751U-2HnD_Default_Config_Script.zip (1.85 KB)
Use it as configure script for Netinstall.

HTH,

Thank you! But this is output from

/system default-configuration print

AFAIK this cannot be used as Netinstall configure script. I even tried to use it and configuration wasn’t applied at the end of Netinstall, nor it was applied by using reset button for 10 seconds.

If there is no clean way to reapply factory defaults on reset (any comments from MikroTik?), then I will have to extract a simple block of configuration commands (usable as Netinstall configure script) from this script.
Does anyone know how to display the Accept or Remove configuration dialog on first Winbox/console session?

No, this is script shown in Winbox after reset to factory default.
It’s bad news that is unusable :frowning: .

Regards,

My last two suggestions:

Save the output of

/system default-configuration print

to a factoryconfig.rsc text file. Upload this to the router and execute a

/system reset-configuration run-after-reset=factoryconfig.rsc

-OR-


Do a Netinstall without keeping configuration and without configuration script.
Mac-Winbox into clean device and paste in the saved output from your previous

/system default-configuration print

After that configuration is complete, export the config and save it for use on other RouterBOARD 751G-2HnD.

I realize that it doesn’t get you back to the dynamic script from the factory, but it will be the final factory config after their dynamic script executes

You could even make it a little bit smarter by leaving some of the dynamics in there and making it a startup script instead of running it, but I cannot come up with a method to get back to the user prompting on first terminal or winbox logic.

Quite frankly, I prefer custom installation scripts that are tailored to my needs rather than the factory’s, but I’m sure there is a valid reason you are asking for it that I don’t need to know.

I created a file with RouterOS configuration commands (usable as Netinstall configure script) from script outputed by

/system default-configuration print

There main difference is MAC Server configuration (my config commands disable the default all interface before adding required interfaces). Also it was interesting to look at MAC Server configuration in configuration fike that I exported while RB751G was brand new with RouterOS 5.6

/tool mac-server
set (unknown) disabled=no interface=ether2-master-local
set (unknown) disabled=no interface=ether3-slave-local
set (unknown) disabled=no interface=ether4-slave-local
set (unknown) disabled=no interface=ether5-slave-local
set (unknown) disabled=no interface=wlan1
set (unknown) disabled=no interface=bridge-local

Configuration commands are here ( :exclamation: replace 02:03:04:05:06:07 with MAC address of ether2)

/interface wireless set wlan1 mode=ap-bridge band=2ghz-b/g/n frequency=2412 ht-txchains=0,1 ht-rxchains=0,1 \
    disabled=no wireless-protocol=any distance=indoors;
/interface wireless set wlan1 channel-width=20/40mhz-ht-above ;
/interface set ether1 name="ether1-gateway";
/ip dhcp-client add interface=ether1-gateway disabled=no comment="default configuration";
/interface
set ether2 name=ether2-master-local;
set ether3 name=ether3-slave-local;
set ether4 name=ether4-slave-local;
set ether5 name=ether5-slave-local;
/interface ethernet
set ether3-slave-local master-port=ether2-master-local;
set ether4-slave-local master-port=ether2-master-local;
set ether5-slave-local master-port=ether2-master-local;
/interface bridge
add name=bridge-local disabled=no auto-mac=no protocol-mode=rstp;
set "bridge-local" admin-mac=02:03:04:05:06:07;
/interface bridge port
add bridge=bridge-local interface=ether2-master-local;
add bridge=bridge-local interface=wlan1;
/ip address add address=192.168.88.1/24 interface=bridge-local comment="default configuration";
/ip pool add name="default-dhcp" ranges=192.168.88.10-192.168.88.254;
/ip dhcp-server
    add name=default address-pool="default-dhcp" interface=bridge-local disabled=no;
/ip dhcp-server network
    add address=192.168.88.0/24 gateway=192.168.88.1 dns-server=192.168.88.1 comment="default configuration";
/ip firewall
nat add chain=srcnat out-interface=ether1-gateway action=masquerade comment="default configuration";
filter add chain=input action=accept protocol=icmp comment="default configuration";
filter add chain=input action=accept connection-state=established comment="default configuration";
filter add chain=input action=accept connection-state=related comment="default configuration";
filter add chain=input action=drop in-interface=ether1-gateway comment="default configuration";
/tool mac-server
set 0 disabled=yes;
add interface=ether2-master-local disabled=no;
add interface=ether3-slave-local disabled=no;
add interface=ether4-slave-local disabled=no;
add interface=ether5-slave-local disabled=no;
add interface=wlan1 disabled=no;
add interface=bridge-local disabled=no;
/tool mac-server mac-winbox
set 0 disabled=yes;
add interface=ether2-master-local disabled=no;
add interface=ether3-slave-local disabled=no;
add interface=ether4-slave-local disabled=no;
add interface=ether5-slave-local disabled=no;
add interface=wlan1 disabled=no;
add interface=bridge-local disabled=no;
/ip neighbor discovery set ether1-gateway disabled=yes;
/ip dns
set allow-remote-requests=yes;
static add name=router address=192.168.88.1;

I have written an e-mail to MikroTik support about the dialog asking to confirm the defaults and they responded that it’s not possible to get this dialog back once factory defaults have been overwritten by Netinstall.

Thanks jgellis and ditonet for your support!
BTW

Answer is simple - I want to restore router to factory state before selling it (as used, of course).