May 6, 2012
tom

How to block specific UDP packet outgoing from machine using iptables

Question

I want to block specific UDP packet OUTGOING from my machine using iptables. Packet has a string in “hex in RAW”(?) i want to check packet by it.

Like: If UDP packet hex RAW match “test_text” – block it.

//EDIT:
i have something like this

iptables -A OUTPUT -p udp -m multiport --sports 8000 -m string --algo bm --string "test" -j DROP

but it gives error

iptables: No chain/target/match by that name.

Asked by wlodzimierz

Answer

There is a “string” match netfilter extension, that might or might not be compiled in/available as a module on your system.

Do not forget that such things can inherently have a serious performance impact, especially if more packets than necessary are subjected to that match.

Answered by rackandboneman

No related posts.

Leave a comment