############################################### # # create layer7 protocol # ############################################### /ip firewall layer7-protocol add name=facebook comment="Block Facebook" regexp="^(.*)(facebook)(.*)\$" add name=youtube comment="Block Youtube" regexp="^(.*)(youtube)(.*)\$" add name=bittorrent comment="Block Bit Torrent" regexp="^(\\x13bitt\ orrent protocol|azver\\x01\$|get /scrape\\\?info_hash=get /announce\\\?inf\ o_hash=|get /client/bitcomet/|GET /data\\\?fid=)|d1:ad2:id20:|\\x08'7P\\)[\ RP]" ############################################### # # create bittorrent blocker fillter # ############################################### /ip firewall filter add action=add-src-to-address-list address-list=Torrent-Block \ address-list-timeout=2m chain=forward layer7-protocol=\ bittorrent src-address-list=\ !allow-bit comment="Block Bit Torrent" add action=drop chain=forward dst-port=\ !0-1024,8291,5900,5800,3389,14147,5222,59905 protocol=tcp \ src-address-list=Torrent-Block comment="Block Bit Torrent" add action=drop chain=forward dst-port=\ !0-1024,8291,5900,5800,3389,14147,5222,59905 protocol=udp \ src-address-list=Torrent-Block ############################################### # # create facebook blocker filter # ############################################### /ip firewall filter add action=drop chain=forward comment="Block Facebook" layer7-protocol=facebook ############################################### # # create youtube blocker filter # ############################################### /ip firewall filter add action=drop chain=forward comment="Block Youtube" layer7-protocol=youtube