Page 1 of 1
Programming Generic Default Configs
Posted: Fri May 21, 2010 4:35 pm
by ejmerkel
We are planning on using some RB/411's as a wireless customer premise equipment. Basically we will have some people assembling the units into a Rootenna that are not MT saavy.
That being said what is the best way load a default configuration on the unit that sets up IP addresses, DHCP, NAT, DNS, and a generic wireless config without user intervention?
For simplicity I've been having our assemblers just copy up a backup config and then do a restore and I was curious if there was a good way to script or automate this?
Thanks for pointing me in the right direction!
Eric
Re: Programming Generic Default Configs
Posted: Fri May 21, 2010 5:35 pm
by changeip
You can place a default script to be run when the routerboard is reset to factory. Use netinstall to place this script onto the router. This script cannot be very long, but should get the job done for what you need. I really like to take either pieces from the MAC address or system ID and place them into dhcp client hostnames, system identity name, etc so you can identify them from headquarters once deployed.
Re: Programming Generic Default Configs
Posted: Fri May 21, 2010 8:46 pm
by ejmerkel
Do you have to reload the entire unit via netinstall to do this? I was thinking more of just scripting the upload of a configuration or backup.
Re: Programming Generic Default Configs
Posted: Sat May 22, 2010 12:56 am
by changeip
You can do this as well, just make the script a .rsc.auto and upload it. It will auto execute when finished uploading. (double check the file extension, I am going from memory.)
Re: Programming Generic Default Configs
Posted: Sat May 22, 2010 4:43 am
by roc-noc.com
You can do this as well, just make the script a .rsc.auto and upload it. It will auto execute when finished uploading. (double check the file extension, I am going from memory.)
from an early 3.0 beta changelog reference:
automatically execute uploaded scripts that have name *.auto.rsc
Tom
Re: Programming Generic Default Configs
Posted: Wed Jun 23, 2010 4:17 am
by charliebrown
Thought I'd post in here rather than start a new topic since this is close to what we want to do. Is there anyway to upload a script to a router and have it reset the config back to defaults and load that file? This would be extremely handy for our remote sites that may need clean config from time to time
Re: Programming Generic Default Configs
Posted: Wed Jun 23, 2010 2:17 pm
by ejmerkel
The way I have scripted uploading a default config is to use a couple of programs that come with putty. PSCP allows you to copy up backups or ROS images etc to the MT device. Then I use PLINK which allows you to login and run commands either individually or give PLINK a text file with MT commands. My batch file does the following:
1) Copy up latest ROS with PSCP
2) Copy a backup file with my base IP/pasword config to the router with PSCP
3) Restore backup and reboot base config via PLINK
4) After router comes back up, run all setup commands from a text file via PLINK
5) Upgrade routerboard firmware
6) Install
Here are a couple examples of using PSCP and PLINK.
Copy up ROS to a unit that has a default IP and no password.
pscp.exe admin@192.168.88.1 -scp routeros-mipsbe-4.10.npk admin@192.168.88.1
Run a single command on unit with password
plink.exe -pw YourPassword admin@192.168.88.1 "/system routerboard upgrade"
Run setup commands on unit from a text file called setup-commands.txt
plink.exe -pw YourPassword -m setup-commands.txt admin@192.168.88.1
Hope this helps.
Re: Programming Generic Default Configs
Posted: Thu Jun 24, 2010 1:45 am
by Chupaka
you may use NetInstall with some config provided. then that config will be used on reset-configuration, afair
Re: Programming Generic Default Configs
Posted: Thu Jun 24, 2010 2:16 am
by charliebrown
Hmm seems I cant do it then,
The trouble is these sites are remote with wireless access only, as soon as i reset the config the wireless will default back to disabled.
Re: Programming Generic Default Configs
Posted: Thu Jun 24, 2010 2:18 am
by Chupaka
then use
/system reset-configuration run-after-reset=bla-bla-bla
just don't forget to test it locally =)
Re: Programming Generic Default Configs
Posted: Thu Jun 24, 2010 6:26 am
by charliebrown
Just the command i've been looking for!!
Thanks!