Tuesday, September 22, 2009

Limit Youtube Video Streaming from mikrotik

1. Make http-video layer7-protocol

/ip firewall layer7-protocol add name=http-video
regexp=http/(0\.9|1\.0|1\.1)[\x09-\x0d ][1-5][0-9][0-9][\x09-\x0d -~]*(content-type: video)

2. Make Mangle Mark Packet http-video

/ip firewall mangle
add action=mark-packet chain=forward
comment="http-video mark-packet" disabled=no
layer7-protocol=http-video new-packet-mark=http-video passthrough=no

3. Make Queue Simple http-video

/queue simple
add max-limit=0/64000 name=http-video packet-marks=http-video

5 comments:

  1. hemmm om, ini khusus untuk streaming youtube aj ya?

    ReplyDelete
  2. kalau di limit pada ip tertentu saja gimana ya Gan :) mohon petunjuk :)

    ReplyDelete
  3. Bisa, tambahkan di rule ini :
    /ip frewall mangle
    add action=mark-packet chain=forward
    comment="http-video mark-packet" disabled=no
    layer7-protocol=http-video new-packet-mark=http-video passthrough=no

    src-address=xxx.xxx.xx.x(kalau cuma 1 ip yg mau di limit)
    atau
    src-address-list=youtube-list (kalau ip yg mau dilimit lbh dari 1 ip)

    ReplyDelete
  4. jika ada yang ingin pake queue tree pake scrip berikut :
    queue tree add name=youtube parent=global-out packet-mark=http-video max-limit=64k

    ReplyDelete