sinet.com.kh

Wednesday, July 20, 2016

Mikrotik Router Block Facebook/Youtube and Allow Specific Host(s) using Layer 7 Protocol

1. Block Facebook/Youtube

    1.1 Create new Regexp rule at Layer7 Protocols

    Go to IP > Firewall > Layer7 Protocol > (+)
           -Name: Facebook/Youtube
           -Regexp: ^.+(facebook.com|youtube).*$ 

    1.2 Create Filter Rule to Block Facebook/Youtube

    Go to IP > Firewall > Filter Rules > (+)
    +General (Tab)
           -Chain: forward
           -Src. Address: 192.168.1.0/24                        //LAN
    +Advanced (Tab)
           -Layer7 Protocol: Facebook/Youtube        //Name of Layer7 Protocol
    +Action (Tab)
           -Action: drop
    Apply > OK



2.  Allow Specific Host(0) to use Facebook/Youtube

    Go to IP > Firewall > Filter Rules > (+)
    +General (Tab)
           -Chain: forward
    +Action (Tab)
           -Action: accept
    Apply > OK 


  >>>>>>>Script

/ip firewall layer7-protocol
add name=Facebook/Youtbue regexp="^.+(facebook.com|youtube).*$"

/ip firewall filter
add chain=forward src-address=192.168.1.7
add action=drop chain=forward layer7-protocol=Facebook/Youtbue src-address=192.168.1.0/24

/ip firewall filter
add chain=forward src-address=192.168.1.7

No comments:

Post a Comment