Community discussions

MikroTik App
 
millenium7
Long time Member
Long time Member
Topic Author
Posts: 585
Joined: Wed Mar 16, 2016 6:12 am

Best practice for loading template configs?

Mon Aug 07, 2017 2:54 am

What is the best method for copying over template configs to routers?
If I use the file backup/restore option it also replaces all the MAC addresses on the device, big problem if installing more than 1 router onsite as they have duplicate MAC's

If I use the terminal to export the config, then copy/paste over, some settings are not entered such as the system password
And the other problem is because the bridge port creation is closer to the top of the page then when I paste it in I can get kicked off and most of the commands aren't entered, so I either have to manually check the last place it got to (just pasting again creates problems, duplicate entries) or I have to manually move parts of the template config around so that the Bridge port assignment is done last so it doesn't kick me off. I also have to manually enter some commands such as /system password

Is there a better and easier way to do template configs?
It would be ideal if MikroTik would implement a file restore option "Do not inherent system specific settings" so that it does not copy over MAC addresses etc
 
User avatar
AlainCasault
Trainer
Trainer
Posts: 632
Joined: Fri Apr 30, 2010 3:25 pm
Location: Prévost, QC, Canada
Contact:

Re: Best practice for loading template configs?

Mon Aug 07, 2017 3:08 am

Hello

I use an export file that I've cleaned up and added the required missing commands.
So yes, you can have a template with admin password.
Copy it over and as you reset the router, use the .rsc file to load at bootup. If something is missing after rebooting, its because the file has an error.

In that case, load it manually doing Copy&Paste until you find the error. Once corrected, that template is good to go for other routers.

Sent from Tapatalk
 
tangram
Member Candidate
Member Candidate
Posts: 132
Joined: Wed Nov 16, 2016 9:55 pm

Re: Best practice for loading template configs?

Mon Aug 07, 2017 10:31 am

Hi,

I haven't managed to do this remotely. When I have direct access to device I use the rsc way. Reset, clear the default config and import the rsc.
The rsc uses a lot of set [ find where...] for replacing default values and you can edit it with site specific parameters. Works great and it's fast too.
 
millenium7
Long time Member
Long time Member
Topic Author
Posts: 585
Joined: Wed Mar 16, 2016 6:12 am

Re: Best practice for loading template configs?

Tue Aug 08, 2017 12:49 pm

Hi,

I haven't managed to do this remotely. When I have direct access to device I use the rsc way. Reset, clear the default config and import the rsc.
The rsc uses a lot of set [ find where...] for replacing default values and you can edit it with site specific parameters. Works great and it's fast too.
While I don't use it myself, can't you use the "Run After Reset" option in System->Reset configuration to load a .rsc?
However upon further reading into this it appears this can have some issues, predominantly because there may be some commands that rely on drivers that have not fully loaded yet (i.e. wireless, LTE) when the import commands executes after reboot
Hello

I use an export file that I've cleaned up and added the required missing commands.
So yes, you can have a template with admin password.
Copy it over and as you reset the router, use the .rsc file to load at bootup. If something is missing after rebooting, its because the file has an error.

In that case, load it manually doing Copy&Paste until you find the error. Once corrected, that template is good to go for other routers.

Sent from Tapatalk
Do you use export, export verbose or export compact to create the rsc?
I actually tried all 3 and none of them change the password of the default admin account or create other users.
And while its not a big deal I would like a more..... reliable restore method that overwrites EVERYTHING. rsc files or manually copy/pasting the config has the problem whereby it only issues the commands in the .rsc, things that are missing are not overriden

I wish Mikrotik would release a better backup method, pretty much the only thing required is to strip MAC addresses from backup files on restore.....
However I was thinking maybe there's a way to do this since we can do have scripts execute 'on startup'. So maybe create a template config, create a script that goes through all interface and resets the MAC address?
I can see that you can do this to ethernet interfaces with /interface ethernet reset-mac-address
But I can't see how to easily do it for all bridge and wireless interfaces?
 
tangram
Member Candidate
Member Candidate
Posts: 132
Joined: Wed Nov 16, 2016 9:55 pm

Re: Best practice for loading template configs?

Tue Aug 08, 2017 1:09 pm

Hi,

I haven't managed to do this remotely. When I have direct access to device I use the rsc way. Reset, clear the default config and import the rsc.
The rsc uses a lot of set [ find where...] for replacing default values and you can edit it with site specific parameters. Works great and it's fast too.
While I don't use it myself, can't you use the "Run After Reset" option in System->Reset configuration to load a .rsc?
However upon further reading into this it appears this can have some issues, predominantly because there may be some commands that rely on drivers that have not fully loaded yet (i.e. wireless, LTE) when the import commands executes after reboot
As you said there are problems and hasn't worked very well for me. I also upgrade firmware, import certificates and ssh keys with the rsc so I need these files copied before the rsc runs.
You could argue that this can be automated a little but since i don't see a way to do it right without some input from the user i don't mind the 5mins it takes to configure.
 
User avatar
AlainCasault
Trainer
Trainer
Posts: 632
Joined: Fri Apr 30, 2010 3:25 pm
Location: Prévost, QC, Canada
Contact:

Re: Best practice for loading template configs?

Tue Aug 08, 2017 1:27 pm

Hello millennium 7,

I was about to suggest to restore a binary and clearing the MACs.

But that has certain issues. I would stick with the export (just export) and build upon it.

I'm lazy and like automation ;) but when it comes down to it, I'll use whatever method gives me the best results even if it means extra work. Also, using the export can be adapted when those ROS upgrades bring little changes to the parameters.

Sent from Tapatalk
 
AKuntsevich
just joined
Posts: 3
Joined: Tue Aug 08, 2017 5:34 pm

Re: Best practice for loading template configs?

Tue Aug 08, 2017 5:39 pm

After 6.40 export/import works? I try it, but configured only bridge and wlan1, other settings don't set up.
In 6.39 it was goot.

Who is online

Users browsing this forum: No registered users and 55 guests