12. Mikrotik Limit Speed By Website




Here is a script:

/ip firewall filter
add action=add-dst-to-address-list address-list=Youtube-List chain=forward \
    comment=Dst-Youtube-List content=googlevideo.com
add action=add-dst-to-address-list address-list=Mediafire-List chain=forward \
    comment=Mediafire.com content=mediafire.com

/ip firewall mangle
add action=mark-connection chain=forward comment=Youtube.com \
    connection-state=new dst-address-list=Youtube-List new-connection-mark=\
    Youtube-conn
add action=mark-packet chain=forward connection-mark=Youtube-conn \
    new-packet-mark=Youtube-conn passthrough=no
add action=mark-connection chain=forward comment=Mediafire.com \
    connection-state=new dst-address-list=Mediafire-List new-connection-mark=\
    Mediafire-conn
add action=mark-packet chain=forward connection-mark=Mediafire-conn \
    new-packet-mark=Mediafire-conn passthrough=no

/queue simple
add max-limit=2M/2M name=LAN target=bridge-Local
add max-limit=2M/2M name=Youtube.com packet-marks=Youtube-conn parent=LAN \
    target=""
add max-limit=512k/512k name=Mediafire.com packet-marks=Mediafire-conn \
    parent=LAN target=""
add max-limit=1M/1M name=Other packet-marks=no-mark parent=LAN target=""


Note: if you need to add more websites, you need to followup below three steps:

1. Add website to Firewall:
 /ip firewall filter
add action=add-dst-to-address-list address-list=XXX-List chain=forward \
    comment=Dst-XXX-List content=XXX.com

2. Add website to Mangle:
 /ip firewall mangle
add action=mark-connection chain=forward comment=XXX.com \
    connection-state=new dst-address-list=XXX-List new-connection-mark=\
    XXX-conn

3. Add Queue:
/queue simple
add max-limit=2M/2M name=XXX.com packet-marks=XXX-conn parent=LAN \
    target=""

Previous
Next Post »

2 comments

Write comments