Community discussions

MikroTik App
 
User avatar
cmon69
Member Candidate
Member Candidate
Topic Author
Posts: 160
Joined: Sun Dec 10, 2006 2:23 am
Location: Waseca, Minnesota US
Contact:

Script needed

Wed Sep 22, 2010 8:13 am

Anyone know where I should start when it comes to creating a script that will change SSID, wlan IP Address, and Route Gateway on reboot?
 
hrvoje
just joined
Posts: 24
Joined: Fri Jun 11, 2010 12:39 pm
Location: Croatia

Re: Script needed

Wed Sep 22, 2010 4:23 pm

tools/netwatch ?
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: Script needed

Fri Sep 24, 2010 5:11 pm

What is the goal of the script? But if you want to run it anytime that the system is rebooted, have the start time set to "startup" in the scheduler. Then make whatever script you want.
 
User avatar
cmon69
Member Candidate
Member Candidate
Topic Author
Posts: 160
Joined: Sun Dec 10, 2006 2:23 am
Location: Waseca, Minnesota US
Contact:

Re: Script needed

Sun Sep 26, 2010 6:43 pm

I would like to remotely change the IP address and Route Gateway on a customers RB411 used as a CPE.

I believe I need to change both at the same time or risk being disconnected from the CPE, requiring me to go out to the customer’s premises.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Script needed

Sun Sep 26, 2010 7:17 pm

Then you just need to change them within the same scope, which is achieved by either running an actual script or right on the command line by running both on the same line or within curly braces.
/ip address remove 0; /ip address add address=1.1.1.2/24; /ip route set 0 gateway=1.1.1.1
or
{
/ip address remove 0;
/ip address add address=1.1.1.1/24;
/ip route set gateway=1.1.1.1;
}
should work. That allows all necessary commands to be submitted at once and then be executed as one transaction.
 
User avatar
cmon69
Member Candidate
Member Candidate
Topic Author
Posts: 160
Joined: Sun Dec 10, 2006 2:23 am
Location: Waseca, Minnesota US
Contact:

Re: Script needed

Wed Oct 06, 2010 8:41 pm

fewi,

Thank you for your help!

At first the script didn’t work. It kept removing ether1 Ip address instead of wlan1 Ip address.
So I removed the first line and found that I could just go back in and remove the old wlan1 Ip address later without being disconnect from the radio.


{
/ip address add address=10.12.0.15/24;
/ip route set gateway=10.12.0.1;
}

interface=wlan1
numbers=0


Thanks Again!

Who is online

Users browsing this forum: Babujnik and 18 guests