Community discussions

MikroTik App
 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1424
Joined: Sun Sep 18, 2011 7:00 pm

create a my own default configuration to run after reset configuration

Tue Jul 28, 2015 6:05 pm

Hello ,
I have created a backup file of my router
now - I want it to run after I make reset configuration automatically
but when I run this command
/system reset-configuration run-after-reset=backup.rsc
it just reset the router to default and doesn't run any thing to the old configuration

why?


Thanks,
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: create a my own default configuration to run after reset configuration

Tue Jul 28, 2015 6:25 pm

Make sure it has no syntax errors. Also try to run it manually and see if there are no problems.
 
andyanthoine
newbie
Posts: 43
Joined: Wed Jun 12, 2013 3:41 am

Re: create a my own default configuration to run after reset configuration

Wed Jul 29, 2015 8:41 am

That's something mikrotik really lack, a Config checker.
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

create a my own default configuration to run after reset configuration

Wed Jul 29, 2015 9:06 am

Syntax checker is not enough. The script debugger is very necessary also.
 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1424
Joined: Sun Sep 18, 2011 7:00 pm

Re: create a my own default configuration to run after reset configuration

Wed Jul 29, 2015 10:00 am

I have run the file manually - working just fine
so this is not the problem
and this is the file I'm running - simple
# jan/02/1970 15:43:47 by RouterOS 6.23
# software id = UDIK-66WQ
#
/interface bridge
add mtu=1500 name=bridge1
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n frequency=auto l2mtu=2290 \
    mode=ap-bridge ssid=2.4Ghz wireless-protocol=802.11
set [ find default-name=wlan2 ] l2mtu=2290 mode=ap-bridge ssid=5Ghz \
    wireless-protocol=802.11
/ip neighbor discovery
set ether1 discover=no
set ether2 discover=no
set ether3 discover=no
set wlan1 discover=no
set wlan2 discover=no
set bridge1 discover=no
/ip pool
add name=dhcp_pool1 ranges=10.0.0.100-10.0.0.130
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=bridge1 lease-time=3h name=\
    dhcp1
/user group
add name=user policy="local,ssh,ftp,reboot,read,write,test,password,web,sensit\
    ive,!telnet,!policy,!winbox,!sniff,!api" skin=user1
/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=wlan1
add bridge=bridge1 interface=wlan2
/ip address
add address=10.0.0.1/24 interface=bridge1 network=10.0.0.0
/ip dhcp-server network
add address=10.0.0.0/24 dns-server=8.8.4.4 gateway=10.0.0.1
/ip service
set telnet disabled=yes
set ftp disabled=yes
set api disabled=yes
set winbox port=8299
set api-ssl disabled=yes
/system identity
set name=MultiRadioBaseStation
/tool mac-server mac-winbox
set [ find default=yes ] disabled=yes
/tool mac-server ping
set enabled=no
 
User avatar
pcunite
Forum Guru
Forum Guru
Posts: 1345
Joined: Sat May 25, 2013 5:13 am
Location: USA

Re: create a my own default configuration to run after reset configuration

Wed Jul 29, 2015 6:52 pm

The order things run in the script may be important, especially when creating interfaces that others depend on. Also, you appear to have a naming issue ... notice here:
set [ find default-name=wlan1 ] blah, blah
set [ find default-name=wlan2 ] blah, blah
Those are probably not the default names after /system reset-configuration.
 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1424
Joined: Sun Sep 18, 2011 7:00 pm

Re: create a my own default configuration to run after reset configuration

Thu Jul 30, 2015 4:14 pm

I have check - and yes they are the names
if I make al the setup manually - it does work
"reset configuration--> /import file=test.rsc" , it upload the file and work just fine

what else could it be ?

Thanks,
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: create a my own default configuration to run after reset configuration

Thu Jul 30, 2015 4:26 pm

Add delay at the beginning. Or loop to delay until wireless interfaces are loaded.
 
Rudios
Forum Veteran
Forum Veteran
Posts: 973
Joined: Mon Mar 11, 2013 12:58 pm
Location: The Netherlands

Re: create a my own default configuration to run after reset configuration

Fri Jul 31, 2015 9:45 am

Also worth adding no-defaults=yes and skip-backup=yes to the reset command.
This will prevent the router from building the default setup (like the 88.1 IP address etc.)

Who is online

Users browsing this forum: Bing [Bot], Kanzler, Marc1963, raiser and 190 guests