How to convert a MT box in an Anti Spam server with v2.9

Diambil dari

Hi there, for months I have the idea how to transform one Mikrotik OS in an Anti Spam server. After more than 20 days applying few scripts, firewall rules and address list, I have achieved reduce from 45.000 mails per day to only 11.000/12.000 without many complaints from my customers.

Before continuing, some details about this:

Yes, I know that exists others solutions.
Yes, I know with Linux can obtain the same results.
Yes, I know that it seems a crazy solution.
Yes, I know (in the practice) that this solutions generate a moderate cpu usage. I have a Pentium IV with 75% of cpu usage (this can change with new features from MT… see scripts explanation) and we are a little ISP.
Yes, yes, yes…
I use MT from six years ago (when John Tully & Arnis Riekstins answered the company mails themselves) and always I try to resolve any networking necessity whit MT.
I had the trust that can resolve this whit MT.
and after thinking about this, I can’t never sleep all night from many days, so, for my health and wife I made it !!!

Read more »

Bypass icmp via htb.init

Kalau pakai script htb.init biasa kita bisa membaypass icmp supaya ping time kecil.

Selama ini saya berpikir untuk membaypass harus pakai teknik mangle di firewall.

Ternyata hal itu tidak sepenuhnya benar.

Setelah di ajari oleh master-nya noc isp di semarang baru tahu saya, kalau itu bisa tanpa mangle.

Procedurenya :

buka file htb.init di /var/cache

tambahkan baris ini di bawah baris

/sbin/tc qdisc del dev eth0 root
/sbin/tc qdisc add dev eth0 root handle 1 htb default 0 r2q 100

/sbin/tc qdisc del dev eth1 root
/sbin/tc qdisc add dev eth1 root handle 1 htb default 0 r2q 100
/sbin/tc class add dev eth0 parent 1: classid 1:2 htb rate 128kbit
/sbin/tc class add dev eth1 parent 1: classid 1:2 htb rate 128kbit
/sbin/tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip protocol 1 0xff flowid 1:2
/sbin/tc filter add dev eth1 parent 1: protocol ip prio 1 u32 match ip protocol 1 0xff flowid 1:2

Disconnecting the users with bad signal [2.9.X]

Diambil dari


Small manual:
Install – click system->scripts, click “+”, enter in the name whatevery you want (like signallimiter), click ok, done!

Read more »

How to prevent NATed access

Sesuai dengan judul diatas,
inti dari kasus ini adalah penyedia jasa tidak ingin BW yang diberikan kepada user di sharing lagi mempergunakan nat-router.

Ilmu baru buat saya, dengan memberikan TTL=1 ?, mmmm aneh sekali.
Read more »

A script to watch the battery voltage?

Script dibawah berfungsi untuk memberitahu admin via email, bila ada masalah listrik pada UPS yang dipakai oleh mikrotik.
Fungsi dibawah belum pernah saya coba, tapi ide-nya menarik untuk dipelajari.


:set sysname [/system identity get name]

:set datetime ([/system clock get date] . " " . [/system clock get time])# Erster Lauf und Flags noch uninitialisiert?

:if (("-" . $flagonbatt)="-") do {:global flagonbatt 0}

:if (("-" . $flagbatlow)="-") do {:global flagbatlow 0}

:set curonbatt false

:set curbatlow false

/system ups monitor [/system ups find name "ups1"] once do {:set curonbatt $on-battery; :set curbatlow $low-battery}

:if (($curonbatt) && ($flagonbatt=0)) do {

:global flagonbatt 1

/tool e-mail send from="ups" to="somwwhere" server="" subject=($sysname . " ist ohne Strom!") body=($sysname . " hat keinen Saft seit " . $datetime)

:log info "Power-Fail: Email gesendet"


:if ((!$curonbatt) && ($flagonbatt=1)) do {

:global flagonbatt 0

/tool e-mail send from="ups" to="somewhere" server="" subject=($sysname . " hat wieder Strom") body=($sysname . " saftelt wieder seit " . $datetime)

:log info "Power-Restore: Email gesendet"


:if (($curbatlow) && ($flagbatlow=0)) do {

:global flagbatlow 1

/tool e-mail send from="ups" to="somewhere" server="" subject=($sysname . " Batterie leer!") body=($sysname . " hat fast keine Batterie mehr - " . $datetime)

:log info "Batt-Low: Email gesendet"


:if ((!$curbatlow) && ($flagbatlow=1)) do {

:global flagbatlow 0

/tool e-mail send from="ups" to="somwhere" server="" subject=($sysname . " Batterie nachgeladen") body=($sysname . " Battery-Low beendet - " . $datetime)

:log info "Batt-Low-Ende: Email gesendet"


Squid Delaypools

(migrasi dari

Another useful squid feature is delay pools. Conceptually, delay pools are bandwidth limitations – “pools” of bandwidth that drain out as people browse the Web, and fill up at a rate you specify – this can be thought of as a leaky bucket that is continually being filled.
This is useful when bandwidth charges are expensive like in indonesia.
Delay pools provide a way to limit the bandwidth of certain requests based on any list of criteria. The idea came from a Western Australian university who wanted to restrict student traffic costs (without affecting staff traffic, and still getting cache and local peering hits at full speed).

To enable this, configure squid with the –enable-delay-pools option. There are 3 classes of delay pools – class 1 is a single aggregate bucket, class 2 is an aggregate bucket with an individual bucket for each host in the class C, and class 3 is an aggregate bucket, with a network bucket (for each class B) and an individual bucket for each host. Read more »