How to fix P2P matcher error in mangle rules

 

You have upgraded to RouterOs 6.39.x and now your P2P mangle rules are no longer working. This issue is caused by MikroTik removing the P2P option/field from the mangle rules. There explanation is that this method of matching P2P traffic is obsolete. The image above shows what the error looks like. To fix this issue you would have to use the Layer 7 matcher for P2P traffic. To create this matcher, go to firewall–>Layer7 Protocols and add the following code in a new Layer 7 matcher.

^(\x13bittorrent protocol|azver\x01$|get /scrape\?info_hash=get /announce\?info_hash=|get /client/bitcomet/|GET /data\?fid=)|d1:ad2:id20:|\x08'7P\)[RP]

This is how the screen should look.

Now that you have created the Layer 7 matcher for P2P traffic you need to add it to you mangle rules that are show the error message.