Tag Archives: mikrotik

Mikrotik Script: Alert on queue tree limit exceeded

Hi guys,

This is my first post here, I’m a Network Engineer who works a lot with Mikrotik devices and Server Administration and you can see more of my posts on my website. I found this blog some time ago and was invited to contribute with some of my own scripts that may help others!

Today i’ll show you a little script for RouterOS to check if queue tree exceed the limit you set.

For. Example I’ve got a queue tree that limits the amount of total traffic (Upload+Download) to 50Mbps.

I want to know whenever this queue exceed the limit, and I want the system to send me an email.

This is the script:

:global checkrate [/queue tree get total-traffic rate]
:local limit 50000000

:if ( $checkrate < $limit ) do={
:log info ("Queue not Exceeded")
}
:if ( $checkrate > $limit ) do={
:log info ("Queue Exceeded")
/tool e-mail send server=xxx.xxx.xxx.xxx from="me@myself.com" to="me@myself.com" subject=("Queue Limit Exceed") body=("Queue Limit Exceed, Limit is: " . $checkrate)
}
Enjoy!

CRS Basic Vlan Configuration

I’ve been playing around with v6.13rc12 over the last week on a CRS125-24G-1S and have put together a an example script for provisioning the unit with a user-vlan and an admin-vlan that are trunked back via the SFP port.

I’ve been waiting for a long time to have a usable and readable switch chip config on the CRS platform, so I hope this is useful for some of you guys too.

CRS125-24G-1S-RM

Continue reading CRS Basic Vlan Configuration

The Mother of all QoS Trees – v6.0

Contained in this post is a free copy of my 2013 QoS tree (compatible with v6.0) for anyone to do what they want with, I only ask that if you republish this you include a link to this post.

It is intended to work on a per-interface basis; with you specifying the WAN interface and the speed limit it is to have. You can then use simple-queues for your internal users for a full double-qos solution.

Continue reading The Mother of all QoS Trees – v6.0

CloudCoreRouter and RouterOS v6.x (linked post)

Janis M. from MikroTik was kind enough to point me to a copy of his presentation from the Russian MUM which I feel is an incredible helpful document and well worth a read by all of the current CCR users out there.

I would highly encourage anyone running (or thinking of running) CCR’s on their network to review this document, which both explains both the current workings and limitations of the CCR series and v6 or RouterOS as well as discussing what changes will be made in v7

The Tiktube video for the presentation isn’t up just yet but I’ll come back and add it when it has been uploaded by MikroTik.

Some of the most useful points cover:

  • multi-core packet processing (how packets coming into the router are handled across the 16 or 36 cores available)
  • best-practise for queue tree setups
  • pptp/lt2p/pppoe changes for packet handling
  • best-practise for processing packets on the firewall (this is reiterating old instructions, but still holds true for v6)
  • why layer-7 is the last thing you should be using when tagging packets
  • how bgp is currently single-core in v6 and how routing protocols are changing in v7

Hopefully this is enough to catch your attention, now go get reading!

CloudCoreRouter and RouterOS v6.x – Tips and Tricks (Moscow MUM Russia 2014)

Gmail + Google Drive + MikroTik scripting = Automated Backups Folder

I was recently looking for a simpler alternative to something like RANCID to periodically backup all our MikroTik configs.

RANCID is great and all, but I didn’t really need the diff copies of each file, and I was plenty happy just knowing that I have a .backup and .rsc file for each router I manage.

Given I use Gmail it might have been ok just to have each router send them there and leave it at that, but I’m not really the sort of person to half-ass my afterhours projects.. I learnt from Greg that you have to just whole-ass them 🙂

Continue reading Gmail + Google Drive + MikroTik scripting = Automated Backups Folder