You can do it that way, but when someone asks the type of simple question that was asked, it is very likely that they will not understand that answer. A simpler approach would be:
hmmm… Butch, have you checked these rules?.. I saw somewhere that rules like “p2p=all-p2p src-address=client_ip” (those who check only one direction of tcp traffic, src-address=xxx) match less p2p traffic than bidirectional rules… if that is true, than the most complete solution will be marking all p2p packets, then allow packets to and from the client, and after that drop all the rest
The following doesn’t make sense, since the source & destination address would never be the same, unless you want to connect to yourself which would be silly:
let’s examine step-by-step:
client_ip → server_ip: is not dropped, because ‘src-address=!client_ip’ do not match
server_ip → client_ip: is not dropped, because ‘dst-address=!client_ip’ do not match
other_client_ip → server_ip: is dropped, because both conditions match
server_ip → other_client_ip: is dropped, because both conditions match
I don’t use that sort of rule myself. I used it as an example for instructional purposes. I’d believe your contention that a bidirectional rule will capture more traffic is accurate. My personal approach would be something like:
Although I doubt the original questioner would approach it this way. Depending on the other complexities of the existing firewall application, the above is an easy to use approach, however.
The better approach is still to not detect P2P and deal with it, but to deal with all protocols you can easily detect and prioritize and shape, and then deal with ‘the rest’, which will include P2P.
FWIW, this is EXACTLY what my QOS does. It really is the only way. Actually, I do use the p2p matcher first (for that small amount of p2p we CAN detect).
What is it that you don’t understand? The P2P matcher is not perfect. The best approach to “detecting” p2p is to identify all things that are NOT p2p and then assume the remainder IS p2p.