Community discussions

MikroTik App
 
guroth
newbie
Topic Author
Posts: 30
Joined: Mon Jun 26, 2006 9:01 pm

Preconfigure new/replacement wireless card?

Mon Oct 29, 2012 10:17 pm

Currently if you replace a configured wireless card in a routerboard then the new card will be unconfigured and disabled. If you put the original card back in then the routerboard will "remember" the settings of the old card and not require configuration. Is there any way to preconfigure a card before inserting it to the routerboard so that once the new card is in place the mikrotik will "remember" the configuration for it, even though it has never been previously installed?

For example, I have a routerboard with an 802.11a card that I would like to replace with an 802.11n card. I would like to be able to add a configuration for the N card before physically inserting it, so that it requires no configuration after installation.
 
samsung172
Forum Guru
Forum Guru
Posts: 1191
Joined: Sat Apr 04, 2009 3:45 am
Location: Østfold - Norway
Contact:

Re: Preconfigure new/replacement wireless card?

Mon Oct 29, 2012 11:42 pm

ros code

/interface wireless export compact file=settings.rsc

Then after changing card.

ros code

/import settings.rsc
 
guroth
newbie
Topic Author
Posts: 30
Joined: Mon Jun 26, 2006 9:01 pm

Re: Preconfigure new/replacement wireless card?

Tue Oct 30, 2012 8:27 pm

Thank you for the recommendation, but the solution I'm hoping for would not require me to log into the routerboard after installing the new card. The idea is to remove that step entirely so that the tech installing the card can simply swap the card and be done, without having to open a computer and log into the routerboard afterwards.
 
User avatar
Aug
Member
Member
Posts: 312
Joined: Thu Jun 07, 2007 2:10 am

Re: Preconfigure new/replacement wireless card?

Tue Oct 30, 2012 10:37 pm

Take a look here.
http://wiki.mikrotik.com/wiki/Manual:Co ... tic_Import

Combined with
/interface wireless export compact file=settings.auto.rsc
you should be able to get it the way you want it.
 
h3ll1
just joined
Posts: 15
Joined: Thu Mar 31, 2005 11:34 am

Re: Preconfigure new/replacement wireless card?

Tue Oct 30, 2012 10:57 pm

I did back in the days several posts about this issue, but no one from mikrotik ever took it into account. Dont bother even think about it - write your config to a file, and restore one by one.
 
User avatar
Hotz1
Member
Member
Posts: 393
Joined: Tue Oct 09, 2007 6:55 am

Re: Preconfigure new/replacement wireless card?

Wed Oct 31, 2012 4:19 pm

http://wiki.mikrotik.com/wiki/Manual:Co ... tic_Import Combined with
/interface wireless export compact file=settings.auto.rsc
you should be able to get it the way you want it.
If a field tech replaces a radio card, and that radio is how the box joins your network, then you won't be able to ftp the auto.rsc file remotely; the field tech will have to do it.

Here is another approach that requires a little more setup, but will be much more turn-key for the installer:
  • Create & store the radio configuration as startup.rsc
  • Create a system script named "startup-config" that looks for startup.rsc, imports it, and then deletes it (or renames it to startup.bak, in case something goes wrong)
  • Create a scheduler event named "on-startup" that runs "startup-config" at start-time=startup
The field tech powers down the board, swaps radio cards, then powers it back up. The "on-startup" event runs at startup, which runs "startup-config". That script finds and imports startup.rsc, then renames/deletes it. If you think there is a chance that the tech will need to power it up more than once, omit the rename/delete step, and the startup.rsc script will run every time the box is rebooted, until you can log on remotely and disable it.

As usual, scripting is left as an exercise for the reader, and the posting of successful solutions is encouraged. :-)
 
guroth
newbie
Topic Author
Posts: 30
Joined: Mon Jun 26, 2006 9:01 pm

Re: Preconfigure new/replacement wireless card?

Wed Oct 31, 2012 8:26 pm

Thanks for the ideas. I'm sure the scripting can be made as complicated as desired but I was able to achieve success with the following in a lab scenario.


Before tech goes out to replace card, export current wireless settings to file
/interface wireless export compact file=cardconfig.rsc
add a scheduler to activate on startup that imports the config
/system scheduler add disabled=no interval=0s name=setup-card on-event="/import cardconfig.rsc" policy=read,write start-time=startup
Tech powers down routerboard, replaces card, powers up routerboard. New card is properly configured according to the exported settings. Scheduler is then disabled by remote office when it is determined to no longer be needed.


other settings tied to the interface are still lost, such as IP or bridge port, but you can add those settings to the import file or have the scheduler import multiple files on startup to restore additional settings.
 
samsung172
Forum Guru
Forum Guru
Posts: 1191
Joined: Sat Apr 04, 2009 3:45 am
Location: Østfold - Norway
Contact:

Re: Preconfigure new/replacement wireless card?

Thu Nov 01, 2012 12:21 am

its possible to do a /export compact (just not only the wireless settings) and all should be ok.

there is manny ways to run the script. Easiest way is to do a ping up/ ping down on a device only reachible to wlan interface.
 
guroth
newbie
Topic Author
Posts: 30
Joined: Mon Jun 26, 2006 9:01 pm

Re: Preconfigure new/replacement wireless card?

Tue Nov 06, 2012 11:26 pm

I ran into issues when doing a large export. One easily reproducible error is with "/ip address". If ether1 has 192.168.1.1, so the export contains "/ip address set 0 address=192.168.1.1", then the import will error because the interface already has that IP address, causing the rest of the import to fail entirely.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26380
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Preconfigure new/replacement wireless card?

Wed Nov 07, 2012 10:46 am

I ran into issues when doing a large export. One easily reproducible error is with "/ip address". If ether1 has 192.168.1.1, so the export contains "/ip address set 0 address=192.168.1.1", then the import will error because the interface already has that IP address, causing the rest of the import to fail entirely.
which RouterOS version was the export from and which version you imported it into? Latest versions have "export compact" and there should be no such issues. Also what you can try is use "/system reset no-defaults=yes run-after-reset=import.rsc"

Who is online

Users browsing this forum: No registered users and 39 guests