Bagi Bandwidth USER Mikrotik

Cara Pembagian Bandwidth Otomatis USER Mikrotik.Masukkan script berikut di winbox mikrotik.

Script :
/ip firewall mangle
add action=mark-connection chain=forward comment="PCQ Eq" \
    new-connection-mark=equal-mark-con src-address=192.168.2.0/24
add action=mark-packet chain=forward comment="PCQ Eq" connection-mark=\
    equal-mark-con new-packet-mark=equal-mark-pack

/queue type
add kind=pcq name=pcq_down pcq-classifier=dst-address
add kind=pcq name=pcq_up pcq-classifier=src-address



/queue tree


add name=DOWLOAD packet-mark=equal-mark-pack parent=LAN queue=pcq_down
add name=UPLOAD packet-mark=equal-mark-pack parent=WAN queue=pcq_up

Limit Bandwidth mikrotik

 

Cara  Limit Bandwidth ¨iso¨,¨zip¨,¨rar¨,¨pdf¨,¨mp3¨,¨exe¨,¨bin¨,¨7z¨ Menggunakan mikrotik,masukkan script di bawah ini pada mikrotik.

Script :

/ip firewall layer7-protocol
add name=EXE regexp="\\.(exe)"
add name=RAR regexp="\\.(rar)"
add name=ZIP regexp="\\.(zip)"
add name=7Z regexp="\\.(7z)"
add name=PDF regexp="\\.(pdf)"
add name=MP3 regexp="\\.(mp3)"
add name=ISO regexp="\\.(iso)"
add name=BIN regexp="\\.(bin)"
/ip firewall mangle
add action=mark-packet chain=prerouting comment=7z layer7-protocol=7Z \
    new-packet-mark=7z-mark protocol=tcp
add action=mark-packet chain=prerouting comment=bin layer7-protocol=BIN \
    new-packet-mark=bin-mark protocol=tcp
add action=mark-packet chain=prerouting comment=iso layer7-protocol=ISO \
    new-packet-mark=iso-mark protocol=tcp
add action=mark-packet chain=prerouting comment=exe layer7-protocol=EXE \
    new-packet-mark=exe-mark protocol=tcp
add action=mark-packet chain=prerouting comment=mp3 layer7-protocol=MP3 \
    new-packet-mark=mp3-mark protocol=tcp
add action=mark-packet chain=prerouting comment=pdf layer7-protocol=PDF \
    new-packet-mark=pdf-mark protocol=tcp
add action=mark-packet chain=prerouting comment=rar layer7-protocol=RAR \
    new-packet-mark=rar-mark protocol=tcp
add action=mark-packet chain=prerouting comment=zip layer7-protocol=ZIP \
    new-packet-mark=zip-mark protocol=tcp
/queue tree
add comment="1M For All Users " max-limit=1M name=\
    "Total Bandwidth" parent=global queue=default
add name=PDF packet-mark=pdf-mark parent="Total Bandwidth" queue=default
add name=RAR packet-mark=rar-mark parent="Total Bandwidth" queue=default
add name=ISO packet-mark=iso-mark parent="Total Bandwidth" queue=default
add name=MP3 packet-mark=mp3-mark parent="Total Bandwidth" queue=default
add name=EXE packet-mark=exe-mark parent="Total Bandwidth" queue=default
add name=BIN packet-mark=bin-mark parent="Total Bandwidth" queue=default
add name=7Z packet-mark=7z-mark parent="Total Bandwidth" queue=default
add name=ZIP packet-mark=zip-mark parent="Total Bandwidth" queue=default


Bandwidth sharing DHCP dan QUEUE di Mikrotik

Hal pertama yang perlu dilakukan adalah mensetting DHCP klik ''Membuat DHCP Server di Mikrotik''

Sekarang setting  Bandwidth Control (2M/300K per user)

/queue typeadd kind=pcq name=PCQ-DOW pcq-classifier=dst-address pcq-dst-address6-mask=64 \    pcq-rate=2M pcq-src-address6-mask=64add kind=pcq name=PCQ-UP pcq-classifier=src-address pcq-dst-address6-mask=64 \    pcq-rate=300k pcq-src-address6-mask=64
 /queue simpleadd comment="2MB PER USER " name=PCQ-2MB queue=PCQ-UP/PCQ-DOW target=\    192.168.10.0/24

Membuat DHCP server di mikrotik

 SCRIPT :
/interface ethernet
set [find default-name=ether1 ] name=ether1
set [find default-name=ether2 ] name=ether2
set [find default-name=ether3 ] name=ether3
set [find default-name=ether4 ] name=ether4
set [find default-name=ether5 ] name=ether5
set [ find default-name=ether2 ] master-port=ether5
set [ find default-name=ether3 ] master-port=ether5
set [ find default-name=ether4 ] master-port=ether5
set [ find default-name=ether1 ] comment="WAN NETWORK"
set [ find default-name=ether5 ] comment="DHCP SERVER"
/ip address
add address=192.168.1.10/24 comment="WAN NETWORK" interface=ether1 \
network=192.168.1.0
add address=192.168.10.1/24 comment="DHCP SERVER NETWORK" interface=ether5 \
network=192.168.10.0
/ip route
add distance=1 gateway=192.168.1.1
/ip dns
set servers=192.168.1.1,8.8.4.4
/ip pool
add name=dhcp_pool2 ranges=192.168.10.2-192.168.10.254
/ip dhcp-server
add address-pool=dhcp_pool2 disabled=no interface=ether5 name=dhcp3
/ip dhcp-server network
add address=192.168.10.0/24 gateway=192.168.10.1
/ip firewall nat
add action=masquerade chain=srcnat comment="DHCP SERVER MASQUERADE" \
src-address=192.168.10.2-192.168.10.254 to-addresses=0.0.0.0

Membuat backup file di mikrotik


Full Hotspot Setup Backup file

/ip hotspot export file=hotspot_backup 
Hotspot Users Backup file

/ip hotspot user export file=Hotspot_Users

PPPoE Backup file

/ppp export file=pppoe_backup
RESTORE

/import hotspot_backup

Mengirim usermanager database lewat email

 SCRIPT :


:log warning "UserManger Database Sending By www.muarifefendi.com...."
:global sub1 ([/system identity get name])
:global sub2 ([/system clock get time])
:global sub3 ([/system clock get date])
:global sub4 Usermanger
:global adminrece #YOUR@gmail.com
:global gmailid #YOUR@gmail.com
:global user #USER
:global gmailpwd  #PASSWORD
:global gmailip 74.125.136.108
:log warning "Creating New Database....."
/tool e-mail
set address=$gmailip from=$gmailid password=$gmailpwd port=25 start-tls=yes user=$user
/tool user-manager database save name=database
/tool e-mail send to=$adminrece subject="$sub4 $sub3 $sub2 $sub1 Usermanger Database" from=$gmailid file=database.umb server=$gmailip start-tls=yes
:delay 30s
/file remove database.umb
:log warning "Usermanger Database File Removed ...."
/