Feature request: restarting interface

It is quite common situation that wehave to change settings and even restart interface (disable/enable) we are using to acces server. MT does not have an option to restart, so we have to disable and then enable interface. That is ok if interface is not th eone we are using to acess MT. If we are n that interface and siable it, then we loose mean to acces MT.

If there is option to restart interface by single click. That way, our connection to MT would break but we would be able to reconec once interface restarts.

you can do this in one line, just separate commands with semi-colon, like this:

disable wlan1; enable wlan1

You can issue more than one command on the console (or in ssh, telnet, …) by separating them with a semicolon (;).

So you could write:

/interface disable ether1;/interface enable ether1

This will help you in your situation, but you have to be sure there’s no typo in your command before pressing enter, as you might still lock yourself out otherwise…

Another option would be to use the safe mode:

  • Do your config changes to the interface you are connected over to the MikroTik.
    Enable safe mode (Ctrl-X).
    Disable the interface.
    Wait a few seconds. You will lose connection to the router, which is detected by safe-mode, and the changes done in safe mode (here: disabling the interface) should be rolled back (here: the interface should be enabled again). Voila!

Just take care that you do NOT enable safe mode BEFORE doing your changes, because then the safe mode roll-backup would also undo all the config changes you made :wink:

Best regards,
Christian Meis

Damn, Normunds! I shouldn’t write that long answers :wink:

Best regards,
Christian Meis

Or just do the “/interface disable ether1;/interface enable ether1” in safe-mode, and have one less disconnection. Why always abuse something, that was designed to work “in-case-shit-happens”?

Do as you like. I just offered this as one of the two possibilities that came to my mind while typing…
And I do see a difference between “abuse” and “creative use” :wink:

Best regards,
Christian Meis

Ok, i obviously missed to mention that I mean on WinBox interface :slight_smile:

pedja: In winbox interface you need to click on “new terminal” and rest has already been explained here :smiley:
…and why would you need to restart interfaces anyway? Just curious.
personal tip: try getting more used to working with console/ssh, it’s way more portable and, when you get used to it, way faster than winbox. (not to mention the already mentioned safe-mode feature)

cmit: While going pretty much off-topic, forcing safe-mode to disconnect you instead of saving your rear-end when it needs saving is abuse to me :wink:
(and…well…it’s somewhat creative, I give that to you. As creative as opening coca-cola cans with shotgun :wink:)

You could use the same commands and put it in a script.
Tou could even use the schedualer to do it for you at set intervals.

Craig

Hey ofca (now that we already are off-topic :wink: ):
Of course what i suggested is a “hack”. But as there’s no clean functionality for what the OP requested, there are some possibilities for a work-around. Those aren’t necessarily “clean”, but do the job :wink:

Apart from that I, too, would be interested to know WHY the OP actually needs to restart an interface.

Best regards,
Christian Meis

Yeah, but I prefer my post to be seen as upgrade to yours, your idea of doing safe on the first look operations that can go oh-so-terribly-wrong because of a typo in safe mode is quite good, I myself never thought of doing this (possibly because I have yet to make a typo while doing something crazy) :wink:

I had to up/down D-Link 4-port ethernet board from time to time, because it was starting to loss lots of packets, but this was long time ago and on FreeBSD; since then I can’t recall doing such things, so…
Pedja please explain! We’re dying of curiousity :smiley:

Now,

If you disable the interface isn’t it still active? I mean you can still sniff/scan (listen) without any problems so the interface isn’t off, as you normally would expect when disabling something. I often have to reboot to really reset a wireless interface. Disabling/Enabling doesn’t give the same effect.

/Henrik

what effect?

could you explain why you have to disable.enable, or even restart router to make changes to something - my overall impression is that ROS has to be restarted only when you are upgrading/updating to new version.

EVen with ethernet interfaces sometimes restarting helps. Most often, I need to restart Dialup and tunnel connections.

I found out that very often, MT cannot handle changes in static routes, and nested simple queues. SOmetimes restarting interface helps, but sometimes reboot is the only solution.

Neverm mind, forget it. I started topic hoping to get something simple, practical and useful and all I got is bunch of people “explaining” to me everything THAT I ALREADY KNOW.

It is interesting that you all are ready to give novice answers on such easy subjects, but when someone asks something that really needs explaining, than you send them to read manuals, literature end everything else even if you know that they already tried that.

I still don’t understand what you don’t like about the semicolon thing?

/system resource print
uptime: 30w5d11h57m56s
version: “2.9.28”
free-memory: 442168kB
total-memory: 516796kB
cpu: “Intel(R)”
cpu-frequency: 2995MHz
cpu-load: 16

We have boxes that have changes made to them almost daily. They also have 100,000+ address-lists. More than 6 interfaces. Hundreds of rules, policy routing, etc. 215 days is pretty good for a mikrotik router : ) Restarting have never been necessary on mikrotik unless you change out hardware.

I think the restarts are necessary in certain cases just as pedja said … dialup (ppp-client) was a little sticky in an older release, and same with ppp tunnels. A async ppp fix was just put in on the last 2-3 releases that fixed a hung port problem we had - so maybe it’s just unstable because of the version you are running. Which version? Let’s get the bugs flushed out so we all have a stable release.

On the other hand we don’t roll out as much wireless, so maybe restarts are more common when using wireless cards.

I think what it comes down to is, do you want to figure out the source of the problem (interfaces need restarting) or do you want to just live with a bandaid.

Something i experience often is clients is unable to connect when changing channels on 2.4 (RB532A/SR2). Diabling/Enabling interface doesn’t have any effect, but rebooting helps getting the clients back on.
Maybe this hasn’t anything to do with the wireless interface but this is what i experience..

/Henrik

Can you use the “semicolon thing” to make a number of changes to move a user from one AP to another. I would need to change their SSID, IP Address and Default Route. Can that all be done on one line using semicolons? If so, that fixes a problem that I “thought” MT had.

yes you can do that

 ip ad disable 5;/ip address ad address=192.168.200.22/24 interface=wlan2; /in wi set wlan2 ssid=ssid mode=station band=2.4ghz-b/g;

at least that worked for me. of course connection to router was severed as i was logged in through wireless

You can’t use item numbers without a print… i.e…

/ip address print
/ip address set 1 address=x.x.x.x

will work, but just /ip address set 1 … won’t.

It’s silly that a print is required prior to making changes. Doing the print and set in one line (semi colon), does not work either…