open.mp forum
[Server] Block/reject queries with opcode 'c' using iptables - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Support (https://forum.open.mp/forumdisplay.php?fid=12)
--- Thread: [Server] Block/reject queries with opcode 'c' using iptables (/showthread.php?tid=807)



Block/reject queries with opcode 'c' using iptables - AdrianBZG - 2019-09-27

Hi,



I have seen some servers that even tho they have less than 100 players, the players are not listed in the server browser. This is obviously a measure against UDP query flood to the server.



I was wondering if someone could help me or tell me how to do the exact same thing.



Does this require to block SAMP UDP packets with a specific opcode using iptables, e.g. opcode 63 (flag c), which is the one that gives the players info? See?https://wiki.sa-mp.com/wiki/Query_Mechanism#Opcodes?for info about opcodes.



I tried with this iptables rules, but it's not working, I still get the server info in the server browser:



iptables -I INPUT -p udp --dport 7777 -m string --algo kmp --hex-string '|53414d50|' -m string --algo kmp --hex-string '|611e63|' -j DROP



I'm not sure how to do that, please help.



Thanks.