Follow us on...
Follow us on G+ Follow us on Twitter Follow us on Facebook Watch us on YouTube
Register
Page 1 of 4 123 ... LastLast
Results 1 to 15 of 57
  1. #1
    Status
    Offline
    okto_2005's Avatar
    Member Super Senior
    Join Date
    Jul 2007
    Posts
    655
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0

    [Share] Script u/ membatasi BW jika suatu traffic client melewati batas tertentu

    Misalkan kita punya script simple queue seperti bawah ini:

    Code:
    add name="Isp" target-addresses=192.111.111.99/32 dst-address=0.0.0.0/0 \
        interface=all parent=none direction=both priority=8 \
        queue=default-small/share-ni-down limit-at=0/0 max-limit=32000/64000 \
        burst-limit=/128000 burst-threshold=/30000 burst-time=/10s \
        total-queue=default-small disabled=no
    dan kita menginginkan membatasi bandwidth-nya jika trafficnya sudah melewati misalkan 500MB dalam satu hari, maka kita bisa membuat script dibawah ini:

    Code:
    add name="trafwatcher01" source="
    /queue simple
    :local traf;
    :set traf [get [find name="Isp"] total-bytes]
    :if ($traf  > 500000000) do = {
    set [find name="Isp"] max-limit= 32000/32000
    :log info "isp traffic exceeding 500MB"}
    policy=ftp,reboot,read,write,policy,test,winbox,password

    variabel traf fungsinya untuk menampung sementara nilai total traffic

    buat scheduler untuk mengecek traffic script-nya, misalnya dibuat setiap 1/2 jam untuk mengeceknya.
    Code:
    add name="trafisp" on-event=trafwatcher01 start-date=jan/01/1970 \
        start-time=11:00:00 interval=30m comment="" disabled=no

    nah itu untuk script untuk membatasinya, tinggal membuat script satu lagi jika sudah melewati satu hari (misal jam 12 malam), counternya mereset total traffic queue client tsb dan mereset bandwidthnya normal ke 64 kbps lagi.

    GOODLUCK

    sumber: wiki dan howto-script mikrotik
    Last edited by okto_2005; 06-12-2007 at 15:26.

  2. The Following 20 Users Say Thank You to okto_2005 For This Useful Post:

    + Show/Hide list of the thanked


  3. #2
    Status
    Offline
    masea's Avatar
    Newbie
    Join Date
    Jul 2007
    Posts
    28
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0

    Membagi Bandwidth /client ?

    Bung Okto sekalian nih saya mo nanya script buat membatasi bandwidth buat client, casenya gini :

    Misal, saya punya 1 Access Point dengan 1 Mbps Bandwidth, dan ada 3 client yg terkoneksi.
    Saya maunya setiap client dibatasi Bandwidth Maximal 128 kbps dan Minimal 32kbps, tapi bila hanya 1 client saja yang terkoneksi atau sedang kirim/terima data sedangkan yang lain dalam status IDLE atau tidak menggunakan jaringan, maka client tsb mendapat seluruh bandwidth yg ada (1 Mbps).

    Thank's banget nih bung, atas share elmunya Click here to enlargeClick here to enlarge

    Salam,

    Donny

  4. #3
    Status
    Offline
    okto_2005's Avatar
    Member Super Senior
    Join Date
    Jul 2007
    Posts
    655
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    kalo model share gitu pakai aja pcq...
    max-limit 128k, limit at 32k, burst 1M, threshold nya tinggal diatur2.

    kalo engga cara 2:
    bikin script dulu deteksi kalo ada minimal 2 client maka queue-nya diberlakuin max-limit 128, limit-at 32k.

    begitu salah 2 client-nya off langsung script quenya jalan :
    limit-at 1M (jadi scriptnya langsung mengubah limit-at nya. settingan yg laen langsung kehapus), begitu client yg laen hidup lsg normalin rule-nya)

    hint: pake netwatch buat deteksi client idup apa engga.(pakai ip) tapi ada kelemahannya kalo misalnya client pake firewall maka RTO mulu maka dianggap client off lebih baik pake cara 1 aja lebih safe

  5. The Following 4 Users Say Thank You to okto_2005 For This Useful Post:


  6. #4
    Status
    Offline
    zainalk29's Avatar
    Member Super Senior
    Join Date
    Aug 2007
    Location
    Banjarmasin, Yogyakarta, Indonesia
    Posts
    676
    Reviews
    Read 0 Reviews
    Downloads
    1
    Uploads
    0
    Feedback Score
    0
    bener bung okto_2005

    untuk masea :

    mudahan ini bisa jadi gambaran :

    Click here to enlarge

    THX

  7. The Following 3 Users Say Thank You to zainalk29 For This Useful Post:


  8. #5
    Status
    Offline
    lonthong2002's Avatar
    Member Senior
    Join Date
    Jul 2007
    Location
    Malang
    Posts
    397
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    1 (100%)
    kalau client nya pake dhcp gimana rule nya yaa... apa bisa ?... misalnya mau diterapin di hotel... Click here to enlargeClick here to enlargeClick here to enlargeClick here to enlarge

  9. #6
    Status
    Offline
    okto_2005's Avatar
    Member Super Senior
    Join Date
    Jul 2007
    Posts
    655
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    pake aja MAC ^^.

  10. The Following 2 Users Say Thank You to okto_2005 For This Useful Post:


  11. #7
    Status
    Offline
    masea's Avatar
    Newbie
    Join Date
    Jul 2007
    Posts
    28
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0

    Thank's untuk responnya

    oke sip guys...
    sy cobain dulu deh ..Click here to enlargeClick here to enlargeClick here to enlarge


    Salam

    Donny

  12. #8
    Status
    Offline
    lonthong2002's Avatar
    Member Senior
    Join Date
    Jul 2007
    Location
    Malang
    Posts
    397
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    1 (100%)
    mataps... bro okto.... Click here to enlargeClick here to enlargeClick here to enlargeClick here to enlarge
    kalau saja diberi bocoran sedikit cara limit pake mac...Click here to enlargeClick here to enlarge

  13. #9
    Status
    Offline
    okto_2005's Avatar
    Member Super Senior
    Join Date
    Jul 2007
    Posts
    655
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    tambahan:
    berhubung simple que g bisa memakai MAC maka kita harus mengakalinya dulu lewat mangle...
    cara liat MAC Client di bagian ip > ARP nah tinggal diliatin aja ip client tsb masukin ke mangle nah dari mangle ini tinggal diaplikasikan ke simple queue atau queue tree

  14. The Following 3 Users Say Thank You to okto_2005 For This Useful Post:


  15. #10
    Status
    Offline
    [a]
    [a]'s Avatar
    Administrator
    Join Date
    Jun 2007
    Location
    Jakarta, Indonesia, Indonesia
    Posts
    1,729
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    1 (100%)
    yups...bener, mau ga mau harus pake mangle dulu...

    sedikit muter2 tapi tujuan tercapai Click here to enlarge

  16. The Following User Says Thank You to [a] For This Useful Post:


  17. #11
    Status
    Offline
    lini's Avatar
    Forum Guru
    Join Date
    Sep 2007
    Location
    Karawaci
    Posts
    1,961
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    2 (100%)
    sepertinya kalo buat hotel gak efektif pake mac...karena yang terkoneksi khan pengunjung hotel yang gonta ganti orang gonta ganti perangkat.

    bukankah pake queue pcq berdasarkan satu group ip /24 sudah otomatis membagi bw secara proporsional ke semua pengguna ??

    CMIIW

  18. #12
    Status
    Offline
    [a]
    [a]'s Avatar
    Administrator
    Join Date
    Jun 2007
    Location
    Jakarta, Indonesia, Indonesia
    Posts
    1,729
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    1 (100%)
    klo buat hotel memang ga bisa bro...yang ada IT-nya mabok dipanggilin mulu klo ada yg mau connect ke hotspot...

    tapi kadang2...sekali lagi...kadang2...ada beberapa tempat yg sangat hati2 dengan jaringannya, jadi klo ada yg mau connect ke hotspot pun ga bisa sembarangan....musti contact IT dulu buat ditambahin MAC-Addr nya ke list....

    hal ini misalnya diterapkan pada lingkungan yg dirasa banyak orang 'jail'-nya...walau ga bisa bener2 nge-blok orang 'jail' tapi at least lebih mempersulit gerak-geriknya ajah, karena MAC-Addr dia di record...

  19. The Following User Says Thank You to [a] For This Useful Post:


  20. #13
    Status
    Offline
    lonthong2002's Avatar
    Member Senior
    Join Date
    Jul 2007
    Location
    Malang
    Posts
    397
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    1 (100%)
    Trus gimana dong cara limitnya.....atau dilimit sesuai dengan quota aja ya..he he he..bingung ....Click here to enlargeClick here to enlarge

  21. #14
    Status
    Offline
    okto_2005's Avatar
    Member Super Senior
    Join Date
    Jul 2007
    Posts
    655
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0

    Advanced Script 1

    Biar lebih sip gue utak atik lagi scriptnya, jadi 2 tingkat ato bahkan bisa lebih.

    Pelajari aja code bawah ini:
    Code:
    /queue simple
    :local traf;
    :local maxi;
    :set traf [get [find name="Isp"] total-bytes]
    :set maxi [get [find name="Isp"] max-limit]
    :if ($traf  < 10000000 && $maxi != "64000/96000") do = {
    set [find name="Isp"] max-limit= "64000/96000"}
    :if ($traf  > 10000000 && $maxi != "64000/64000") do = {
    set [find name="Isp"] max-limit= "64000/64000"}
    :if ($traf  > 100000000 && $maxi != "64000/32000") do = {
    set [find name="Isp"] max-limit= "32000/32000"
    /sys sched disa [find name="isp-trafwatcher"]}
    Penjelasan:
    Gue buat 2 tingkat bandwidth limiternya jadi dibawah 10MB masih sesuai limit awal, 10 - 100 MB turun jadi 64k, atas 100MB jadi 32k

    biar script ngga ngulang ngulang terus di log-nya dibuat satu variabel lagi yaitu variabel maxi yang menampung setting bandwidthnya, kalo tidak sama dengan logika-nya maka que simple ga di set ulang.

    di script terakhir ditambahin buat mendisable schedulernya biar scheduler ga jalan terus ( di disable).

    nah biar enable lagi, perlu dibuat satu script lagi untuk men-clear counter trafficnya dan meng-enable lagi schedulernya,misalnya tiap jam 00:00

    script buat enable lagi en autoclear counter. kasi nama script bebas, abis itu buat juga schedulenya

    Code:
    /ip fire filt reset-counters-all
    /que tree reset-counters-all
    /que sim reset-counters-all
    /sys sched ena [find name="isp-trafwatcher"]
    Last edited by okto_2005; 23-01-2008 at 09:08.

  22. The Following 7 Users Say Thank You to okto_2005 For This Useful Post:


  23. #15
    Status
    Offline
    nix
    nix's Avatar
    Newbie
    Join Date
    Jul 2007
    Posts
    52
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    siippp ,... nyobai ach...Click here to enlarge

 

 
Page 1 of 4 123 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Transparent Traffic Shaper
    By [a] in forum QOS & Traffic Shaping
    Replies: 13
    Last Post: 06-07-2015, 16:35
  2. [Ask] Script biar Client cuman bisa browse IIX aja
    By okto_2005 in forum Scripting @ Mikrotik
    Replies: 21
    Last Post: 13-03-2013, 07:06
  3. tanya: cara membatasi mac address client
    By carrud in forum General Networking
    Replies: 5
    Last Post: 27-11-2011, 12:42
  4. jika disuruh nyeting warnet
    By koncop in forum General Networking
    Replies: 12
    Last Post: 21-02-2010, 21:03
  5. [minta tolong] traffic shape
    By xamdah in forum General Networking
    Replies: 1
    Last Post: 29-08-2007, 13:34

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •