Saturday, September 5, 2020

Mikrotik Block Instagram Apps

Instagram access is restricted in almost every corporate network. Usually, if we apply the restriction using the firewall of mikrotik router, then the users will be blocked from the web access of Instagram, but they will get access with instagram apps.

To block instagram apps we need to take the help of mikrotik's "layer-7 protocol" feature. There some kind  of "RegExp Code" is written. Later,  restrictions are applied using those code. One screenshot is given below.



The regexp code for blocking "Instagram" apps are given below: -


^.+(instagram.com|cdninstagram.com|.cdninstagram.com|.instagram.com|instagram.|.instagram|.cdninstagram|cdninstagram.).*$


How to block "Instagram" apps using layer-7 protocol is discussed step by step below.

First, we will go to the layer-7 protocol from the firewall.


Now we will create a rule and will give a name for “Layer-7 protocol”, then we will write the regexp code and then "apply" and then "OK".


Now we will create a filter rule from the firewall and will go to the “Advanced” tab.


Now we will select the rule we created in “Layer 7 Protocol”. 


Then we will select “Drop” from “Action”.


Finally, we will click on "apply" and then click on "OK". From now on Instagram web access will be blocked as well as access through apps will be blocked.

If you have multiple firewall rules or access rules configured then please make sure you have placed this rule in the right sequence. If you are not sure about that, then place this rule at the top of all of your firewall rules. Just drag it on the up way and drop it at the first position and make sure the rule sequence number is "0". Just like below.


Thank you.



8 comments:

  1. Replies
    1. Sorry to hear that. This regexp code is working for me. This code will capable to block web access as well as app access. Can you tell me that, which one is not working?

      One more thing is that, Here I have attached one wrong picture with selecting the "Action" value. The action value must be selected as "Drop". I have updated it. Please review your settings.

      Delete
    2. you need to block facebook too, for this to worka on the app.

      Delete
    3. To block the facebook web access as well as facebook apps,please explore the below link.

      https://mo-nirul.blogspot.com/2020/09/mikrotik-block-facebook-apps.html

      Delete
  2. Replies
    1. Please make sure you have copied the full code (no missing any single character). Place this rule at the top of all of your firewall rules, also make sure the rule sequence number is "0".

      Delete
  3. how to block IG reels or IG video only, but not with photos?

    ReplyDelete
  4. Good, works prefectly. thank you

    ReplyDelete